在OS X下将ImageMagick编译为64位? [英] Compiling ImageMagick as 64bit under OS X?

查看:215
本文介绍了在OS X下将ImageMagick编译为64位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在OS X上安装 moddims (请参阅前一个问题),Apache模块与ImageMagick的依赖。

I'm trying to install moddims on OS X (see previous question), an Apache module with a dependency on ImageMagick.

据我所知,OS X Apache被编译为64位。我之前尝试运行我编译的moddims模块时出现了以下错误:

As far as I can tell, the OS X Apache is compiled as 64 bit. My previous attempt to run the moddims module I had compiled gave the following error:

httpd: Syntax error on line 117 of /private/etc/apache2/httpd.conf: 
Cannot load /usr/libexec/apache2/libmod_dims.so into server: 
dlopen(/usr/libexec/apache2/libmod_dims.so, 10): no suitable image found.  
Did find:\n\t/usr/libexec/apache2/libmod_dims.so: mach-o, but wrong architecture

我假设这意味着我需要编译moddims为64位...所以我尝试以下:

I'm presuming that means I need to compile moddims as 64 bit... so I tried the following:

moddims-read-only simon$ ./configure CFLAGS='-arch x86_64' \
    APXSLDFLAGS='-arch x86_64' --with-curl=/usr/local/bin/ \
    --with-imagemagick=/opt/ImageMagick-6.3.9/

但是这给我这个错误:

checking for MagickWandGenesis in -lMagickWand... no
checking for MagickWandGenesis in -lWand... no
configure: error: ImageMagick not found.

以前,当编译没有CFLAGS 64位的东西时,这个工作很好。

Previously, when compiling without the CFLAGS 64 bit stuff, this had worked just fine.

所以...我猜这意味着我需要将ImageMagick编译为64位。我尝试以下:

So... I'm guessing this means I need to compile ImageMagick as 64bit. I tried the following:

ImageMagick-6.3.9 simon$ ./configure --prefix=/opt/ImageMagick-6.3.9/ \
    --exec-prefix=/opt/ImageMagick-6.3.9/ CFLAGS='-arch x86_64' \
    APXSLDFLAGS='-arch x86_64'

./configure命令运行正常,但是当我运行 make 然后会出现这个错误:

That ./configure command runs fine, but when I run make it trundles along happily for a while and then dies with this error:

/bin/sh ./libtool --silent --tag=CC   --mode=link gcc  -arch x86_64 -Wall -W -D_THREAD_SAFE -module -avoid-version -L/usr/X11/lib -R/usr/X11/lib -L/opt/local/lib -lfreetype -lz -o ltdl/dlopen.la  ltdl/loaders/dlopen.lo  
/bin/sh ./libtool --silent --tag=CC   --mode=link gcc  -arch x86_64 -Wall -W -D_THREAD_SAFE -no-undefined -dlpreopen ltdl/dlopen.la  -L/usr/X11/lib -R/usr/X11/lib -L/opt/local/lib -lfreetype -lz -o ltdl/libltdlc.la  ltdl/loaders/ltdl_libltdlc_la-preopen.lo ltdl/ltdl_libltdlc_la-lt__alloc.lo ltdl/ltdl_libltdlc_la-lt_dlloader.lo ltdl/ltdl_libltdlc_la-lt_error.lo ltdl/ltdl_libltdlc_la-ltdl.lo ltdl/ltdl_libltdlc_la-slist.lo ltdl/argz.lo 
ranlib: archive member: ltdl/.libs/libltdlc.a(argz.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
ranlib: archive member: ltdl/.libs/libltdlc.a(argz.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
make[1]: *** [ltdl/libltdlc.la] Error 1
make: *** [all] Error 2

但现在我完全卡住了!任何想法?

I'm alread out of my depth, but now I'm totally stuck! Any ideas?

推荐答案

我确保编译64位(或32位,加以必要的修改) / p>

My general trick for ensuring things compile 64-bit (or 32-bit, mutatis mutandis) is:

CC="gcc -m64" ...other environment...  ./configure  ...configure arguments...

这将处理C编译器(添加 CXX =g ++ -m64 code> -m64 '参数作为64位编译器,如果你需要C ++的话,它可能或可能不优雅 - 这是我在Solaris和MacOS X上使用的。还可以为控制此脚本的 ./ configure 脚本提供特定于包的选项(偶尔覆盖这个);请使用 ./ configure --help '来查看是否这样。

This treats the C compiler (add CXX="g++ -m64" if you need C++ too) as a 64-bit compiler by virtue of the '-m64' argument. It may or may not be elegant - it is what I use on both Solaris and MacOS X. There can also be package-specific options to the ./configure script that control this (occasionally override this); use './configure --help' to see whether this is so.

问题看起来是 libtool 设置为32位系统。在更改为64位构建之前,请确保已运行' make distclean '以清除所有碎片 - 或删除构建目录,然后重新提取从焦油球的材料。运行配置过程,如图所示 - 机会是体面的,将是足够的。

The problem looks to be that the libtool was set up as a 32-bit system. Before changing to the 64-bit build, make sure you've run 'make distclean' to get rid of all the debris - or remove the build directory altogether and re-extract the material from the tar-ball. Run the configure process as shown - the chances are decent that will be sufficient.

这篇关于在OS X下将ImageMagick编译为64位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆