So you’re under Windows and want to generate Unix makefiles, right? Then I guess you’re using a gcc from some Unix environment/toolset in Windows like MSYS, MSYS2, MinGW, MinGW64 or Cygwin. Which one are you using?
I’ve just realized you’re using a compiler I’ve never heard of. Interesting. Yes, mutexes (short of mutual exclusion) are structures to avoid race conditions in mutithreading programs (such as trying to write to the same file from different threads at the same time).
After reading the topic in SO, I agree that you should switch to MinGW64 as suggested by the answers there. As a plus, you’ll be able to compile 64-bit programs.
I added ‘-std=c++11’ in the CMakeLists.txt at the root folder like these:
set(CMAKE_CXX_FLAGS “-std=c++11”)
But seems no effect. Can’t see any ‘-std=c++11’ in the generated Makefile
From the errors, you need to enable “big object” support: -Wa,-mbig-obj (GNU) or /bigobj (Visual Studio). These can be set in your CMAKE_CXX_FLAGS and CMAKE_C_FLAGS CMake variables.
– Performing Test EIGEN_COMPILER_SUPPORT_CPP11 - Failed
– Performing Test standard_math_library_linked_to_automatically
– Performing Test standard_math_library_linked_to_automatically - Failed
– Performing Test standard_math_library_linked_to_as_m
– Performing Test standard_math_library_linked_to_as_m - Failed
CMake Error at ThirdParty/eigen/vtkeigen/CMakeLists.txt:123 (message):
Can’t link to the standard math library. Please report to the Eigen
developers, telling them about your platform.
Well, if upgrading (the recommended action to fix the bug) is not an option, then you can try tweaking Eigen’s CMake script that come with VTK: cmake/FindStandardMathLibrary.cmake:
I can compile that little program, but still got that error. I left a comment under that issue.
Bypassing this check, I finished to configure.
I use :
set (CMAKE_CXX_FLAGS “-std=c++0x -Wa -mbig-obj”)
When Make, got an error:
[ 1%] Building CXX object Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/Directory.cxx.obj
g++.exe: error: unrecognized command line option '-Wa'; did you mean '-W'?
g++.exe: error: unrecognized command line option '-mbig-obj'
make[2]: *** [Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/build.make:153: Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/Directory.cxx.obj] Error 1
This eq-gnu compiler I am using has an x86_64-w64-mingw32 sub folder. So it’s also a MINGW.
Running into error with mutex, I decided to give MinGW a go. I downloaded x86_64-posix-sjlj, also I changed to use MinGW generator. Then I finished build VTK.
After changing the setting of RenderingContextOpenGL2 from DEFAULT to YES, I got the project running. This time I changed it by editing the CMakeCache.txt file.
I think the eq-gnu compiler is the same as x86_64-win32-sjlj, but has a newer version c/c++.
It’s good that you managed to compile VTK, but you are restricted to 32-bit binaries with MinGW. MinGW64, despite its name, is a different project and, thus, a different toolset. Alternatively, you can try Visual Studio Community to have 64-bit capability in Windows. With 32-bit, you may run into problems if your project grows by including certain header-only libraries like Boost, Eigen and ExpressTK, as they tend to result in too many symbols in your program, especially in Debug mode. 32-bit programs are also prone to memory fragmentation which is more likely as your scene grows in complexity.