Compile with -arch flags on OS X

Asked by jus

http://bazaar.launchpad.net/~mixxxdevelopers/mixxx/release-1.9.x/revision/2671 introduced the compile with -arch flags on OS X.

I have problems compiling on MacOS 10.6.5 with "scons hss1394=0" since.
FYI i installed all the libraries via macports and they have worked flawless until.

ld: warning: directory '/sw/lib' following -L not found
ld: warning: in /opt/local/lib/libportmidi.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libmad.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libid3tag.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libsndfile.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libFLAC.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libvorbisfile.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libvorbis.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libogg.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libGL.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libGLU.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libtag.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libshout.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libvorbisenc.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols:
.......
.......
ld: symbol(s) not found
collect2: ld returned 1 exit status
scons: *** [osx32_build/mixxx] Error 1
scons: building terminated because of errors.

Any ideas?

Question information

Language:
English Edit question
Status:
Solved
For:
Mixxx Edit question
Assignee:
No assignee Edit question
Solved by:
jus
Solved:
Last query:
Last reply:
Revision history for this message
Albert Santoni (gamegod) said :
#1

For some reason MacPorts only compiled all those libraries for PPC and
i386, not x86_64. (You can do a 3-way universal binary.)

Our SConscript is detecting that your machine is 64-bit and trying to
link against those libraries, but it can't mix architectures like that
(ie. it can't build a 64-bit Mixxx and link it against 32-bit
libraries unless it's universal).

When you run scons, what is it reporting your Machine as? (It's one of
the first lines of output.)

Try compiling with:

scons machine=i386

and that should force our build system to try building a 32-bit Mixxx.

Thanks,
Albert

On Fri, Jan 7, 2011 at 1:08 AM, jus
<email address hidden> wrote:
> New question #140520 on Mixxx:
> https://answers.launchpad.net/mixxx/+question/140520
>
> http://bazaar.launchpad.net/~mixxxdevelopers/mixxx/release-1.9.x/revision/2671 introduced the compile with -arch flags on OS X.
>
> I have problems compiling on MacOS 10.6.5 with "scons hss1394=0" since.
> FYI i installed all the libraries via macports and they have worked flawless until.
>
> ld: warning: directory '/sw/lib' following -L not found
> ld: warning: in /opt/local/lib/libportmidi.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libmad.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libid3tag.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libsndfile.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libFLAC.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libvorbisfile.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libvorbis.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libogg.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libGL.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libGLU.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libtag.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libshout.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libvorbisenc.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> Undefined symbols:
> .......
> .......
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> scons: *** [osx32_build/mixxx] Error 1
> scons: building terminated because of errors.
>
> Any ideas?
>
> --
> You received this question notification because you are a member of
> Mixxx Development Team, which is an answer contact for Mixxx.
>

Revision history for this message
jus (jus) said :
#2

Thanks for getting back...
If i remember right i could not get taglib to compile from source on 10.6 , so i switched to macports for convenience.
Lazy arse got the ticket now :-)

<quote>When you run scons, what is it reporting your Machine as?</quote>
localhost:mixxx jus$ scons hss1394=0
scons: Reading SConscript files ...
INFO:root:Target Platform: osx
INFO:root:Target Machine: i386
INFO:root:Build: debug
INFO:root:Toolchain: gnu
INFO:root:Crosscompile: NO
INFO:root:Qt path: /Library/Frameworks
Loading qt4 tool...

"scons machine=i386" gives same error like in my first message.

Revision history for this message
jus (jus) said :
#3

All went better then expected, macports is not only for i386.

Looks like scons does not get the machine type right, if forced to use x86_64 it builds just fine.
Even with optimize=4, this option never worked for me for some reasons.

Ended up with "scons hss1394=0 machine=x86_64 optimize=4"