`dfg @ dfg:〜/ prog / scipoptsuite-4.0.1 / build $ cmake .. -DREADLINE = off - 构建类型:发布 - 构建共享库:ON - 构建类型:发布 - 旧编译器的LEGACY模式:OFF - 找不到IPOPT(缺少:IPOPT_LIBRARIES) - 找不到CRITERION(缺少:CRITERION_LIBRARY CRITERION_INCLUDE_DIR) - 已找到以下可选包:
- 找到了以下必需的包裹:
- 未找到以下OPTIONAL包:
- 配置完成 - 生成完成 - 构建文件已写入:/ home / dfg / prog / scipoptsuite-4.0.1 / build`
error : libscip.so not found我正在尝试运行github中提供的'atsp.py'示例,但我遇到了错误:
/home/dfg/thesis/programming/python_envs/scip_env/bin/python3.6 atsp.py
Traceback (most recent call last):
File "atsp.py", line 10, in <module>
from pyscipopt import Model, quicksum, multidict
File "/home/dfg/thesis/programming/python_envs/scip_env/lib/python3.6/site-packages/pyscipopt/__init__.py", line 3, in <module>
from pyscipopt.scip import Model
ImportError: /opt/scipoptsuite-4.0.1/lib/libscip.so: undefined symbol: history_length
我的机器是Ubuntu 16.04 64位,在/opt/scipoptsuite-4.0.1中安装了SCIP Optimization 4.0.1
我在Python 3.6和Python编辑器Pycharm中使用了virtualenv Python环境。
我真的被卡住了。
我用CMake重新安装了scipoptsuite然后在scipoptdir中进行测试工作正常。我还有[https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.rst]提到的子目录lib和include。我也运行此命令make install INSTALLDIR=$SCIPOPTDIR SHARED=true
。然后我获得了以下错误(scip_env) dfg@dfg:~/thesis/programming/scip-pfd$ python3.6 atsp.py
Traceback (most recent call last):
File "atsp.py", line 10, in <module>
from pyscipopt import Model, quicksum, multidict
File "/home/dfg/thesis/programming/python_envs/scip_env/lib/python3.6/site-packages/pyscipopt/__init__.py", line 3, in <module>
from pyscipopt.scip import Model
ImportError: libscip.so: cannot open shared object file: No such file or directory
我是否必须建立一些链接或导出变量?非常感谢你 !此致
答案 0 :(得分:0)
谢谢你@mattmillen,我做了你的建议。我删除了以前的scipsuiteopt然后重新安装cmake和readline off。这在命令行(scip_env) dfg@dfg:~/thesis/programming/scip-pfd$ python atsp.py Miller-Tucker-Zemlin's model: Optimal value: 330.0 x(1,4) = 1.0 x(2,3) = 1.0 x(3,5) = 1.0 x(4,2) = 1.0 x(5,1) = 1.0 u(5) = 4.0 u(2) = 2.0
此外,我将位于libscip.so
的{{1}}复制到./scipoptsuite/build/lib/libscip.so
。那么这也适用于编辑器PyCharm :)