MathOpt solvers missing in static #4538
-
Hello When we compile OR-Tools ("stable" branch) as a static library (i.e. by setting BUILD_SHARED_LIBS=OFF), MathOpt solvers are not useable. This is our cmake configuration:
NB:
Thank you for your help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Good Catch, will try to fix it ASAP. my 2 cents, did you try to use Otherwise, I will need at least your OS, the CMake generator used etc so I can reproduce it easily... |
Beta Was this translation helpful? Give feedback.
Good Catch, will try to fix it ASAP.
my 2 cents, did you try to use
$<LINK_LIBRARY:WHOLE_ARCHIVE,ortools::ortools>
instead ofortools::ortools
whentarget_link_libraries
to ortools ?IIRC math_opt use some global singleton to "register" each solver and this code is dropped by linker 🤡
e.g.
or-tools/ortools/math_opt/solvers/pdlp_solver.cc
Line 389 in 9090dc7
Otherwise, I will need at least your OS, the CMake generator used etc so I can reproduce it easily...
note: Will try to hack my cmake template project to test and dev a MRE....
ref https://github.com/or-tools/cmake_or-tools