0

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

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

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/

But that gave me this error:

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

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

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'

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?

4

2 回答 2

1

我确保编译 64 位(或 32 位,比照)的一般技巧是:

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

这通过 ' ' 参数将 C 编译器(CXX="g++ -m64"如果您也需要 C++,则添加)视为 64 位编译器。-m64它可能是优雅的,也可能不是优雅的——它是我在 Solaris 和 MacOS X 上使用的。./configure脚本也可以有特定于包的选项来控制它(有时会覆盖它);用' ./configure --help'看看是不是这样。

问题似乎是libtool被设置为 32 位系统。在更改为 64 位构建之前,请确保您已运行 ' make distclean' 以清除所有碎片 - 或完全删除构建目录并从 tar-ball 中重新提取材料。如图所示运行配置过程 - 机会是足够的。

于 2009-07-26T23:12:46.040 回答
0

您需要添加LDFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64"到您的./configure调用中,它应该可以正常编译。

也就是说,我认为您最终会安装一半工作的 ImageMagick,除非您还确保 libjpeg 和 libpng 也使用 64 位编译。

您可以尝试使用 i386(32 位)二进制文件启动 httpd,而不是通过添加/usr/bin/arch -i386/System/Library/LaunchDaemons/org.apache.httpd.plist. 或者您可以使用 lipo 转换/usr/sbin/httpd为仅 i386 的二进制文件。

于 2009-07-30T01:26:22.123 回答