Install libmad on Mac OS X Lion: "error: CPU you selected does not support x86-64 instruction set"
Asked Answered
A

2

8

I am trying to install a program that requires the libmad (MPEG audio decoder library) library on Mac OS X 10.7 Lion, but installing libmad.0.15.b results in this error:

version.c:1: error: CPU you selected does not support x86-64 instruction set

That library installs fine on OS X 10.5. Is it a 64-bit compatibility issue? I can't find any specific instructions or documents regarding installing on Lion. Any suggestions? Thanks.

Acidimeter answered 14/2, 2012 at 21:49 Comment(0)
R
8

By default, the C and C++ compilers on Snow Leopard and newer generate 64-bit binaries, not 32-bit as in older versions of OS X. The libmad configure script apparently hasn't been changed to cope with this, and so generates build commands that cause the 32/64 bit conflict you see.

That means one way to fix it is to force a 32-bit build.

But, it's easy enough to clue the configure script into the correct CPU type. For Lion:

$ ./configure x86_64-apple-darwin11.3.0

For Snow Leopard, change the kernel version:

$ ./configure x86_64-apple-darwin10.6.0
Rubadub answered 29/2, 2012 at 13:12 Comment(3)
where do you copy it to next? /sw/bin?Scarificator
Say sudo make install. That will set the library up correctly. Don't just copy raw .dylib files around.Rubadub
+1 FYI: for Mountain Lion: ./configure x86_64-apple-darwin12.2.0 and more generally, uname -a will tell you the darwin version so you can sub in appropriately for future versions.Roxie
H
3

This is an old question, but I believe I have a better answer than Warren Young's.

By default, libmad-0.15.1b is configured to default to using -march i486 when it is built on a *86 architecture that it doesn't recognize. You can disable this behavior, and get it building on your 64 bit Mountain Lion platform, by changing this line

        i?86-*)           arch="i486" ;;

in ./libmad-0.15.1b/configure.ac to this line:

        i?86-*)           arch="" ;;

This should enable libmad to build for whatever architecture the system actually is, instead of forcing i486.

Hacksaw answered 12/10, 2012 at 18:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.