【问题标题】:How to build pgmagick on linux (CentOS)?如何在 linux (CentOS) 上构建 pgmagick?
【发布时间】:2012-04-11 16:47:52
【问题描述】:

我在 CentOS 5.6 上尝试构建 pgmagick 时没有取得多大成功。

我通过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 不会针对这些库构建。

关于如何解决问题或进一步诊断问题的任何建议?

【问题讨论】:

  • 不是一个直接的答案,但是你看过 Python Imaging Library 吗? pythonware.com/products/pil 还是直接使用subprocess 模块执行GraphicsMagick?
  • @RolandSmith 不幸的是,PIL 没有我们需要的功能。使用subprocess 是一种选择,但也很痛苦,因为该应用程序是直接使用 pgmagick 开发的 - 需要重新编写大量代码。
  • 看看其他发行版如何为 pgmagick 构建包。也许需要特定的补丁? pgmagick 主页提到在 Ubuntu 上使用 libboost-python1.40-dev
  • 您使用的是哪个版本的 CentOS?我只是尝试在我的 Scientific Linux 6.2 上构建扩展(从 repo 安装了 boost/graphics-magick 依赖项,下载了源代码,做了python setup.py build)并且没有任何问题。

标签: python centos graphicsmagick pgmagick


【解决方案1】:

好像是版本不兼容的问题,试试boost-1.34

【讨论】:

【解决方案2】:

当您运行配置时,我假设您以./configure --enable-shared=yes 执行它(注意参数)。如果你这样做了(就像教程说的那样),我看不出它不应该工作的原因。如果您不这样做,这可能会有所帮助。

【讨论】:

    【解决方案3】:

    事实证明,让这个工作的唯一方法是:

    • 从系统中删除所有预编译的boost rpms
    • 从系统中删除所有预编译的GraphicsMagick rpms
    • 手动编译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
    • 从 bitbucket 克隆 pgmagick 存储库
    • pgmagick 目录中再次运行python setup.py install

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-18
      • 1970-01-01
      • 1970-01-01
      • 2012-10-09
      • 2014-04-28
      • 1970-01-01
      • 2012-06-30
      相关资源
      最近更新 更多