如何针对旧版本的库进行配置/制作/安装?
我正在尝试安装一个依赖于“Imagemagick 6.3”的软件 (moddims) .9+” - 我尝试安装最新版本的 ImageMagick (6.5.4-5),但在尝试“制作”moddims 时出现以下错误:
mod_dims_ops.c: In function ‘dims_smart_crop_operation’:
mod_dims_ops.c:34: error: too few arguments to function ‘ParseGravityGeometry’
推测函数签名在 ImageMagick 6.3.9 和当前版本之间的某个位置发生了更改。
我想尝试针对旧版本的 ImageMagick 安装 moddims - 但我想安装 ImageMagick 6.3.9 而不干扰已安装的 6.5.4-5 版本。
我可以使用什么 ./configure 咒语来 a) 安装旧版本的 ImageMagick,使其不会覆盖或以其他方式干扰我的现代版本,以及 b) 编译 moddims 以使用旧版本?
我使用的是 OSX,但我预计当我稍后需要在 Linux 生产服务器上安装 moddims 时也会遇到同样的问题。
I'm trying to install a piece of software (moddims) that depends on "Imagemagick 6.3.9+" - I tried installing the latest version of ImageMagick (6.5.4-5) but got the following error when I tried to "make" moddims:
mod_dims_ops.c: In function ‘dims_smart_crop_operation’:
mod_dims_ops.c:34: error: too few arguments to function ‘ParseGravityGeometry’
Presumably the function signature changed somewhere between ImageMagick 6.3.9 and the current version.
I'd like to try installing moddims against the older version of ImageMagick - but I want to install ImageMagick 6.3.9 without interfering with the already-installed 6.5.4-5 version.
What ./configure incantations can I use to a) install the older version of ImageMagick in such a way that it won't over-write or otherwise interfere with my modern version and b) compile moddims to use that older version?
I'm on OSX, but I anticipate having the same problem for when I later need to install moddims on a Linux production server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显然,您必须获取、编译并安装旧版本的 ImageMagick。
面对这个问题 - 特别是因为它处于实验阶段(您不确定是否要保留此版本的 ImageMagick) - 我会:
创建一个新目录来安装 ImageMagick:
<预置><代码>/opt/ImageMagick
配置 ImageMagick 6.3.9 安装在其中 - 可能:
构建、测试并安装它。
配置 moddims 在标准位置之前查看 ImageMagick 位置:
检查生成的 moddims 代码是否使用您首选的库:
第一个检查将是“配置时 moddims 是否编译”; 如果没有,您可能正在使用 moddims 头文件的“标准”版本,尽管我们试图避免这样做。
可能还有
configure
选项来指定应该从何处提取 ImageMagick 库 - 使用“./configure --help
”(和/或“grep”进行检查) -i 图像配置
')。Clearly, you have to obtain, compile and install the older version of ImageMagick.
Faced with this problem - especially since it is at an experimental phase (you don't know for sure you want to keep this version of ImageMagick around) - I would:
Create a new directory to install ImageMagick:
Configure ImageMagick 6.3.9 to install in there - probably:
Build, test, and install it.
Configure moddims to look in the ImageMagick location before standard places:
Check that the produced moddims code uses your preferred libraries:
The first check will be "does moddims compile when configured"; if it doesn't, you are probably using the 'standard' version of the moddims header file despite this attempt to avoid doing so.
There might also be
configure
options to specify where the ImageMagick library should be pulled from - check with './configure --help
' (and/or 'grep -i image configure
').由于 ImageMagick 使用 pkg-config。 您需要做的就是调整 PKG_CONFIG_PATH 以引用旧版本。 (这假设您的包调用 PKG_CHECK_MODULES 来为 ImageMagick 配置自身。如果您的包没有这样做,您应该修改它,以便它这样做。)
基本上,您想要获取旧的 ImageMagick 并将其安装在某个地方(例如 ./configure --prefix=$HOME/obsolete && make install),然后转到您的软件包并使用参数 PKG_CONFIG_PATH=$HOME/obsolete/lib/pkgconfig 进行配置。 不幸的是,ImageMagick 将安装您指定前缀之外的文件(例如 /Library/perl 中),因此不能保证不会修改您当前的库。 (IMO,这是一个 ImageMagick 打包错误。)
查看 pkg-config 文档了解详细信息。
Since ImageMagick uses pkg-config. All you need to do is adjust your PKG_CONFIG_PATH to reference the old version. (This assumes that your package invokes PKG_CHECK_MODULES to configure itself for ImageMagick. If your package does not do that, you should modify it so that it does.)
Basically, you want to grab the old ImageMagick and install it somewhere (eg ./configure --prefix=$HOME/obsolete && make install), then go to your package and configure with the argument PKG_CONFIG_PATH=$HOME/obsolete/lib/pkgconfig. Unfortunately, ImageMagick will install files outside of your specified prefix (eg in /Library/perl ), so this is not guaranteed to not modify your current library. (IMO, this is an ImageMagick packaging bug.)
Check the pkg-config documentation for details.