Skip to content

Commit 060b36b

Browse files
committed
Add eigen3 to target_link_libraries of M2-interpreter to fix a compile issue
1 parent 4a213c3 commit 060b36b

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

M2/Macaulay2/d/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ target_link_libraries(M2-interpreter PRIVATE M2-supervisor
151151
$<$<BOOL:${WITH_TBB}>:TBB::tbb>
152152
$<$<BOOL:${WITH_FFI}>:FFI::ffi>)
153153

154+
if(EIGEN3_FOUND)
155+
#version.d is using an Eigen header it can't find without this line
156+
target_link_libraries(M2-interpreter PRIVATE Eigen3::Eigen)
157+
endif()
158+
154159
# TODO: c.f. https://github.com/Macaulay2/M2/issues/2682
155160
if(NOT APPLE)
156161
target_link_libraries(M2-interpreter PRIVATE quadmath)

M2/cmake/check-libraries.cmake

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,16 @@ find_package(GMP 6.0.0 REQUIRED)
127127
# givaro prime field and algebraic computations (needs gmp)
128128
# fflas_ffpack Finite Field Linear Algebra Routines (needs gmp, givaro + LAPACK)
129129

130-
find_package(Eigen3 3.4...5.0 PATHS ${M2_HOST_PREFIX})
131-
# FindEigen3 doesn't set EIGEN3_FOUND, and instead we should check
132-
# if the target Eigen3::Eigen is defined, so we set EIGEN3_FOUND
133-
# for compatibility with the rest of the build code
134-
if(TARGET Eigen3::Eigen)
135-
set(EIGEN3_FOUND TRUE)
136-
endif (TARGET Eigen3::Eigen)
130+
find_package(Eigen3 3.4.0 PATHS ${M2_HOST_PREFIX})
131+
if(NOT EIGEN3_FOUND)
132+
find_package(Eigen3 3.4.1...5.0 PATHS ${M2_HOST_PREFIX})
133+
# FindEigen3 doesn't set EIGEN3_FOUND, and instead we should check
134+
# if the target Eigen3::Eigen is defined, so we set EIGEN3_FOUND
135+
# for compatibility with the rest of the build code
136+
if(TARGET Eigen3::Eigen)
137+
set(EIGEN3_FOUND TRUE)
138+
endif()
139+
endif()
137140
find_package(BDWGC 7.6.4)
138141
find_package(MPFR 4.0.1)
139142
find_package(MPFI 1.5.1)

0 commit comments

Comments
 (0)