2017-09-24 102 views
0

`DFG @ DFG時:〜/ PROG/scipoptsuite-4.0.1 /建立$ cmake的.. -DREADLINE =關 - 建立類型:釋放 - 建立共享庫:ON - 建立類型:釋放 - 老編譯器舊模式:OFF - 找不到IPOPT(丟失:IPOPT_LIBRARIES) - 找不到準則(遺漏:CRITERION_LIBRARY CRITERION_INCLUDE_DIR) - 以下選件包已發現:SCIP:PySCIPOpt錯誤導入模型

  • ZLIB
  • GMP

- 以下所需的軟件包已被發現:

  • BISON
  • FLEX
  • SOPLEX
  • SCIP

- 以下選件包都沒有找到:

  • IPOPT
  • 標準

- 配置完成 - 生成完成 - 建立文件已被寫入到:/家庭/ 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位SCIP優化4.0.1安裝在/opt/scipoptsuite-4.0.1

我使用Python 3.6和Python編輯器Pycharm的virtualenv Python環境。

我真的被卡住了。

enter image description here

我重新安裝scipoptsuite通過CMake然後使試驗中scipoptdir工作正常。我也有子目錄lib和包括[https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.rst]。我也運行這個命令make install INSTALLDIR=$SCIPOPTDIR SHARED=true。然後我獲得了以下錯誤(scip_env) [email protected]:~/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 我是否必須創建一些鏈接或導出變量?非常感謝你 !問候

+1

你是如何安裝SCIP庫的?很可能它試圖使用錯誤的頭文件。您之前是否也使用過舊的SCIP版本? – mattmilten

+0

親愛的MattMillen,非常感謝您的回覆。我從http://scip.zib.de/#download下載了scipsuite-4.0.1。安裝scip時,我已經完成make install INSTALLDIR = $ SCIPOPTDIR SHARED = true,正如pyscipopt所建議的那樣。我必須重新安裝我的scip嗎?實際上,在命令行中,> make test在scipopt目錄中工作。非常感謝你 – Derrick

+0

呃,很奇怪。我想你也在setup.py執行期間指定了SCIPOPTDIR?作爲最後的手段,你可能想給CMake一個安裝SCIP的嘗試。 – mattmilten

回答

0

謝謝@mattmillen,我已經做了你的建議。我刪除了我以前的scipsuiteopt,然後用cmake和readline重新安裝。在命令行中工作正常(scip_env) [email protected]:~/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位於./scipoptsuite/build/lib/libscip.so/usr/local/lib/libscip.so。那麼這也適用於編輯器PyCharm :)