Mac OSX Snow Leopard 上的 ImageMagick。有什么办法让它编译并运行吗?

发布于 2024-08-25 22:22:26 字数 2897 浏览 2 评论 0原文

似乎我在 Snow Leopard 上运行标准 Unix 东西比任何其他平台(包括 Windows cygwin)都遇到更多麻烦

在过去的几天里,我一直在尝试让 ImageMagick 在 Snow Leopard 上运行。

最明显的方法,Mac Ports,失败了:

tppllc-Mac-Pro:ImageMagick-sl swirsky$ sudo port install imagemagick
--->  Computing dependencies for p5-locale-gettext
--->  Configuring p5-locale-gettext
Error: Target org.macports.configure returned: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_perl_p5-locale-gettext/work/gettext-1.05" && /opt/local/bin/perl Makefile.PL INSTALLDIRS=vendor " returned error 2
Command output: checking for gettext... no
checking for gettext in -I/opt/local/include -arch i386 -L/opt/local/lib -lintl...gettext function not found. Please install libintl at Makefile.PL line 18.
 no

Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade xorg-libXt failed
Before reporting a bug, first run the command again with the -d flag to get complete output.
tppllc-Mac-Pro:ImageMagick-sl swirsky$ 

不想再花两天时间弄清楚为什么我的 libintl 没有“gettext”函数,我尝试了不同的路线:这里提到的脚本: http://github.com/masterkain/ImageMagick-sl

此脚本独立于 MacPorts 问题下载并安装 ImageMagic

tppllc-Mac-Pro:ImageMagick-sl swirsky$ /usr/local/bin/convert
dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
  Referenced from: /opt/local/lib/libfontconfig.1.dylib
  Reason: Incompatible library version: libfontconfig.1.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
Trace/BPT trap

它下载所有内容并编译正常,但当我尝试运行它时失败,并显示上面的消息。

现在我距离 ImageMagick 还差两步,试图在我的机器上安装更新的 libiconv。

我下载了最新的libiconv,编译并构建了它。我将生成的库放入 /opt/local/lib 中,但仍然收到相同的错误消息:

tppllc-Mac-Pro:.libs swirsky$ sudo mv libiconv.2.dylib /opt/local/lib/libiconv.2.dylib
tppllc-Mac-Pro:.libs swirsky$ convert
dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
  Referenced from: /opt/local/lib/libfontconfig.1.dylib
  Reason: Incompatible library version: libfontconfig.1.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
Trace/BPT trap

现在这里有一些有趣的事情。错误消息显示它正在/opt/local/lib/libiconv.2.dylib 中查找。

otools -L 显示这确实实现了 8.0.0:

tppllc-Mac-Pro:.libs swirsky$ otool -L /opt/local/lib/libiconv.2.dylib
/opt/local/lib/libiconv.2.dylib:
    /usr/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)
tppllc-Mac-Pro:.libs swirsky$ 

并且,为了更好地衡量,我设置了 DYLD_LIBRARY_PATH 以确保该目录是动态库的目录。

因此,即使我确实有一个提供 8.0.0 的库,它也被视为 7.0.0!有什么想法为什么会发生这种情况吗?

所以这是我的问题:是否可以让 ImageMagick 在 OSX Snow Leopard 上运行?是否有任何二进制发行版内置了静态库,这样我就不必担心这些问题/

It seems that I have more trouble getting standard Unix things to run on Snow Leopard than any other platform--including Windows cygwin

For the past couple of days, I've been trying to get ImageMagick to run on Snow Leopard.

The most obvious way, Mac Ports, fails:

tppllc-Mac-Pro:ImageMagick-sl swirsky$ sudo port install imagemagick
--->  Computing dependencies for p5-locale-gettext
--->  Configuring p5-locale-gettext
Error: Target org.macports.configure returned: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_perl_p5-locale-gettext/work/gettext-1.05" && /opt/local/bin/perl Makefile.PL INSTALLDIRS=vendor " returned error 2
Command output: checking for gettext... no
checking for gettext in -I/opt/local/include -arch i386 -L/opt/local/lib -lintl...gettext function not found. Please install libintl at Makefile.PL line 18.
 no

Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade xorg-libXt failed
Before reporting a bug, first run the command again with the -d flag to get complete output.
tppllc-Mac-Pro:ImageMagick-sl swirsky$ 

Not wanting to spend another two days figuring out why my libintl doesn't have a "gettext" function, I tried a different route: the script mentioned here: http://github.com/masterkain/ImageMagick-sl

This script downloads and installs an ImageMagic independently of MacPorts issues

tppllc-Mac-Pro:ImageMagick-sl swirsky$ /usr/local/bin/convert
dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
  Referenced from: /opt/local/lib/libfontconfig.1.dylib
  Reason: Incompatible library version: libfontconfig.1.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
Trace/BPT trap

It downloads everything and compiles fine, but fails when I try to run it, with the message above.

So now I'm two steps away from ImageMagick, trying to get a newer libiconv on my machine.

I downloaded the latest libiconv, compiled and built it. I put the resulting library in /opt/local/lib, and I still get the same error message:

tppllc-Mac-Pro:.libs swirsky$ sudo mv libiconv.2.dylib /opt/local/lib/libiconv.2.dylib
tppllc-Mac-Pro:.libs swirsky$ convert
dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
  Referenced from: /opt/local/lib/libfontconfig.1.dylib
  Reason: Incompatible library version: libfontconfig.1.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
Trace/BPT trap

Now here's something interesting. The error message shows it's looking in /opt/local/lib/libiconv.2.dylib.

otools -L shows that this does implement 8.0.0:

tppllc-Mac-Pro:.libs swirsky$ otool -L /opt/local/lib/libiconv.2.dylib
/opt/local/lib/libiconv.2.dylib:
    /usr/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)
tppllc-Mac-Pro:.libs swirsky$ 

And, for good measure, I set the DYLD_LIBRARY_PATH to make sure this directory is the one for dynamic libraries.

So even though I do have a library that provides 8.0.0, it's being seen as 7.0.0! Any ideas why this would happen?

So here's my question: Is it possible to get ImageMagick to run on OSX Snow Leopard? Are there any binary distributions that have static libraries baked in so I don't have to worry about these issue/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

來不及說愛妳 2024-09-01 22:22:26

这对我有用:

sudo brew install imagemagick

This worked for me:

sudo brew install imagemagick

一袭白衣梦中忆 2024-09-01 22:22:26

您还可以尝试位于此处的 ImageMagick 安装脚本:
http://github.com/masterkain/ImageMagick-sl

它对我帮助很大。可能需要更改脚本内的某些库版本。

You may also try the ImageMagick install script located here:
http://github.com/masterkain/ImageMagick-sl

It helped me a lot. May be needed to change some library versions inside the script.

遥远的绿洲 2024-09-01 22:22:26

我在多种情况下都看到过这个库的确切错误。在每种情况下,个人或他们使用的脚本都会设置 DYLD_LIBRARY_PATH 变量。

确保未设置此变量,因为它会覆盖使用该路径中的显式链接库的加载。

如果必须设置 DYLD_*,请使用更合理的 DYLD_FALLBACK_LIBRARY_PATH。它将首先尝试加载显式链接的库,然后回退到用户声明的库。

我确实注意到您的初始构建中没有在 macports 中找到 gettext 库。所以请确保这些已安装。

I've seen this exact error with this exact library in multiple situations. It was, in every case, an instance where either the individual or an script they were using was setting the DYLD_LIBRARY_PATH variable.

Make sure this variable is not being set as it overrides loading the explicitly linked libraries with those at that path.

If the DYLD_* must be set, use the more sane DYLD_FALLBACK_LIBRARY_PATH. Which will attempt to load the explicitly linked libraries first, then fallback to the user declared ones.

I did notice on your initial build that it was not finding the gettext library in macports. So make sure those are installed.

千秋岁 2024-09-01 22:22:26

我的谷歌显示了一些点击,第一个或第二个有一个 链接到二进制文件

My google showed up a few hits, and the first or second one had a link to the binary.

攀登最高峰 2024-09-01 22:22:26

我终于能够让我的“macports”安装足够一致,以安装并运行 imagemagick。我必须手动删除文件所在的 /opt/local/ 目录,并清除一些其他依赖项。

I was finally able to get my "macports" installation consistent enough to get imagemagick installed and running. I had to manually delete my /opt/local/ directores where the files lived, and clean out some other dependencies.

鸢与 2024-09-01 22:22:26

动态链接器似乎正在拉入系统libiconv.2.dylib(其兼容版本为7.0.0)。如果没有看到你的整个构建过程,很难确定为什么会这样,但我对你的 libiconv 构建表示怀疑;请注意,在以下失败中:

tppllc-Mac-Pro:.libs swirsky$ otool -L /opt/local/lib/libiconv.2.dylib
/opt/local/lib/libiconv.2.dylib:
    /usr/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

您的 libiconv.2.dylib 似乎认为其安装路径是 /usr/local/lib,而不是 /opt/local /lib.这可能就是动态链接器找不到它的原因;它在 /usr/local/lib 中寻找它,但没有找到它,然后退回到 /usr/lib 中的系统库。尝试设置 libiconv.2.dylib 的安装路径,以便加载命令告诉链接器在 /opt/local/lib 中查找它,这可能会解决的问题。

It seems that the dynamic linker is pulling in the system libiconv.2.dylib (which has compatibility version 7.0.0). Without seeing your entire build process it's hard to know for sure why this is, but I'm suspicious of your libiconv build; note that in the following failure:

tppllc-Mac-Pro:.libs swirsky$ otool -L /opt/local/lib/libiconv.2.dylib
/opt/local/lib/libiconv.2.dylib:
    /usr/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

your libiconv.2.dylib seems to think that its install path is /usr/local/lib, not /opt/local/lib. This probably why the dynamic linker isn't finding it; it's looking for it in /usr/local/lib, not finding it, and falling back on the system library in /usr/lib. Try setting the install path for your libiconv.2.dylib so that it's load commands tell the linker to look for it in /opt/local/lib, and that may resolve the issue.

要走就滚别墨迹 2024-09-01 22:22:26

我遇到了同样的问题,并通过使用 Macports 卸载然后重新安装 libiconv 来解决它。然后一切正常(我也有 /opt/local/lib/ 作为我的 DYLD_LIBRARY_PATH 变量中的第一个条目)

I had the same problem, and solved it by uninstalling then reinstalling libiconv using Macports. Then everything works fine (I also have /opt/local/lib/ as the first entry in my DYLD_LIBRARY_PATH variable)

完美的未来在梦里 2024-09-01 22:22:26

奇怪的。我对我的 macports 非常满意 - 所有内容都编译得没有错误。我只能建议 - 使用 macports。
ImageMagick @6.6.9-9_0+graphviz+hdri+jpeg2+mpeg+perl+q16+rsvg+wmf(有效)

Strange. I'm pretty happy with my macports - and everything is compiled without errors. I can only advice - use macports.
ImageMagick @6.6.9-9_0+graphviz+hdri+jpeg2+mpeg+perl+q16+rsvg+wmf (active)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文