CMake error when building
Closed this issue · 8 comments
I got a trouble on building SLOTHY.
I got following CMake error when I run cmake -S. -Bbuild -DBUILD_PYTHON:BOOL=ON
CMake Error at /usr/local/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
Call Stack (most recent call first):
/usr/local/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.28/Modules/FindSWIG.cmake:153 (find_package_handle_standard_args)
cmake/python.cmake:27 (find_package)
CMakeLists.txt:333 (include)
I use cmake version 3.28.0-rc5 and GNU Make 4.2.1.
How can I solve this?
What operating system are you using? I assume you tried installing SWIG?
I'm using OS X with M1 and Ubuntu both. and it's solved after I install SWIG.
However, there's another error occurred.
Deprecated command line option: -py3. Ignored, this option is no longer supported.
/Users/yong/Documents/coding/slothy/submodules/or-tools/ortools/linear_solver/linear_solver.h:809: Error: Syntax error in input(3).
make[2]: *** [ortools/linear_solver/python/CMakeFiles/pywraplp.dir/linear_solverPYTHON.stamp] Error 1
make[2]: *** Deleting file `ortools/linear_solver/python/CMakeFiles/pywraplp.dir/linear_solverPYTHON.stamp'
make[1]: *** [ortools/linear_solver/python/CMakeFiles/pywraplp_swig_compilation.dir/all] Error 2
make: *** [all] Error 2
This is error message when I run make
.
I checked that mypy-protobuf
is installed and it is latest version.
@Unlimitosu Thank you for the update, progress is seeing a different error. I have not seen this OR-Tools build error before, but would encourage you to search amongst the issues in https://github.com/google/or-tools/tree/stable and stack exchange. Which version of SWIG are you using? What's your compiler?
@hanno-becker I use SWIG 4.1.1., cmake version 3.28.0-rc5 and GNU Make 4.2.1(for Ubuntu).
and clang version 13.0.0 for M1 OS X.
I'm using 4.1.0 locally, which seems fine. Perhaps it's an issue with the OR-Tools version? We don't yet pin that in the submodule configuration, which we probably should. Which version are you using? Can you try tag v9.7?
@Unlimitosu Any luck?
I've pinned the OR-Tools submodule to v9.7 now, which works for me locally.
@Unlimitosu FYI we added a docker container for SLOTHY in https://github.com/slothy-optimizer/slothy/tree/main/paper/artifact which exemplifies the setup required to run SLOTHY.
Closing this. Feel free to reopen if the issue persists.