Install libmad on Mac OS X Lion: "Error: The CPU you selected does not support the x86-64 instruction set"

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

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

This library is great for OS X 10.5. Is this a 64-bit compatibility issue? I cannot find any specific instructions or documents regarding the installation on Lion. Any suggestions? Thanks.

+8
unix osx-lion mpeg macos
source share
2 answers

By default, Snow and Leopard C and C ++ compilers generate 64-bit binaries, rather than 32-bit ones, as in older versions of OS X. The libmad configure script does not seem to have been modified to handle this. and so generates build commands that cause a 32/64 bit conflict that you see.

This means that one way to fix this is to force a 32-bit build.

But it’s easy enough to install the configure script in the correct processor type. For the lion:

 $ ./configure x86_64-apple-darwin11.3.0 

For Snow Leopard, change the kernel version:

 $ ./configure x86_64-apple-darwin10.6.0 
+8
source share

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

By default, libmad-0.15.1b is configured by default to use -march i486 when it is built on * 86 architecture, which it does not recognize. You can disable this behavior and build it 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 allow libmad to build for any architecture, in fact, a system, and not force i486 .

+2
source share

All Articles