Compiling ImageMagick as 64bit under OS X?

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

As far as I can tell, OS X Apache compiled as 64 bit. My previous attempt to run the moddims module that I 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 assume this means that I need to compile moddims as 64 bits ... 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 this 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 64-bit CFLAGS material, this worked fine.

So ... I guess that means that I need to compile ImageMagick as 64 bit. 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' 

This team. / configure works fine, but when I run make , it rolls for a long time 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 struggling from the bottom, but now I'm completely stuck! Any ideas?

0
source share
2 answers

My general trick for ensuring compilation of files is 64-bit (or 32-bit, mutatis mutandis):

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

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

The problem is that libtool was configured as a 32-bit system. Before switching to a 64-bit build, make sure you run " make distclean " to get rid of all the garbage, or completely remove the build directory and re-extract the material from the tarball. Start the setup process, as shown - the chances will be decent, which will be sufficient.

+1
source

You need to add LDFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" to your ./configure calls, and it should compile in order.

This says that I think you will have half the work with ImageMagick unless you are also convinced that libjpeg and libpng are compiled with 64 bits.

You can try running httpd using the i386 (32bit) binary code by adding /usr/bin/arch -i386 to /System/Library/LaunchDaemons/org.apache.httpd.plist . Or you can use lipo to convert /usr/sbin/httpd to i386 binary.

0
source

Source: https://habr.com/ru/post/1388826/


All Articles