scipopt / scip

SCIP - Solving Constraint Integer Programs
Other
393 stars 63 forks source link

Add support for FreeBSD (amplmp compilation issue) #7

Closed Mizux closed 3 years ago

Mizux commented 3 years ago

When trying to build SCIP in our Vagrant generic/FreeBSD13 box (note a FreeBSD VirtualBox img) we are facing some compilation issue...

Observed

here the relevant trace (please notice we are building SCIP using FetchContent from our or-tools CMake based build)

default: [ 48%] Building CXX object _deps/scip-build/src/CMakeFiles/libscip.dir/amplmp/src/os.cpp.o
    default: cd /usr/home/vagrant/project/build/_deps/scip-build/src && /usr/bin/c++  -I/usr/home/vagrant/project/build/_deps/scip-src/src/amplmp/include -I/usr/home/vagrant/project/build/_deps/scip-build -I/usr/home/vagrant/project/build/_deps/scip-src/src -I/usr/home/vagrant/project/build/_deps/zlib-build -I/usr/home/vagrant/project/build/_deps/zlib-src -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++14 -MD -MT _deps/scip-build/src/CMakeFiles/libscip.dir/amplmp/src/os.cpp.o -MF CMakeFiles/libscip.dir/amplmp/src/os.cpp.o.d -o CMakeFiles/libscip.dir/amplmp/src/os.cpp.o -c /usr/home/vagrant/project/build/_deps/scip-src/src/amplmp/src/os.cpp
    default: /usr/home/vagrant/project/build/_deps/scip-src/src/amplmp/src/os.cpp:108:4: error: GetExecutablePath is not implemented for this system
    default: #  error GetExecutablePath is not implemented for this system
    default:    ^
    default: 1 error generated.
    default: *** Error code 1
    default: 
    default: Stop.
    default: make[2]: stopped in /usr/home/vagrant/project/build
    default: *** Error code 1
    default: 
    default: Stop.
    default: make[1]: stopped in /usr/home/vagrant/project/build
    default: *** Error code 1
    default: 
    default: Stop.
    default: make: stopped in /usr/home/vagrant/project/build
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

ref: https://github.com/google/or-tools/runs/3672547012?check_suite_focus=true

https://github.com/scipopt/scip/blob/9444e80869f6ac42723f3a43712ca6d4ce0c20dc/src/amplmp/src/os.cpp#L107-L109

Expected

Have support of FreeBSD so we can use it in OR-Tools or at least a dummy function instead of this error message breaking the build ;) Also it seems that amplmp is only use to read some .nl file so it's sad to break the build for this "optional" feature... https://github.com/scipopt/scip/blob/9444e80869f6ac42723f3a43712ca6d4ce0c20dc/src/amplmp/README#L2

Annexe

You can found our Vagrantfile here: https://github.com/google/or-tools/blob/master/cmake/vagrant/freebsd/cpp/Vagrantfile

note: I think it should be easy to adapt it to only build SCIP starting from your repo to get rid of or-tools shenanigan and/or add it as a CI job to this repo (if you are willing to use github action workflow) ;)

Mizux commented 3 years ago

2min googling around: https://fossies.org/linux/sccs/libschily/getexecpath.c seems to be a good starting point ;)

Mizux commented 3 years ago

FYI: Issue still present in ampl/mp master https://github.com/ampl/mp/blob/master/src/os.cc#L107-L109 todo(me): Open an issue in ampl/mp and linking it to this issue...

matbesancon commented 3 years ago

SCIP itself can be built on FreeBSD, see: https://github.com/JuliaPackaging/Yggdrasil/blob/master/S/SCIP/build_tarballs.jl and the compiled artifact here: https://github.com/JuliaBinaryWrappers/SCIP_jll.jl/releases/ It is indeed done without AMPL

Mizux commented 3 years ago

@matbesancon thanks ! and shame on me I should have think of disabling AMPL support -_- https://github.com/scipopt/scip/blob/9444e80869f6ac42723f3a43712ca6d4ce0c20dc/CMakeLists.txt#L92

on my way to test it...

matbesancon commented 3 years ago

No problem :) should we close this one and leave the issue open on the AMPL repo?

Mizux commented 3 years ago

IMHO: Could be closed since I did my duty and open an issue in the ampl repo. and/or you can also "fix" your CMakeLists.txt by forcing option to OFF (or disabling it) on FreeBSD ;)

matbesancon commented 3 years ago

thank you, I'll open a corresponding issue on the main scip repo