Search code examples
pyomoamplscip

Installation of SCIP 7.0.2 with AMPL on Ubuntu Linux 20.04 for usage with Pyomo


I want to install the SCIP solver in version 7.0.2 on my Ubuntu Linux 20.04 machine to use in Pyomos SolverFactory following the instructions in this manual.

But when I use make I get the following error:

crd@crd-laptop:~/Downloads$ cd scipoptsuite-7.0.2/
crd@crd-laptop:~/Downloads/scipoptsuite-7.0.2$ make
make[1]: Verzeichnis „/home/cord/Downloads/scipoptsuite-7.0.2“ wird betreten
** Creating directory "/home/cord/Downloads/scipoptsuite-7.0.2/scip/lib/static".
** Creating directory "/home/cord/Downloads/scipoptsuite-7.0.2/scip/lib/include".
** Creating directory "/home/cord/Downloads/scipoptsuite-7.0.2/scip/lib/include/zimplinc".
** Creating directory "/home/cord/Downloads/scipoptsuite-7.0.2/scip/lib/include/".

** Building SoPlex library "/home/cord/Downloads/scipoptsuite-7.0.2/soplex/lib/libsoplex.linux.x86_64.gnu.opt.a".
make[2]: Verzeichnis „/home/cord/Downloads/scipoptsuite-7.0.2/soplex“ wird betreten
make[3]: Verzeichnis „/home/cord/Downloads/scipoptsuite-7.0.2/soplex“ wird betreten
make[3]: Verzeichnis „/home/cord/Downloads/scipoptsuite-7.0.2/soplex“ wird verlassen
make[3]: Verzeichnis „/home/cord/Downloads/scipoptsuite-7.0.2/soplex“ wird betreten
-> compiling obj/O.linux.x86_64.gnu.opt/lib/soplex/clufactor_rational.o
In file included from src/soplex/clufactor_rational.cpp:18:
src/soplex/spxdefines.h:46:10: fatal error: boost/multiprecision/number.hpp: Datei oder Verzeichnis nicht gefunden
   46 | #include "boost/multiprecision/number.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile:503: obj/O.linux.x86_64.gnu.opt/lib/soplex/clufactor_rational.o] Fehler 1
make[3]: Verzeichnis „/home/cord/Downloads/scipoptsuite-7.0.2/soplex“ wird verlassen
make[2]: *** [Makefile:375: makelibfile] Fehler 2
make[2]: Verzeichnis „/home/cord/Downloads/scipoptsuite-7.0.2/soplex“ wird verlassen
make[1]: *** [Makefile.doit:187: /home/cord/Downloads/scipoptsuite-7.0.2/soplex/lib/libsoplex.linux.x86_64.gnu.opt.a] Fehler 2
make[1]: Verzeichnis „/home/cord/Downloads/scipoptsuite-7.0.2“ wird verlassen
make: *** [Makefile:85: scipbinary] Fehler 2

Using it on my Windows machine with the AMPL bindings worked perfectly but I got stuck here.

Any hints?

Thanks in advance!


Solution

  • I could now solve the problem on my own using your hints! The trick was to compile using the flags BOOST=false and ZIMPL=false and now it works like a charm with pyomo's SolverFactory.

    These are the commands that worked for me (output is surpressed):

    user@machine:~/Downloads$ $ sudo apt install g++ zlib1g-dev bison flex libgmp-dev libreadline-dev libncurses5-dev
    user@machine:~/Downloads$ tar xzf scipoptsuite-7.0.2.tgz 
    user@machine:~/Downloads$ cd scipoptsuite-7.0.2/
    user@machine:~/Downloads/scipoptsuite-7.0.2$ make BOOST=false ZIMPL=false
    user@machine:~/Downloads/scipoptsuite-7.0.2$ cd scip/interfaces/ampl/
    user@machine:~/Downloads/scipoptsuite-7.0.2/scip/interfaces/ampl$ ./get.ASL
    user@machine:~/Downloads/scipoptsuite-7.0.2/scip/interfaces/ampl$ cd solvers/
    user@machine:~/Downloads/scipoptsuite-7.0.2/scip/interfaces/ampl/solvers$ sh configurehere
    user@machine:~/Downloads/scipoptsuite-7.0.2/scip/interfaces/ampl/solvers$ make
    user@machine:~/Downloads/scipoptsuite-7.0.2/scip/interfaces/ampl/solvers$ cd ..
    user@machine:~/Downloads/scipoptsuite-7.0.2/scip/interfaces/ampl$ make 
    user@machine:~/Downloads/scipoptsuite-7.0.2/scip/interfaces/ampl$ cd ..
    user@machine:~/Downloads/scipoptsuite-7.0.2/scip/interfaces$ sudo cp ampl/bin/scipampl /usr/local/bin/
    

    Within pyomo, the solver interface can be set to the nl format if not detected automatically using solver_io='nl'.

    Thanks @Leon for pointing me in the right direction!

    Edit: If libboost-all-dev is installed via apt install it also works with BOOST=true.