Some years ago, Truman started its own Macintosh Users Group (MUG) and I found myself as one of it's faculty co-sponsors. Our goal is to promote the value and virtue of OS X as an environment for research, study, and play. We also see ourselves as an important resource for students in this Windoze-centric environment.
To help give the Mac a toe-hold in the mathematics and computer science world here, I've taken it upon myself to learn how to compile Ada code using the tools that ship with OS X. Each year, a few students ask me how to do this, and I'm happy to say that I've finally found an answer. Read on for more.
Please email any other Frequently Asked Questions (and their answers, if possible) to the author at [this email address]. He will do his best to grow this FAQ to better serve the OS X student community.
Once the update is installed (download, uncompress, mount the DMG file, following the instructions for preparing your system, and unpack the PKG file), you will be able to use gnatmake at the command line to compile your code.
First, you need to have Xcode on your system. Xcode is installed as part of the OS X Developer Tools. This can be installed from your original OS X 10.x install disks or it can be downloaded from Apple at this [Apple Developer Page]. (A free membership to Apple's Developer Community may be required.)
After you install the Developer Tools you will have an app called Xcode. You should be able to find it in /Developer/Applications/. This is the IDE that you will eventually use to compile and build your code.

If you were to launch Xcode before you install the Ada bindings, and if you were to try to start a new Ada project, you might see something like the following:


At this point, Ada does not appear as an project option in Xcode, and it won't until you carry out the third step of the process described here.
The second step of this process requires that you apply the Ada update to gcc to allow the compiling and building of Ada code at the command line. Download the latest update with the Ada bindings for Xcode at [macada.org], on it's bindings page. If that link doesn't work, you can get a (possibly old) copy [here].
Installing this update does not give you any Ada project options in Xcode, nor does it configure Xcode to compile Ada. The next step will do that.
The third step of this process requires you to install the Ada carbon binding. (Carbon is a bit of OS X jargon.) These can be found at [macada.org]. Download the bindings that are appropriate for your version of OS X. The disk imgae should automatically mount after you download and unpack the bindings. Double-click Carbon_Bindings_xcode.pkg to install the bindings.

The last step is documented in the Jambase Patch.rtf file that's included in the Xcode bindings disk image that you downloaded in the third step of this process. You must have administrator privileges to do this. Here is part of the instructions from the Jambase Patch.rtf file, but beware that the directions distributed with the Xcode bindings will be the more up-to-date than the text on this web page:
to install this patch copy the file jambase_patch to the directory "/Developer/Makefiles/pbx_jamfiles". Then in the terminal do the following commands: cd /Developer/Makefiles/pbx_jamfiles |
Steve Holland says, "for step 3 of the install I'd modify the install with an automatic backup option"
sudo patch -b -p0 ProjectBuilderJambase < jambase_patch |
At this point, you are all set to develop software in Ada using gcc and Xcode. You can find Ada project examples in /Developer/Examples/Ada. At this point, when you launch Xcode and start a new project, the project Assistant should show you some new items:


Note that the triangles in this list of project types are flippy triangles. You can hide the project types that you'll probably never use.

To test that Xcode now compiles and builds Ada code, you can do the following. Launch Xcode, create a new Ada Standard Tool project, and call it something innocuous like test. Click on Finish to create the project.
Once you've created the project, the Xcode IDE will open with a few files in the workspace.
If you click the "Build and Run" icon, you'll also see that a window opens to discplay the output of your code as if you had run it at the command line.
Note that when you compile Ada code in Xcode, the executeable gets put into a build subdirectory of your project directory. To execute the binary at the command line, open a Terminal window (available in /Applications/Utilities/), cd to ~/test, and "ls -la". You should see
Your binary executable is in the build subdirectory. You can run it from the test directory by entering "./build/test" at the command line. Or you can change your working directory to be the build subdirectory, and execute it from there, as illustrated below.
The above screenshot shows a successful execution of the test Ada program!
Note that the name of your project's main program file (e.g., test.adb in the above example) should be same name as your project. You can get around this. To find out how, submit the question to the gnat-osx mailing list.
If you experience problems getting your system patched and configured to compile Ada code, I strongly recommend the gnat-osx mailing list as a resource for getting your questions answered. The members of that community are knowledgeable and quick to respond to questions. (You'll also note that that community is deeply involved in the macada.org project.)
An Ada alternative to Xcode is jGRASP, a development environment written in Java that compiles Ada out-of-the-box. It can be downloaded from the jGRASP web site along with tutorials in its use. Like Xcode, it does have some functionality that will not be of interest to CS 180 or CS 185 students. Unlike Xcode, a project's main
The jGRAP project seems to be a vigorous and well supported activity, so it is reasonable to expect its development to continue and support for jGRASP to be available well into the foreseeable future.
If he can't answer your question outright, he'll forward it on to the gnat-osx email list. You might as well skip the middleman and subscribe to that list yourself. You can do so [here]. The members of that community are knowledgeable and quick to respond to questions. They are also very happy to answer questions from students. (You'll also not that that community is deeply involved in the macada.org project.)
Created by Jason Miller on 26 September 2004 using Snapz Pro X for the screenshots. Updated on 30 August 2006.
James Hopper, Stephen Holland, and the [gnat-osx list] made this HOWTO/FAQ possible.
Last modified on <September 26, 2004