Closed theomelo closed 9 months ago
Steps I took to install OR Tools locally:
git clone --branch v9.5 https://github.com/google/or-tools/ --depth 1 \
cd or-tools \
make third-party && make cc
Then, inside the Rails project's folder:
bundle config build.or-tools --with-or-tools-dir=/home/dev/or-tools
Another variant of the --with-or-tools-dir
produced a slightly different result:
gem install or-tools -- --with-or-tools-dir=/home/dev/or-tools/install_make
current directory: /home/dev/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/or-tools-0.10.1/ext/or-tools
/home/dev/.asdf/installs/ruby/3.2.2/bin/ruby extconf.rb --with-or-tools-dir\=/home/dev/or-tools/install_make
checking for rice/rice.hpp in /home/dev/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rice-4.1.0/include... yes
checking for -lstdc++... yes
checking for -lortools... yes
creating Makefile
current directory: /home/dev/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/or-tools-0.10.1/ext/or-tools
make DESTDIR\= sitearchdir\=./.gem.20231101-63917-5gwyq7 sitelibdir\=./.gem.20231101-63917-5gwyq7 clean
current directory: /home/dev/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/or-tools-0.10.1/ext/or-tools
make DESTDIR\= sitearchdir\=./.gem.20231101-63917-5gwyq7 sitelibdir\=./.gem.20231101-63917-5gwyq7
compiling assignment.cpp
compiling bin_packing.cpp
compiling constraint.cpp
compiling ext.cpp
ext.cpp: In function ‘void Init_ext()’:
ext.cpp:33:9: error: ‘struct operations_research::CppFlags’ has no member named ‘stderrthreshold’
33 | flags.stderrthreshold = 2;
| ^~~~~~~~~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-shorten-64-to-32’ may have been intended to silence earlier diagnostics
make: *** [Makefile:240: ext.o] Error 1
make failed, exit code 2
Hi @theomelo, 0.10.1 only works with OR-Tools 9.6.
When installing this gem into a Ubuntu server (QEMU ARM VM), I get an
ERROR: Failed to build gem native extension.
Full Error
Specs
gem install or-tools -- --with-or-tools-dir=/home/dev/or-tools
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [aarch64-linux]
v9.5
, installed from their repoLinux 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:23:16 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
Apple M1 Sonoma 14.1