我想安裝包裝Quantlib的Python PyQL庫,但它似乎無法找到一些提升標題。安裝Quantlib Python PyQL庫:似乎無法找到提升
我已經有最新版本Quantlib的(1.3)工作,並位於在/ usr/local/lib目錄的目錄,用升壓1.5一起:
[email protected]:/usr/local/lib$ ls
boost boost_1_50_0 libQuantLib.a libQuantLib.la libQuantLib.so libQuantLib.so.0 libQuantLib.so.0.0.0 python2.7 python3.3 QuantLib-1.3 QuantLib-SWIG-1.3 R site_ruby
我安裝了用Cython 0.2:
>>> pkg_resources.get_distribution("Cython").version
'0.20'
當我進入python目錄下載包並執行make build命令時,我遇到了Boost庫問題,否則它似乎是正確的「Cythonizing」everthing。我注意到,Github的指示說我應該「補丁」Cython 0.16,但由於我已經在0.2我認爲這是沒有必要的。以下是編譯說:
[email protected]:~/Downloads/pyql$ sudo make build
python setup.py build_ext --inplace
/usr/lib/python2.7/distutils/extension.py:133: UserWarning: Unknown Extension options: 'pyrex_directives'
warnings.warn(msg)
missing cimport in module 'quantlib.time': quantlib/instruments/credit_default_swap.pyx
missing cimport in module 'quantlib.pricingengines': quantlib/instruments/credit_default_swap.pyx
missing cimport in module 'quantlib.pricingengines': quantlib/instruments/option.pyx
Compiling quantlib/quotes.pyx because it changed.
Compiling quantlib/interest_rate.pyx because it changed.
Compiling quantlib/time/calendar.pyx because it changed.
Compiling quantlib/time/schedule.pyx because it changed.
Compiling quantlib/time/date.pyx because it changed.
Compiling quantlib/time/daycounter.pyx because it changed.
Compiling quantlib/time/daycounters/actual_actual.pyx because it changed.
Compiling quantlib/time/daycounters/thirty360.pyx because it changed.
Compiling quantlib/time/calendars/germany.pyx because it changed.
Compiling quantlib/time/calendars/united_states.pyx because it changed.
Compiling quantlib/time/calendars/united_kingdom.pyx because it changed.
Compiling quantlib/time/calendars/null_calendar.pyx because it changed.
Compiling quantlib/time/calendars/jointcalendar.pyx because it changed.
Compiling quantlib/instruments/swap.pyx because it changed.
Compiling quantlib/pricingengines/credit.pyx because it changed.
Compiling quantlib/pricingengines/swap.pyx because it changed.
Compiling quantlib/pricingengines/bond.pyx because it changed.
Compiling quantlib/pricingengines/blackformula.pyx because it changed.
Compiling quantlib/pricingengines/engine.pyx because it changed.
Compiling quantlib/pricingengines/vanilla/mcvanillaengine.pyx because it changed.
Compiling quantlib/pricingengines/vanilla/vanilla.pyx because it changed.
Compiling quantlib/sim/simulate.pyx because it changed.
Compiling quantlib/processes/bates_process.pyx because it changed.
Compiling quantlib/processes/black_scholes_process.pyx because it changed.
Compiling quantlib/processes/heston_process.pyx because it changed.
Compiling quantlib/math/optimization.pyx because it changed.
Compiling quantlib/termstructures/default_term_structure.pyx because it changed.
Compiling quantlib/termstructures/credit/piecewise_default_curve.pyx because it changed.
Compiling quantlib/termstructures/credit/default_probability_helpers.pyx because it changed.
Compiling quantlib/termstructures/volatility/equityfx/black_vol_term_structure.pyx because it changed.
Compiling quantlib/termstructures/yields/yield_term_structure.pyx because it changed.
Compiling quantlib/termstructures/yields/zero_curve.pyx because it changed.
Compiling quantlib/termstructures/yields/piecewise_yield_curve.pyx because it changed.
Compiling quantlib/termstructures/yields/rate_helpers.pyx because it changed.
Compiling quantlib/termstructures/yields/flat_forward.pyx because it changed.
Compiling quantlib/models/equity/bates_model.pyx because it changed.
Compiling quantlib/models/equity/heston_model.pyx because it changed.
Cythonizing quantlib/instruments/swap.pyx
Cythonizing quantlib/interest_rate.pyx
Cythonizing quantlib/math/optimization.pyx
Cythonizing quantlib/models/equity/bates_model.pyx
Cythonizing quantlib/models/equity/heston_model.pyx
Cythonizing quantlib/pricingengines/blackformula.pyx
Cythonizing quantlib/pricingengines/bond.pyx
Cythonizing quantlib/pricingengines/credit.pyx
Cythonizing quantlib/pricingengines/engine.pyx
Cythonizing quantlib/pricingengines/swap.pyx
Cythonizing quantlib/pricingengines/vanilla/mcvanillaengine.pyx
Cythonizing quantlib/pricingengines/vanilla/vanilla.pyx
Cythonizing quantlib/processes/bates_process.pyx
Cythonizing quantlib/processes/black_scholes_process.pyx
Cythonizing quantlib/processes/heston_process.pyx
Cythonizing quantlib/quotes.pyx
Cythonizing quantlib/sim/simulate.pyx
Cythonizing quantlib/termstructures/credit/default_probability_helpers.pyx
Cythonizing quantlib/termstructures/credit/piecewise_default_curve.pyx
Cythonizing quantlib/termstructures/default_term_structure.pyx
Cythonizing quantlib/termstructures/volatility/equityfx/black_vol_term_structure.pyx
Cythonizing quantlib/termstructures/yields/flat_forward.pyx
Cythonizing quantlib/termstructures/yields/piecewise_yield_curve.pyx
Cythonizing quantlib/termstructures/yields/rate_helpers.pyx
Cythonizing quantlib/termstructures/yields/yield_term_structure.pyx
Cythonizing quantlib/termstructures/yields/zero_curve.pyx
Cythonizing quantlib/time/calendar.pyx
Cythonizing quantlib/time/calendars/germany.pyx
Cythonizing quantlib/time/calendars/jointcalendar.pyx
Cythonizing quantlib/time/calendars/null_calendar.pyx
Cythonizing quantlib/time/calendars/united_kingdom.pyx
Cythonizing quantlib/time/calendars/united_states.pyx
Cythonizing quantlib/time/date.pyx
Cythonizing quantlib/time/daycounter.pyx
Cythonizing quantlib/time/daycounters/actual_actual.pyx
Cythonizing quantlib/time/daycounters/thirty360.pyx
Cythonizing quantlib/time/schedule.pyx
running build_ext
building 'quantlib.cashflow' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/quantlib
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_CONFIG_H -I/usr/local/include -I/usr/include -I. -I./cpp_layer -I/usr/include/python2.7 -c quantlib/cashflow.cpp -o build/temp.linux-x86_64-2.7/quantlib/cashflow.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
quantlib/cashflow.cpp:342:32: fatal error: boost/shared_ptr.hpp: No such file or directory
#include "boost/shared_ptr.hpp"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
make: *** [build] Error 1
這似乎並不能夠找到Boost庫,儘管這顯然是安裝並正常工作,因爲我從成功從無到有,測試套件作品彙編Quantlib。任何提示,我可能會出現錯誤的地方?
這是Ubuntu 13.10和默認安裝的Python 2.7。基本上這是一個新安裝的系統,包含所有最新的庫(除了我保存在1.5版的Boost外)。
Fwiw python setup.py安裝也不起作用,但我有正常的SWIG Quantlib庫在Python中正常工作。
附錄
我相信「錯誤」我是,我密切關注如何在Ubuntu上安裝Quantlib this excellent page。該頁面討論了usr/local/lib目錄中的Boost,並複製並粘貼了它的命令。 Quantlib編譯完美是因爲Boost目錄通過導出命令按頁面進行通信,但pyql還需要在setup.py中指定此目錄。這是確保sys.platform =「linux2」下的行,將INCLUDE_DIRS指定爲usr/local/lib而不是默認的usr/local/include。我寫這個附錄是因爲我相信很多用戶也可能會google搜索「安裝Quantlib Ubuntu」並找到這個頁面,因此這個問題可能會出現在很多人身上。
你的Boost頭文件在哪裏?他們在/ usr/local/include還是其他地方? –
我在/ usr/local/lib中看到它們。好吧,無論如何,我看到目錄boost_1_50_0,在那裏我看到一個名爲boost的目錄。我認爲這些是提升標題?你可以在我的問題的頂部看到我的/ usr/local/lib文件夾的內容。 –
例如,在/ usr/local/lib/boost_1_50_0/boost中有文件'shared_ptr.hpp'嗎?這就是編譯器正在尋找的東西。 –