You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMake Error at build/_deps/eigen3-src/CMakeLists.txt:114 (message):
Can't link to the standard math library. Please report to the Eigen
developers, telling them about your platform.
this is the code that fails:
find_package(StandardMathLibrary)
set(EIGEN_TEST_CUSTOM_LINKER_FLAGS "" CACHE STRING "Additional linker flags when linking unit tests.")
set(EIGEN_TEST_CUSTOM_CXX_FLAGS "" CACHE STRING "Additional compiler flags when compiling unit tests.")
set(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO "")
if(NOT STANDARD_MATH_LIBRARY_FOUND)
message(FATAL_ERROR
"Can't link to the standard math library. Please report to the Eigen developers, telling them about your platform.")
else()
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
set(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO "${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO} ${STANDARD_MATH_LIBRARY}")
else()
set(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO "${STANDARD_MATH_LIBRARY}")
endif()
endif()
despite CMake finding the library, when prompted manually:
find_library(MATH_LIBRARY m)
if(MATH_LIBRARY)
message(STATUS "Found math library: ${MATH_LIBRARY}")
else()
message(FATAL_ERROR "Math library not found")
endif()
yields:
-- Found math library: /Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/usr/lib/libm.tbd
Anything else we should know about your project / environment
I had a long convo with ChatGPT about this and was not able to resolve it, but it gave me this feedback, which may be useful:
Based on the output, we can see the following:
CMake is finding the math library (libm) at the location /Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/usr/lib/libm.tbd, which is a text-based stub (.tbd), a common way that macOS packages system libraries, especially for SDKs.
This libm.tbd is a stub library rather than a fully linked dynamic library (.dylib), and this could explain the confusion or linking issues you're experiencing.
What is a .tbd file?
.tbd (text-based stub) files in macOS are metadata files that tell the linker where to find the actual dynamic libraries (.dylib) at runtime. The fact that it’s a .tbd file indicates that macOS is providing the math library as a stub, which should be resolved at link time, but it may not be resolving correctly in this case.
I also tried a variety of other solutions, like finding the library and then setting some env variables that Eigen CMake uses, to no avail.
The text was updated successfully, but these errors were encountered:
What version of OR-Tools and what language are you using?
Version: https://github.com/google/or-tools/archive/refs/tags/v9.10.tar.gz
Language: C++
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
Any
What operating system (Linux, Windows, ...) and version?
-- CMAKE_CXX_COMPILER_ID: AppleClang
-- CMAKE_CXX_COMPILER_VERSION: 16.0.0.16000026
-- CMAKE_SYSTEM: Darwin-23.6.0
Apple M1
14.7.2 (23H311)
What did you do?
Steps to reproduce the behavior:
Attempt to build on my system using FetchContent:
What did you expect to see
No CMake errors
What did you see instead?
Cmake Errors:
this is the code that fails:
despite CMake finding the library, when prompted manually:
yields:
Anything else we should know about your project / environment
I had a long convo with ChatGPT about this and was not able to resolve it, but it gave me this feedback, which may be useful:
I also tried a variety of other solutions, like finding the library and then setting some env variables that Eigen CMake uses, to no avail.
The text was updated successfully, but these errors were encountered: