2012-04-11 176 views
1

在CentOS 5.6上嘗試構建pgmagick時,我並沒有太大的成功。如何在linux上構建pgmagick(CentOS)?

我已經安裝了通過yum如下:

boost-1.33.1 
boost-devel-1.33.1 
GraphicsMagick-1.3.14 
GraphicsMagick-c++-1.3.14 
GraphicsMagick-devel-1.3.14 
GraphicsMagick-c++-devel-1.3.14 
python-2.6.5 
python-devel-2.6.5 

但是,每當我嘗試建立pgmagick我得到以下錯誤:

/usr/include/boost/python/converter/registered.hpp: In instantiation of ‘const boost::python::converter::registration& boost::python::converter::detail::registered_base<const volatile void>::converters’: 
/usr/include/boost/python/converter/arg_from_python.hpp:269: instantiated from ‘boost::python::converter::pointer_arg_from_python<T>::pointer_arg_from_python(PyObject*) [with T = void*]’ 
/usr/include/boost/python/arg_from_python.hpp:70: instantiated from ‘boost::python::arg_from_python<T>::arg_from_python(PyObject*) [with T = void*]’ 
/usr/include/boost/preprocessor/iteration/detail/local.hpp:37: instantiated from ‘PyObject* boost::python::detail::caller_arity<3u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = void (*)(Magick::Blob&, void*, long unsigned int), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector4<void, Magick::Blob&, void*, long unsigned int>]’ 
/usr/include/boost/python/object/py_function.hpp:38: instantiated from ‘PyObject* boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject*, PyObject*) [with Caller = boost::python::detail::caller<void (*)(Magick::Blob&, void*, long unsigned int), boost::python::default_call_policies, boost::mpl::vector4<void, Magick::Blob&, void*, long unsigned int> >]’ 
./src/_Blob.cpp:43: instantiated from here 
/usr/include/boost/python/converter/registered.hpp:88: error: no matching function for call to ‘registry_lookup(const volatile void (*)())’ 
error: command 'gcc' failed with exit status 1 

我也嘗試安裝boost141boost141-develboost141-python,但pgmagick不會構建這些庫。

有關如何解決問題或進一步診斷問題的任何建議?

+0

不是一個直接的答案中運行python setup.py install再次pgmagick庫,但你看了Python圖像庫? http://www.pythonware.com/products/pil/或者使用'subprocess'模塊直接執行GraphicsMagick? – 2012-04-23 19:29:08

+0

@RolandSmith遺憾的是PIL沒有我們所需要的功能。使用'subprocess'是一個選項,但也很痛苦,因爲應用程序是直接使用pgmagick開發的 - 很多代碼需要重新編寫。 – 2012-04-24 11:25:24

+0

看看其他發行版如何爲pgmagick構建軟件包。也許需要特定的補丁? pgmagick主頁在Ubuntu上提到使用'libboost-python1.40-dev'。 – 2012-04-24 18:28:36

回答

1

原來得到這個工作的唯一辦法是:

  • 從系統中刪除所有的預編譯boost的RPM
  • 從系統中刪除所有的預編譯GraphicsMagick的RPM
  • 手動編譯boost-1.49.0,使用./configure --prefix=/usr --enable-shared=yes
  • 經由yum重裝GraphicsMagick-1.3.14GraphicsMagick-c++-1.3.14GraphicsMagick-devel-1.3.14GraphicsMagick-c++-devel-1.3.14
  • 克隆從到位桶
  • pgmagick目錄
1

它看起來像版本不兼容的問題,請嘗試使用升壓1.34

+0

CentOS似乎沒有boost-1.34可用。最好是手動安裝嗎? – 2012-04-24 11:26:05

+0

我只是使用一些像這樣的非官方回購:http://rpm.pbone.net/index.php3/stat/4/idpl/8359010/dir/centos_5/com/boost-1.34.1-11.1 .x86_64.rpm.html – 2012-04-24 20:20:00

+0

通常我不建議從非官方回購安裝軟件包。如果你願意承擔風險,你只能這樣做。 根據pgmagick文檔,應該支持boost141和您的GraphicsMagick庫:http://packages.python.org/pgmagick/tutorial。HTML#要求 – 2012-04-26 18:42:08

1

當您運行配置,我假設你執行它作爲./configure --enable-shared=yes(注意參數)。如果你這樣做了(就像教程所說的那樣),我沒有看到它不應該工作的原因。如果你沒有,這可能會有所幫助。