Menu

Compiling a Universal Binary for Mac OS X

To create a universal (fat) binary that can be run on older Mac OS X versions (32 bit) as well as newer (64 bit) releases you need to specify the target architectures to be included in the fat binary. You first need to install the Gnu scientific library as a universal binary. Instructions on doing so (and a script for automating the installation) can be found at http://www.dayel.com/2009/09/building-gsl-universal-binary/. Once the universal binaries for gsl are installed a fat binary can be compiled using the commands:

g++ -O3 -arch i386 -arch x86_64 -c main.cpp; g++ -arch i386 -arch x86_64 main.o -lgsl -lgslcblas -lm -o BA3

To check that the binary is indeed fat use the command:

lipo -detailed_info BA3

Posted by Rannala 2013-05-17

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.