2013-02-26 92 views
0

我在安裝pyipopt時遇到問題。問題類似於this one。 `python setup.py install'包含下一個輸出。安裝pyipopt時出現問題

/usr/bin/ld: cannot find -lipopt 
/usr/bin/ld: cannot find -lcoinmumps 
/usr/bin/ld: cannot find -lcoinmetis 
collect2: ld returned 1 exit status 
error: command 'gcc' failed with exit status 

我安裝ipopt使用新立得軟件包管理器,我發現 下一個文件/usr/lib/coin/libipopt.la/usr/lib/coin/libipopt.la

我想這

export LD_LIBRARY_PATH=/xx/yy/zz:$LD_LIBRARY_PATH 

我也試着運行ldconfig

可能是我做錯了什麼,但它沒有幫助我。

回答

1

如果您使用安裝的非標準目錄(例如在〜/ bin/ipopt /中),則必須將這些目錄指定給編譯器,以便它可以找到庫和頭文件。

C_INCLUDE_PATH=$HOME/bin/ipopt/include/coin/ LIBRARY_PATH=$HOME/bin/ipopt/lib/ LD_LIBRARY_PATH=$HOME/bin/ipopt/lib/ python setup.py build

我仍然得到-lcoinmumps和-lcoinmetis錯誤,但是,因爲我沒有這些庫。我在這裏打開了一個bug:https://github.com/xuy/pyipopt/issues/12