Xcode Other Options

From OS X Scientific Computing

Jump to: navigation, search


An alternative to Option 1: Install all of Xcode

You can download all of Xcode (for free) either from the Apple Store, or from Apple's Developer Download site, and then from within the Xcode.app interface, you can then download and install the command-line tools.

Here is how it looks via the App Store interface:

You download it, and it installs like a "normal" applications in your /Applications directory. It no longer creates a /Developer directory.

It is a huge download (well over a gigabyte of largely useless crap), so plan accordingly.

Once it downloads, open it up, do all the stuff required to get it running, and then open up Xcode Preferences.

Go to "Downloads", as shown below, and then click on "Install" for the command line tools".

If you haven't already, you will be prompted to register for a (free) Developer account. (Again, something I hate. Why should you have to register to use the f-ing GNU compilers?).


  • Go to Apple's Developer Download site, register, and download the latest Xcode (v. 3.0 for OS X 10.5.x and v. 2.5 for OS X 10.4.x as of this writing) and install it. Install everything, not just the defaults. Be sure to install X11 SDK (it should do so by default).

Note that Xcode 3.0 comes on the OS X 10.5 installation DVD.

  • The installation is free, but you have to register, which is kind of tedious.
  • Xcode also comes with some versions of OS X, but you still need to check to be sure you have the latest version. (On computers with OS X pre-installed, an Xcode installer may be found in /Applications/Installers. Otherwise, it should be on the OS X install DVD.)
  • The download is over 1GB, so plan on using a fast connection. (This is a bit frustrating since you only need about 100 MB of the stuff that comes with it.)


Why do this?

For our purposes, this is to get ahold of the compilers. (Apple supplies gcc, g++, objective-c and related gnu compilers, along with various header files, libraries, and ancillary programs that make compiling third-party software possible.)

Apple's Xcode (Developer Tools) are designed to enable anyone to create OS X applications. For our purposes (compiling software, primarily), the critical components are the compilers and associated library and header files, as well as compiler-associated software like the linker, make, and so forth. These things get installed in /usr. The stuff that enables you to build OS X applications gets installed into /Developer. If you are short on space (eg, you have a laptop), you can install everything and then delete the /Developer directory (burn it to a DVD first if you are worried).

What about Fortran?

If you need a fortran compiler, gfortran, g95, fort77, f2c, and g77 (ppc only) are available as fink packages.

Other Compiler Options

Intel makes cc/c++ and fortran compilers that you can buy and install. This may be worth doing if you have a lot of numerically or computationally intense computing tasks, and need the most efficient binaries possible.

You can download free evaluation copies that will permit you to try before you buy:

IBM also makes proprietary compilers, but since the switchover to intel, I am not sure that these will be continued.

Odds and Ends

You need to use the following complier flag syntax for linking Cocoa Frameworks and Apple's Blas/Lapack now:

-Wl,-framework -Wl,vecLib

External Links

Apple's Xcode website and download links

Personal tools