This forum has been archived. All content is frozen. Please use KDE Discuss instead.

bench/BenchTimer.h (31) syntax error: 'volatile'

Tags: None
(comma "," separated)
dfigueira
Registered Member
Posts
3
Karma
0
Hi all, could you help me with this flabbergasting error?

tests.cpp
Code: Select all
#include <iostream>
#include <bench/BenchTimer.h>

int main() {
   Eigen::BenchTimer t;
   t.reset(); t.start();

   //TestEigenSolveSpeed();

   t.stop();
   std::cout << t.value()  << std::endl;

   return 0;
}


CMakeLists.txt
Code: Select all
cmake_minimum_required(VERSION 3.11)

set(LEVELING_NAME test-eigen)

project(${LEVELING_NAME})

add_executable(${LEVELING_NAME} tests.cpp )

target_include_directories(${LEVELING_NAME} PUBLIC
   ${CMAKE_CURRENT_LIST_DIR}/deps/eigen-master   
)


Folder structure:
Code: Select all
/
|
-- CMakeLists.txt
-- tests.cpp
-- deps
   |
   -- eigen-master


Created solution with:
Code: Select all
cmake . -DCMAKE_GENERATOR_PLATFORM=x64 -B build


In Windows, in VS2017

with newest repository version: master version 3.3.3

Here is the three files plus the repository in a zip for ease of reproduction: https://www.dropbox.com/s/avpfbabo4l9ti ... e.zip?dl=0
dfigueira
Registered Member
Posts
3
Karma
0
As ggael mentioned, the solution is commenting the two offending code lines:

Code: Select all
static void escape(void *p) {
  //asm volatile("" : : "g"(p) : "memory");
}

static void clobber() {
  //asm volatile("" : : : "memory");
}

This "volatile" does not seem supported/accepted by MSVS2017

It is however already fixed by ggael in the newest version of the repository :)


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell