For some reason I always compile some components as 64-bit...

Ryan Schmidt ryandesign at macports.org
Thu May 13 20:04:47 PDT 2010


To answer the question posed by the subject line of the email, software simply compiles 64-bit by default on Snow Leopard. That's how it is. If you want to compile 32-bit instead, set build_arch to i386 in macports.conf and recompile all ports. (This means setting build_arch is best done before you've installed any ports, and if you've already installed any ports, it's therefore best to uninstall all ports, then reinstall them.) Note that not all ports support changing the build_arch. You may be better off building ports universal for both i386 and x86_64; this is better-supported since this capability in MacPorts is older than the build_arch setting.


On May 13, 2010, at 20:48, Yves S. Garret wrote:

> There are two things I'd like to install, couchdb (the erlang database) and wxwidgets (in hopes of making decent looking GUIs in Erlang.)

couchdb installs fine for x86_64. wxwidgets does not [1] but would inform you how to rebuild its dependencies universal, had you attempted to install it while build_arch was still set to x86_64.

[1] http://trac.macports.org/ticket/20952


> I have 10.6 and MacPorts 1.8.2.
> 
> Now, here's what happens:
> % sudo port -d install wxWidgets
> ..............
> DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_smpeg/work/smpeg-0.4.4" && /usr/bin/make all'
> Making all in audio
> make[1]: Nothing to be done for `all'.
> Making all in video
> make[1]: Nothing to be done for `all'.
> /bin/sh ./libtool --mode=link /usr/bin/g++-4.2 -O2 -arch i386 -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DTHREADED_AUDIO -DNDEBUG -I.. -DNOCONTROLS -I. -I./audio -I./video -L/opt/local/lib -framework OpenGL -o plaympeg plaympeg.o libsmpeg.la -L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa
> libtool: link: /usr/bin/g++-4.2 -O2 -arch i386 -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DTHREADED_AUDIO -DNDEBUG -I.. -DNOCONTROLS -I. -I./audio -I./video -o .libs/plaympeg plaympeg.o -Wl,-framework -Wl,Cocoa -L/opt/local/lib ./.libs/libsmpeg.dylib -lSDLmain /opt/local/lib/libSDL.dylib -framework OpenGL
> ld: warning: in /opt/local/lib/libSDL.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

Looks like you installed libsdl with build_arch set to x86_64, then changed build_arch to i386, then tried to install smpeg. This won't work. Decide on the build_arch before installing any ports.



> % sudo port -d install couchdb
> .............
> make[3]: Nothing to be done for `opt'.
> === Leaving application asn1
> === Entering application jinterface
> set -e; set -x; \
> case "make" in *clearmake*) tflag="-T";; *) tflag="";; esac; \
> if test -f com/ericsson/otp/erlang/ignore_config_record.inf; then xflag=$tflag; fi; \
> (cd com/ericsson/otp/erlang && make -f Makefile.otp $xflag opt)
> + case "make" in
> + tflag=
> + test -f com/ericsson/otp/erlang/ignore_config_record.inf
> + xflag=
> + cd com/ericsson/otp/erlang
> + make -f Makefile.otp opt
> if [ ! -d "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B04/lib/jinterface/priv/" ];then mkdir "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B04/lib/jinterface/priv/"; fi
> make[3]: Nothing to be done for `opt'.
> === Leaving application jinterface
> === Entering application wx
> make[3]: Nothing to be done for `opt'.
> mkdir -p ../priv/i386-apple-darwin10.3.0
> /usr/bin/g++-4.2 -bundle -flat_namespace -undefined warning -fPIC -framework OpenGL -L/opt/local/lib -framework CoreFoundation i386-apple-darwin10.3.0/wxe_driver.o i386-apple-darwin10.3.0/wxe_ps_init.o i386-apple-darwin10.3.0/wxe_impl.o i386-apple-darwin10.3.0/wxePrintout.o i386-apple-darwin10.3.0/wxe_return.o i386-apple-darwin10.3.0/wxe_funcs.o i386-apple-darwin10.3.0/wxe_events.o i386-apple-darwin10.3.0/wxe_init.o i386-apple-darwin10.3.0/gl_funcs.o i386-apple-darwin10.3.0/wxe_gl.o -framework IOKit -framework Carbon -framework Cocoa -framework System -framework QuickTime -framework OpenGL -framework AGL -lwx_macud_stc-2.8 -lwx_macud_gl-2.8 -lwx_macud-2.8 -o ../priv/i386-apple-darwin10.3.0/wxe_driver.so
> ld: warning: in i386-apple-darwin10.3.0/wxe_driver.o, file was built for i386 which is not the architecture being linked (x86_64)
> ld: warning: in i386-apple-darwin10.3.0/wxe_ps_init.o, file was built for i386 which is not the architecture being linked (x86_64)
> ld: warning: in i386-apple-darwin10.3.0/wxe_impl.o, file was built for i386 which is not the architecture being linked (x86_64)
> ld: warning: in i386-apple-darwin10.3.0/wxePrintout.o, file was built for i386 which is not the architecture being linked (x86_64)
> ld: warning: in i386-apple-darwin10.3.0/wxe_return.o, file was built for i386 which is not the architecture being linked (x86_64)
> ld: warning: in i386-apple-darwin10.3.0/wxe_funcs.o, file was built for i386 which is not the architecture being linked (x86_64)
> ld: warning: in i386-apple-darwin10.3.0/wxe_events.o, file was built for i386 which is not the architecture being linked (x86_64)
> ld: warning: in i386-apple-darwin10.3.0/wxe_init.o, file was built for i386 which is not the architecture being linked (x86_64)
> ld: warning: in i386-apple-darwin10.3.0/gl_funcs.o, file was built for i386 which is not the architecture being linked (x86_64)
> ld: warning: in i386-apple-darwin10.3.0/wxe_gl.o, file was built for i386 which is not the architecture being linked (x86_64)

You snipped the output of the configure phase so I can't be sure, but it looks like you're trying to build erlang for i386, but part of it still thinks it's supposed to build for x86_64. It should work; I have installed erlang for i386 on a 64-bit Snow Leopard machine.


> ld: warning: in /System/Library/Frameworks//QuickTime.framework/QuickTime, missing required architecture x86_64 in file

On the other hand, erlang is trying to use quicktime...

> ld: warning: in /usr/lib/libwx_macud_stc-2.8.dylib, missing required architecture x86_64 in file
> ld: warning: in /usr/lib/libwx_macud_gl-2.8.dylib, missing required architecture x86_64 in file
> ld: warning: in /usr/lib/libwx_macud-2.8.dylib, missing required architecture x86_64 in file

...and wxwidgets, which are only available for i386. These two facts seem to indicate that it is not possible to build erlang at all on 64-bit Macs running Snow Leopard. However, this doesn't seem to be correct since I am able to build erlang for x86_64 on Snow Leopard as well.

Side note: Looks like on Snow Leopard, erlang is deliberately trying to use the wxwidgets that comes with Mac OS X. erlang should be modified to use the wxwidgets that comes with MacPorts, and to declare a dependency on same, as per usual.



So. You need to decide whether you want to set build_arch to i386, or whether you want to set build_arch to x86_64 and maybe build some ports with the universal variant as necessary to satisfy some ports like wxwidgets that must build 32-bit. I recommend the latter. Either way, you might have a mix of build architectures in your installed ports at this point, so either unravel that manually or uninstall all ports and start over.




More information about the macports-users mailing list