Install Ada on Your Macintosh OS X

Jon Beck

Last Modified: 8 August 2015

The CS180 Foundations of Computer Science I course at Truman State University uses Ada as the teaching language because it is the best teaching language on the planet. Installing Ada is easy on Windows computers and even easier on Linux computers, but for some reason it’s historically been kind of awkward on Macs. These instructions are intended to help out.


To install Ada on your Mac, you need to know the version number, name, and release date of your operating system. The version number can be found by clicking Apple (top left of the screen) → About This Mac. Once you know the version number, you can use look up the name and release date on Wikipedia.


Go to the page and click on the link for GNAT_GCC Mac OS X.

In the links on the subsequent page, you need to search for the latest file that applies to your operating system that is named where the ns are digits and the ellipses are more characters. Do not get a file for a later OS X version than you have.


After the file downloads, open a terminal window (do Finder → Applications → Utilities → and issue the following commands:

        $ cd /
        $ sudo tar jxvf ~/Downloads/filename

where filename is the name of the file that you downloaded.

Install a text editor. I use GNU Emacs but you can also use MacVim or any other text editor.

After the editor is installed, use it to open the file ~/.profile (if the file doesn’t exist, create it). At the bottom of the file, append the line:

            export PATH=/opt/gcc-n.n.n/bin:$PATH

where the ns match the version of the file you downloaded. Make sure you terminate the line with a newline (press return), and save the file. At the terminal prompt, do:

            $ . ~/.profile

Finish Up

Use the editor to create an Ada .adb file. At the command prompt, use cd to navigate to the directory where the file resides. Enter the command:

          $ gnatmake filename.adb

to compile and build the program. If there are errors, use the editor to fix them, save, and try again. If the error message says command not found, then something went wrong with some part of the installation process.

When the file builds without problems, you can run your program with the command:

          $ ./filename

Good luck!