How to compile CFITSIO as a Universal Binary on Mac OS-X

These instructions are for compiling CFITSIO so that is can be linked with code running on a Mac OS-X machine with either an Intel processor or a Power PC processor.

  1. Unzip the CFITSIO library: tar xzf cfitsio3060.tar.gz (or whatever version this is)

  2. cd cfitsio/

  3. copy the file here. This project file was kindly supplied by Lars Holm Nielsen of the ESA/ESO/NASA Photoshop FITS Liberator project, and updated in March 2010 by Bryan Irby.

  4. unzip

  5. start Xcode and open cfitsio.xcodeproj

  6. right-click on Targets -> Build PPC -> Build Build PPC when that finishes...:

  7. right-click on Targets -> Build i386 -> Build Build i386 when that finishes...:

  8. right-click on Targets -> Build Universal -> Build Build Universal

    (For some reason clicking on the menu "Build" icon doesn't seem to work correctly, but the right-click menus do).

The static library (universal binary) is now available in the CFITSIO root directory (libcfitsio.a)

Another way to build the universal binary:

  1. unpack the cfitsio source code tar file

  2. cd cfitsio

  3. setenv CFLAGS "-arch ppc -arch i386 -g -O2"

  4. Then proceed with the standard cfitsio build, i.e.:
    • ./configure
    • make
    • make install

Return to the FITSIO home page.

FITSIO is maintained by: Dr. William D. Pence, (email: pence 'at'