# Eigen Configuration Error with SimpleITK Packaging

**URL:** https://discourse.itk.org/t/eigen-configuration-error-with-simpleitk-packaging/2468
**Category:** Uncategorized
**Created:** [December 3, 2019, 3:41pm UTC](https://discourse.itk.org/t/eigen-configuration-error-with-simpleitk-packaging/2468 "2019-12-03T15:41:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [December 3, 2019, 3:41pm UTC](https://discourse.itk.org/t/eigen-configuration-error-with-simpleitk-packaging/2468/1 "2019-12-03T15:41:30Z")

</div>

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

```auto
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](https://open.cdash.org/viewBuildError.php?buildid=6233703)

The CMake configuration environment is setup with:

```auto
 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:

```auto
    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!

---

<div class="post-metadata">

### Author: ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)
#### Post date: [December 3, 2019, 4:25pm UTC](https://discourse.itk.org/t/eigen-configuration-error-with-simpleitk-packaging/2468/2 "2019-12-03T16:25:29Z")

</div>

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

```cpp
#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](https://github.com/InsightSoftwareConsortium/ITK/blob/e79b70f13afafa2eb0ef48f6ac90af185379080b/Modules/ThirdParty/Eigen3/src/itkeigen/cmake/FindStandardMathLibrary.cmake)

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

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [December 3, 2019, 5:48pm UTC](https://discourse.itk.org/t/eigen-configuration-error-with-simpleitk-packaging/2468/3 "2019-12-03T17:48:40Z")

</div>

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.
