3

I'm trying to configure Eigen, and I keep getting the following error messages when I try to run the following CMake command: cmake .. -G "Visual Studio 17 2022" -DCMAKE_INSTALL_PREFIX=C:/biogears/external

Performing Test COMPILER_SUPPORT_std=cpp03 - Failed

I'm using Visual Studio 17 2022 Windows x64. I'm using the x64 Native Tools Command Prompt of VS 2022, and went through the "getting started" guide to make sure C++ is installed.

I've also tried setting the CMake C++ variable using cmake .. -G "Visual Studio 17 2022" -DCMAKE_INSTALL_PREFIX=C:/biogears/external -DCMAKE_CXX_COMPILER_ID=msvc but no changes.

Does anyone have any idea how to fix this?

c:\src\eigen-3.4.0\build>cmake .. -G "Visual Studio 17 2022" -DCMAKE_INSTALL_PREFIX=C:/biogears/external
-- Performing Test COMPILER_SUPPORT_std=cpp03
-- Performing Test COMPILER_SUPPORT_std=cpp03 - Failed
-- Standard libraries to link to explicitly: none
-- Found unsuitable Qt version "" from NOTFOUND
skip snippet C:/src/eigen-3.4.0/doc/snippets/Array_initializer_list_23_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Array_initializer_list_vector_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Array_variadic_ctor_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/MatrixBase_colwise_iterator_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Matrix_initializer_list_23_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Matrix_initializer_list_vector_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Matrix_variadic_ctor_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Slicing_custom_padding_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Slicing_rawarray_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Slicing_stdvector_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Tutorial_range_for_loop_1d_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Tutorial_range_for_loop_2d_cxx11.cpp because compiler does not support C++11
skip snippet C:/src/eigen-3.4.0/doc/snippets/Tutorial_std_sort_rows_cxx11.cpp because compiler does not support C++11
CMake Deprecation Warning at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeDetermineVSServicePack.cmake:38 (message):
  This module is deprecated and should not be used.  Use the
  CMAKE_<LANG>_COMPILER_VERSION variable instead.
Call Stack (most recent call first):
  cmake/EigenDetermineVSServicePack.cmake:1 (include)
  cmake/EigenTesting.cmake:459 (include)
  cmake/EigenTesting.cmake:598 (ei_get_compilerver)
  cmake/EigenConfigureTesting.cmake:8 (ei_set_build_string)
  CMakeLists.txt:487 (include)


-- Could NOT find CHOLMOD (missing: CHOLMOD_INCLUDES CHOLMOD_LIBRARIES)
-- Could NOT find UMFPACK (missing: UMFPACK_INCLUDES UMFPACK_LIBRARIES)
-- Could NOT find KLU (missing: KLU_INCLUDES KLU_LIBRARIES)
-- Could NOT find SuperLU (missing: SUPERLU_INCLUDES SUPERLU_LIBRARIES SUPERLU_VERSION_OK) (Required is at least version "4.0")
-- A version of Pastix has been found but pastix_nompi.h does not exist in the include directory. Because Eigen tests require a version without MPI, we disable the Pastix backend.
-- Could NOT find SPQR (missing: SPQR_INCLUDES SPQR_LIBRARIES)
-- Found unsuitable Qt version "" from NOTFOUND
-- Could NOT find Boost (missing: Boost_INCLUDE_DIR) (Required is at least version "1.53.0")
-- Could NOT find GoogleHash (missing: GOOGLEHASH_INCLUDES GOOGLEHASH_COMPILE)
-- Could NOT find Adolc (missing: ADOLC_INCLUDES ADOLC_LIBRARIES)
-- Could NOT find MPFR (missing: MPFR_INCLUDES MPFR_LIBRARIES MPFR_VERSION_OK) (Required is at least version "1.0.0")
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.0")
-- Found unsuitable Qt version "" from NOTFOUND
-- Qt4 not found, so disabling the mandelbrot and opengl demos
-- ************************************************************
-- ***    Eigen's unit tests configuration summary          ***
-- ************************************************************
--
-- Build type:        Release
-- Build site:        desktop-1dmejld
-- Build string:      unknownwin-19.31.31106.2-sse2-64bit
-- Enabled backends:
-- Disabled backends: CHOLMOD,  UMFPACK,  KLU,  SuperLU,  PaStiX,  METIS,  SPQR,  Qt4 support,  Boost.Multiprecision,  GoogleHash,  Adolc,  MPFR C++,  fftw,  OpenGL,
-- Default order:     Column-major
-- Maximal matrix/vector size: 320
-- SSE2:              Using architecture defaults
-- SSE3:              Using architecture defaults
-- SSSE3:             Using architecture defaults
-- SSE4.1:            Using architecture defaults
-- SSE4.2:            Using architecture defaults
-- AVX:               Using architecture defaults
-- AVX2:              Using architecture defaults
-- FMA:               Using architecture defaults
-- AVX512:            Using architecture defaults
-- AVX512DQ:          Using architecture defaults
-- Altivec:           Using architecture defaults
-- VSX:               Using architecture defaults
-- MIPS MSA:          Using architecture defaults
-- ARM NEON:          Using architecture defaults
-- ARMv8 NEON:        Using architecture defaults
-- S390X ZVECTOR:     Using architecture defaults
-- C++11:             OFF
-- SYCL:              OFF
-- CUDA:              OFF
-- HIP:               OFF
--
CXX:               C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe
 CXX_FLAGS:         /DWIN32 /D_WINDOWS /W4 /GR /EHsc /EHsc /wd4127 /wd4505 /wd4714 /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS
 Sparse lib flags:

-- ************************************************************
--
-- Configured Eigen 3.4.0
--
-- Available targets (use: cmake --build . --target TARGET):
-- ---------+--------------------------------------------------------------
-- Target   |   Description
-- ---------+--------------------------------------------------------------
-- install  | Install Eigen. Headers will be installed to:
--          |     <CMAKE_INSTALL_PREFIX>/<INCLUDE_INSTALL_DIR>
--          |   Using the following values:
--          |     CMAKE_INSTALL_PREFIX: C:/biogears/external
--          |     INCLUDE_INSTALL_DIR:  include/eigen3
--          |   Change the install location of Eigen headers using:
--          |     cmake . -DCMAKE_INSTALL_PREFIX=yourprefix
--          |   Or:
--          |     cmake . -DINCLUDE_INSTALL_DIR=yourdir
-- doc      | Generate the API documentation, requires Doxygen & LaTeX
-- check    | Build and run the unit-tests. Read this page:
--          |   http://eigen.tuxfamily.org/index.php?title=Tests
-- blas     | Build BLAS library (not the same thing as Eigen)
-- uninstall| Remove files installed by the install target
-- ---------+--------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: C:/src/eigen-3.4.0/build
genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 1
    Summary of the duplicate: You need to add the `/Zc:__cplusplus ` compiler option so that the `__cplusplus` macro is properly defined by MSVC. – Adrian Mole Apr 14 '22 at 19:03
  • 3
    @AdrianMole: The question is about well-known Eigen project which is not written by the asker. So suggesting him to modify the code.. is not very wise. Moreover, the message "Performing Test COMPILER_SUPPORT_std=cpp03 - Failed" is emitted by the [test](https://gitlab.com/libeigen/eigen/-/blob/3.4/CMakeLists.txt#L77) `check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11)` which never can be passed by msvc compile which doesn't understand `-std` option. – Tsyvarev Apr 14 '22 at 22:13
  • @Tsyvarev OK, maybe I was a bit hasty. Do you think I should reopen the question, or is the answer still to be found in the linked 'duplicate'? (I fairly sure that the cause of the issue is what I have stated, but that may not be helpful in this case.) – Adrian Mole Apr 14 '22 at 22:16
  • I would imagine the duplicate can help to understand why the problem is ever existed, but it unlikely helps to fix the problem from the "user side". So the duplicate actually falls to "related" category. Currently I am not sure whether better duplicate exists on SO, but the current one definitely doesn't contain a solution. (Actually, I am also has a mjolnir for that question, in "cmake" tag, but I don't want to start a silent reopening war). – Tsyvarev Apr 14 '22 at 22:26
  • 2
    I'm not quite sure I understand your points here, @Tsyvarev. Adrian didn't suggest for anyone to modify the code; he suggested modifying the build settings. This looks to me like it represents at least two bugs in Eigen with respect to its compatibility with MSVC. Those should probably be reported to the Eigen project. If you think this would be useful to have open as a canonical for people experiencing the same bugs in Eigen, then that's fine; go ahead and reopen it. But this should definitely be reported to the Eigen developers. – Cody Gray - on strike Apr 14 '22 at 22:49
  • @CodyGray: My point is that current duplicate question is not useful for people who **use** Eigen in their programs. And the question post is asked from the point of user, not from the point of a Eigen developer. As for "modifying build settings", for a CMake project it is not quite easy to modify compiler flags **outside** of the project. (And, as I stated above, none modification could help to pass the current check). Yes, this problem is clearly about compatibility of Eigen with MSVC. But that fact doesn't mean the question should be closed. – Tsyvarev Apr 14 '22 at 23:14
  • 1
    @StephenKoplin: In the [master branch](https://gitlab.com/libeigen/eigen/-/tree/master/) they seem to have `-std` checks removed. So you could try to build that branch instead of 3.4. – Tsyvarev Apr 14 '22 at 23:16

0 Answers0