Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 814
Drew C Avatar asked Feb 14 '12 21:02

Drew C


1 Answers

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
like image 178
Warren Young Avatar answered Sep 21 '22 16:09

Warren Young