Eigen compilation with x86_64-w64-mingw32-g++
Summary
Environment
- Operating System : Linux
- Architecture : x64
- Eigen Version : 3.3.9
- Compiler Version : x86_64-w64-mingw32-g++
- Compile Flags : -O3 -march=native
Minimal Example
Hey there,
I am having problems using Eigen in a cross-compilation project. I am using CMake to Fetch the Eigen 3.3.9 and compile my project with the Eigen library.
Error: CMake Error at build-debug/_deps/eigen-src/CMakeLists.txt:111 (message): Can't link to the standard math library. Please report to the Eigen developers, telling them about your platform.
include(FetchContent)
FetchContent_Declare(
Eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.3
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE)
set(EIGEN_BUILD_DOC OFF)
set(BUILD_TESTING OFF)
set(EIGEN_BUILD_PKGCONFIG OFF)
set(OFF)
FetchContent_MakeAvailable(Eigen)
Eigen is being well fetched and I can compile under windows using MinGW. The issue comes when compiling with MinGW in Ubuntu 20.04.
Steps to reproduce
- Use CMake code posted above
- Install mingw-w64 packages in ubuntu
- In Ubuntu 20.04:
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/x86_64-w64-mingw32-g++
There is not cpp file you can test the building. You can try to compile the Eigen 3.3. release tag.
What is the current bug behavior?
x86_64-w64-mingw32-g++ compiler is not supported by Eigen
What is the expected correct behavior?
Eigen compile with x86_64-w64-mingw32-g++
Relevant logs
Error: CMake Error at build-debug/_deps/eigen-src/CMakeLists.txt:111 (message): Can't link to the standard math library. Please report to the Eigen developers, telling them about your platform.
Anything else that might help
-
x86_64-w64-mingw32-g++ support for Linux