Closed rodreegez closed 4 years ago
Hey @rodreegez, try:
bundle exec rake clobber # reset everything
bundle exec rake compile -- --with-or-tools-dir=/path/to/or-tools
bundle exec rake install
I'm not sure about the compatibility guarantees on Ubuntu-like distros, so I think manual installation is best for now.
Thanks for the help. I presume the issue is to do with how I have compiled OR Tools locally, and as a result the fix is beyond the scope of this gem. I did manage to get this running on Ubuntu 18.04 proper (the gem vendored or-tools beautifully), so closing this.
Hey there,
I'm trying to get the gem setup for further local development, however I'm having trouble getting it to find OR-Tools.
I'm following the instructions in the README, which are:
I can
clone
,cd
andbundle install
fine, but when I runbundle exec rake compile
, I get the following error:Just gem installing as the error suggests gives me the following error:
I clocked the error message about telling bundler where to find OR-Tools, so I ran:
Running
bundle exec rake install
yeilds the same error (which I'm not all that surprised about).The
mkmf.log
doesn't seem to be all that enlightening, but I include it here just in case:mkmf.log
``` $ cat /home/rodreegez/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/or-tools-0.2.0/mkmf.log have_library: checking for -lstdc++... -------------------- yes "g++ -o conftest -I/home/rodreegez/.asdf/installs/ruby/2.7.1/include/ruby-2.7.0/x86_64-linux -I/home/rodreegez/.asdf/installs/ruby/2.7.1/include/ruby-2.7.0/ruby/backward -I/home/rodreegez/.asdf/installs/ruby/2.7.1/include/ruby-2.7.0 -I. -I/home/rodreegez/.asdf/installs/ruby/2.7.1/include -I/home/rodreegez/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/rice-2.2.0/ruby/lib/include -g -O2 conftest.c -L. -L/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -Wl,-rpath,/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -L. -L/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -L/home/rodreegez/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/rice-2.2.0/ruby/lib/lib -lrice -Wl,-rpath,/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -L/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -lruby -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return !!argv[argc]; 6: } /* end */ "g++ -o conftest -I/home/rodreegez/.asdf/installs/ruby/2.7.1/include/ruby-2.7.0/x86_64-linux -I/home/rodreegez/.asdf/installs/ruby/2.7.1/include/ruby-2.7.0/ruby/backward -I/home/rodreegez/.asdf/installs/ruby/2.7.1/include/ruby-2.7.0 -I. -I/home/rodreegez/.asdf/installs/ruby/2.7.1/include -I/home/rodreegez/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/rice-2.2.0/ruby/lib/include -g -O2 conftest.c -L. -L/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -Wl,-rpath,/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -L. -L/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -L/home/rodreegez/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/rice-2.2.0/ruby/lib/lib -lrice -Wl,-rpath,/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -L/home/rodreegez/.asdf/installs/ruby/2.7.1/lib -lruby -lstdc++ -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: int (* volatile tp)(void)=(int (*)(void))&t; 9: printf("%d", (*tp)()); 10: } 11: 12: return !!argv[argc]; 13: } 14: 15: int t(void) { ; return 0; } /* end */ -------------------- ```I'm running Pop OS locally and have a rails app with the or-tools gem running just fine. Pop is based off of Ubuntu, and the version I'm running is specifically based off of 20.04. There is a 20.04 version of the OR Tools binary available. I did do some mad stuff in
/ext/or-tools/vendor.rb
to try and have the gem vendor the Ubuntu 20.04 OR Tools binary but that didn't seem to work either and I think is perhaps deviating away from the core issue?(p.s. I wonder if the script should check
lsb_release -cs
and grab the codename of the OS rather than the Distributor ID? I think that would mean the gem would install more liberally on the various ubuntu-a-likes? Dunno, might be a whole new world of pain).I feel like passing in the
--with-or-tools-dir
used to work but maybe since the vendoring stuff went in perhaps maybe it doesn't anymore?TLDR; I think
bundle exec rake install -- --with-or-tools-lib=/path/to/or-tools
should work but it doesn't seem to. Any idea what's up with that?