在 Ubuntu Linux 20.04 上安装带有 AMPL 的 SCIP 7.0.2 以便与 Pyomo 一起使用
Installation of SCIP 7.0.2 with AMPL on Ubuntu Linux 20.04 for usage with Pyomo
我想安装 SCIP solver in version 7.0.2
on my Ubuntu Linux 20.04 machine to use in Pyomos SolverFactory following the instructions in this 手册。
但是当我使用 make
时出现以下错误:
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
在带有 AMPL 绑定的 Windows 机器上使用它效果很好,但我卡在这里了。
有什么提示吗?
提前致谢!
您尝试过使用 make BOOST=false
重建吗?
我现在可以根据您的提示自行解决问题!诀窍是使用标志 BOOST=false
和 ZIMPL=false
进行编译,现在它与 pyomo 的 SolverFactory
.
一起工作就像一个魅力
这些是对我有用的命令(输出被抑制):
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/
在 pyomo 中,如果未使用 solver_io='nl'
自动检测到,solver interface 可以设置为 nl 格式。
感谢@Leon 为我指明了正确的方向!
Edit:如果 libboost-all-dev
是通过 apt install
安装的,它也适用于 BOOST=true
.
我想安装 SCIP solver in version 7.0.2
on my Ubuntu Linux 20.04 machine to use in Pyomos SolverFactory following the instructions in this 手册。
但是当我使用 make
时出现以下错误:
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
在带有 AMPL 绑定的 Windows 机器上使用它效果很好,但我卡在这里了。
有什么提示吗?
提前致谢!
您尝试过使用 make BOOST=false
重建吗?
我现在可以根据您的提示自行解决问题!诀窍是使用标志 BOOST=false
和 ZIMPL=false
进行编译,现在它与 pyomo 的 SolverFactory
.
这些是对我有用的命令(输出被抑制):
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/
在 pyomo 中,如果未使用 solver_io='nl'
自动检测到,solver interface 可以设置为 nl 格式。
感谢@Leon 为我指明了正确的方向!
Edit:如果 libboost-all-dev
是通过 apt install
安装的,它也适用于 BOOST=true
.