Eigen Configuration Error with SimpleITK Packaging

I am working on getting SimpleITK packaging working with ITKv5. I have enchanted the following unusual error during ITK configuration:

CMake Error at Modules/ThirdParty/Eigen3/src/itkeigen/CMakeLists.txt:124 (message):
   Can't link to the standard math library.  Please report to the Eigen
  developers, telling them about your platform.

https://open.cdash.org/viewBuildError.php?buildid=6233703

The CMake configuration environment is setup with:

 call  "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" $(VCVAR_OPTIONS) -vcvars_ver=14.0

and these environment variables and CMake Cache:

    env:
          CTEST_CMAKE_GENERATOR: "Ninja"
          ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 2
          CXXFLAGS: /MP
          CFLAGS: /MP
          CC: cl.exe
          CXX: cl.exe
          CTEST_CACHE: |
            BUILD_DOCUMENTS:BOOL=OFF
            BUILD_EXAMPLES:BOOL=ON
            BUILD_SHARED_LIBS:BOOL=OFF
            BUILD_TESTING:BOOL=ON
            WRAP_DEFAULT:BOOL=OFF
            ITK_C_OPTIMIZATION_FLAGS:STRING=""
            ITK_CXX_OPTIMIZATION_FLAGS:STRING=""

Does this configuration error look familiar to anyone?

Thanks!

Try to compile this file with the same compiler/options.

#include<cmath>
int main() { std::sin(0.0); std::log(0.0f); }

That file is compiled at configure time by Eigen to try to find a math library. And it is not compiling without errors in your setup. From here

Are you sure cl.exe points to the cl.exe you want? cmath should be there in modern visual studio.

2 Likes

Thanks for the info.

This is the first try compile now in ITK which uses the configured CC and CXX flags. My problem was with set the ITK_C_OPTIMIZATION_FLAGS the yaml syntax used for CI. The quotes were in the CMake variable’s value. So the try compile had some bad arguments.

2 Likes