Ada Programming/Installing

Ada compilers are available from several vendors, on a variety of host and target platforms. The Ada Resource Association maintains a list of available compilers.

Below is an alphabetical list of available compilers with additional comments.

AdaMagic from SofCheck
SofCheck used to produce an Ada 95 front-end that can be plugged into a code generating back-end to produce a full compiler. This front-end is offered for licensing to compiler vendors.

Based on this front-end, SofCheck used to offer:


 * AdaMagic, an Ada-to-C/C++ translator
 * AppletMagic, an Ada-to-Java bytecode compiler

SofCheck has merged with AdaCore under the AdaCore name, leaving no visible trace of AdaMagic offering on AdaCore website.

However, MapuSoft is now licensed to resell AdaMagic. They renamed it to "Ada-to-C/C++ changer". New name sounds like fake. Almost no Ada developer heard of MapuSoft. MapuSoft is never seen making Ada libraries, commercial or FLOSS. They are never seen at Ada conferences. Yet this is a real stuff, a validated Ada compiler that knows lots of tricks required to work on top of C/C++ compilers. E.g. it contains a proven knowledge of handling integer overflow with a special "-1" case.

Thanks to MapuSoft, AdaMagic really became available to developers. Get AppCOE, but not Win64 one, install it. In the MapuSoft/AppCOE_x32/Tools/Ada there will be AdaMagic. AdaMagic is known to support Win64, but AppCOE for Win64 is known to contain no AdaMagic at all.

Using AdaMagic from command line is badly supported in AppCOE, but possible. Set up ADA_MAGIC environment variable, edit Tools/Ada/{linux|windows}/SITE/rts_path to point to real path, edit SITE/config to get rid of unsupported C compiler keys, and compile via e.g.

Commercial; proprietary.

AdaMULTI from Green Hills Software
Green Hills Software sells development environments for multiple languages and multiple targets (including DSPs), primarily to embedded software developers.

GHS claims to make great efforts to ensure that their compilers produce the most efficient code and often cites the EEMBC benchmark results as evidence, since many of the results published by chip manufacturers use GHS compilers to show their silicon in the best light, although these benchmarks are not Ada specific.

GHS has no publicly announced plans to support the two most recent Ada standards (2005 and 2012) but they do continue to actively market and develop their existing Ada products.

DEC Ada from HP
DEC Ada was an Ada 83 compiler for OpenVMS. While “DEC Ada” is probably the name most users know, the compiler has also been called “HP Ada”, "VAX Ada", and "Compaq Ada".


 * Ada for OpenVMS Alpha Installation Guide (PDF)
 * Ada for OpenVMS VAX Installation Guide (PDF)

GNAT, the GNU Ada Compiler from AdaCore and the Free Software Foundation
GNAT is the free GNU Ada compiler, which is part of the GNU Compiler Collection. It is the only Ada compiler that supports all of the optional annexes of the language standard. The original authors formed the company AdaCore to offer professional support, consulting, training and custom development services. It is thus possible to obtain GNAT from many different sources, detailed below.

GNAT is always licensed under the terms of the GNU General Public License.

However, the run-time library uses either the GPL, or the GNAT Modified GPL, depending on where you obtain it.

Several optional add-ons are available from various places:


 * ASIS, the Ada Semantic Interface Specification, is a library that allows Ada programs to examine and manipulate other Ada programs.
 * FLORIST is a library that provides a POSIX programming interface to the operating system.
 * GDB, the GNU Debugger, with Ada extensions.
 * GLADE implements Annex E, the Distributed Systems Annex. With it, one can write distributed programs in Ada, where partitions of the program running on different computers communicate over the network with one another and with shared objects.
 * GPS, the GNAT Programming Studio, is a full-featured integrated development environment, written in Ada. It allows you to code in Ada, C and C++.

Many Free Software libraries are also available.

GNAT GPL (or Community) Edition
As of may 2022, AdaCore no longer supports GNAT GPL. It has been replaced with Alire, a package manager for Ada sources, which also provides toolchains. The following is no longer relevant for post May 2022 users.

This is a source and binary release from AdaCore, intended for use by Free Software developers only. If you want to distribute your binary programs linked with the GPL run-time library, then you must do so under terms compatible with the GNU General Public License.

As of GNAT GPL Edition 2013:

GNAT Modified GPL releases
With these releases of GNAT, you can distribute your programs in binary form under licensing terms of your own choosing; you are not bound by the GPL.

GNAT 3.15p
This is the last public release of GNAT from AdaCore that uses the GNAT Modified General Public License.

GNAT 3.15p has passed the Ada Conformity Assessment Test Suite (ACATS). It was released in October 2002.

The binary distribution from AdaCore also contains an Ada-aware version of the GNU Debugger (GDB), and a graphical front-end to GDB called the GNU Visual Debugger (GVD).

GNAT Pro
GNAT Pro is the professional version of GNAT, offered as a subscription package by AdaCore. The package also includes professional consulting, training and maintenance services. AdaCore can provide custom versions of the compiler for native or cross development. For more information, see http://www.adacore.com/.

GCC
GNAT has been part of the Free Software Foundation's GCC since October 2001. The Free Software Foundation does not distribute binaries, only sources. Its licensing of the run-time library for Ada (and other languages) allows the development of proprietary software without necessarily imposing the terms of the GPL.

Most GNU/Linux distributions and several distributions for other platforms include prebuilt binaries; see below.

For technical reasons, we recommend against using the Ada compilers included in GCC 3.1, 3.2, 3.3 and 4.0. Instead, we recommend using GCC 3.4, 4.1 or later, or one of the releases from AdaCore (3.15p, GPL Edition or Pro).

Since October 2003, AdaCore merge most of their changes from GNAT Pro into GCC during Stage 1; this happens once for each major release. Since GCC 3.4, AdaCore has gradually added support for revised language standards, first Ada 2005 and now Ada 2012.

GCC version 4.4 switched to version 3 of the GNU General Public License and grants a Runtime Library Exception similar in spirit to the GNAT Modified General Public License used in all previous versions. This Runtime Library Exception applies to run-time libraries for all languages, not just Ada.

As of GCC 4.7, released on 2012-03-22:

The GNU Ada Project
The GNU Ada Project provides source and binary packages of various GNAT versions for several operating systems, and, importantly, the scripts used to create the packages. This may be helpful if you plan to port the compiler to another platform or create a cross-compiler; there are instructions for building your own GNAT compiler for GNU/Linux and Mac OS X users.

Both GPL and GMGPL or GCC Runtime Library Exception versions of GNAT are available.

A# (A-Sharp, a.k.a. Ada for .NET)
This compiler is historical as it has now been merged into GNAT GPL Edition and GNAT Pro.

A# is a port of Ada to the |Microsoft .NET Platform. A# was originally developed at the Department of Computer Science at the United States Air Force Academy which distribute A# as a service to the Ada community under the terms of the GNU general public license. A# integrates well with Microsoft Visual Studio 2005, AdaGIDE and the RAPID open-source GUI Design tool. As of 2006-06-06:

GNAT for AVR microcontrollers
Rolf Ebert and others provide a version of GNAT configured as a cross-compiler to various AVR microcontrollers, as well as an experimental Ada run-time library suitable for use on the microcontrollers. As of Version 1.1.0 (2010-02-25):

GNAT for LEON
The Real-Time Research Group of the Technical University of Madrid (UPM, Universidad Politécnica de Madrid) wrote a Ravenscar-compliant real-time kernel for execution on LEON processors and a modified run-time library. They also provide a GNAT cross-compiler. As of version 2.0.1:

GNAT for Macintosh (Mac OS X)
GNAT for Macintosh provides both FSF (GMGPL) and AdaCore (GPL) versions of GNAT with Xcode and Carbon integration and bindings.

Note that this site was last updated for GCC 4.3 and Mac OS X Leopard (both PowerPC and Intel-based). Aside from the work on integration with Apple’s Carbon graphical user interface and with Xcode 3.1 it may be preferable to see above.

There is also support at MacPorts; the last update (at 25 Nov 2011) was for GCC 4.4.2.

Prebuilt packages as part of larger distributions
Many distributions contain prebuilt binaries of GCC or various public releases of GNAT from AdaCore. Quality varies widely between distributions. The list of distributions below is in alphabetical oder. (Please keep it that way.)

AIDE (for Microsoft Windows)
AIDE &mdash; Ada Instant Development Environment is a complete one-click, just-works Ada distribution for Windows, consisting of GNAT, comprehensive documentation, tools and libraries. All are precompiled, and source code is also available. The installation procedure is particularly easy (just unzip to default c:\aide and run). AIDE is intended for beginners and teachers, but can also be used by advanced users.

Cygwin (for Microsoft Windows)
Cygwin, the Linux-like environment for Windows, also contains a version of the GNAT compiler. The Cygwin version of GNAT is older than the MinGW version and does not support DLLs and Multi-Threading (as of 11.2004).

Debian (GNU/Linux and GNU/kFreeBSD)
There is a Debian Policy for Ada which tries to make Debian the best Ada development and deployment platform. The development platform includes the compiler and many libraries, pre-packaged and integrated so as to be easy to use in any program. The deployment platform is the renowned stable distribution, which is suitable for mission-critical workloads and enjoys long life cycles, typically 3 to 4 years. Because Debian is a binary distribution, it is possible to deploy non-free, binary-only programs on it while enjoying all the benefits of a stable platform. Compiler choices are conservative for this reason, and the Policy mandates that all Ada programs and libraries be compiled with the same version of GNAT. This makes it possible to use all libraries in the same program. Debian separates run-time libraries from development packages, so that end users do not have to install the development system just to run a program.

The GNU Ada compiler can be installed on a Debian system with this command:

aptitude install gnat

This will also give you a list of related packages, which are likely to be useful for an Ada programmer.

Debian is unique in that it also allows programmers to use some of GNAT's internal components by means of two libraries: Debian packages make use of these libraries.
 * libgnatvsn (licensed under GNAT-Modified GPL) and
 * libgnatprj (the project manager, licensed under pure GPL).

In the table below, the information about the future Debian 8.0 Jessie is accurate as of October 2014 and will change.

The ADT plugin for Eclipse (see section ObjectAda from Aonix) can be used with GNAT as packaged for Debian Etch. Specify "/usr" as the toolchain path.

DJGPP (for MS-DOS)
DJGPP has GNAT as part of their GCC distribution.

DJGPP is a port of a comprehensive collection of GNU utilities to MS-DOS with 32-bit extensions, and is actively supported (as of 1.2005). It includes the whole GCC compiler collection, that now includes Ada. See the DJGPP website for installation instructions.

DJGPP programs run also in a DOS command box in Windows, as well as in native MS-DOS systems.

FreeBSD and DragonFly
FreeBSD's ports collection has an Ada framework with an expanding set of software packages. The Framework is currently built by FSF GCC 6.3.1, although FSF GCC 5.4 can optionally be used instead. The AdaCore GPL compilers are not present. There are several reasons for this, not the least of which is the addition maintenance of multiple compilers is significant. There are no non-GCC based Ada compilers represented in ports either.

While FreeBSD does have a snapshot that goes with each release, the ports are updating in a rolling fashion continuously, and the vast majority of users prefer the "head" of ports which has the latest packages.

There are two ways to install the software. The quickest and easiest way is to install prebuilt binaries using the command "pkg install ". For example, to install the GNAT Programming Studio and all of its dependencies including the GNAT compiler, all you need is one command:

pkg install gps-ide

If a specific package is not available, or the user just prefers to build from source (this can take a long time), then a typical command would be:

cd /usr/ports/devel/gps && make install clean

As with the binary installation, if any dependencies are missing they will be built first, also from source.

Available software as of 8 February 2017

Gentoo GNU/Linux
The GNU Ada compiler can be installed on a Gentoo system using emerge:

emerge dev-lang/gnat

In contrast to Debian, Gentoo is primarily a source distribution, so many packages are available only in source form, and require the user to recompile them (using emerge).

Also in contrast to Debian, Gentoo supports several versions of GNAT in parallel on the same system. Be careful, because not all add-ons and libraries are available with all versions of GNAT.

Mandriva Linux
The GNU Ada compiler can be installed on a Mandriva system with this command:

urpmi gnat

MinGW (for Microsoft Windows)
MinGW &mdash; Minimalist GNU for Windows contains a version of the GNAT compiler.

The current version of MinGW (5.1.6) contains gcc-4.5.0. This includes a fully functional GNAT compiler. If the automatic downloader does not work correctly you can download the compiler directly: pick gcc-4.5.0-1 from MinGW/BaseSystem/GCC/Version4/

old instructions
The following list should help you with the installation. (I may have forgotten something &mdash; but this is wiki, just add to the list)


 * 1) Install MinGW-3.1.0-1.exe
 * 2) extract binutils-2.15.91-20040904-1.tar.gz
 * 3) extract mingw-runtime-3.5.tar.gz
 * 4) extract gcc-core-3.4.2-20040916-1.tar.gz
 * 5) extract gcc-ada-3.4.2-20040916-1.tar.gz
 * 6) extract gcc-g++-3.4.2-20040916-1.tar.gz (Optional)
 * 7) extract gcc-g77-3.4.2-20040916-1.tar.gz (Optional)
 * 8) extract gcc-java-3.4.2-20040916-1.tar.gz (Optional)
 * 9) extract gcc-objc-3.4.2-20040916-1.tar.gz (Optional)
 * 10) extract w32api-3.1.tar.gz
 * 11) Install mingw32-make-3.80.0-3.exe (Optional)
 * 12) Install gdb-5.2.1-1.exe (Optional)
 * 13) Install MSYS-1.0.10.exe (Optional)
 * 14) Install msysDTK-1.0.1.exe (Optional)
 * 15) extract msys-automake-1.8.2.tar.bz2 (Optional)
 * 16) extract msys-autoconf-2.59.tar.bz2 (Optional)
 * 17) extract msys-libtool-1.5.tar.bz2 (Optional)

I have made good experience in using D:\MinGW as target directory for all installations and extractions.

Also noteworthy is that the Windows version for GNAT from Libre is also based on MinGW.

In gcc-3.4.2-release_notes.txt from MinGW site reads: ''please check that the files in the /lib/gcc/mingw32/3.4.2/adainclude and adalib directories are flagged as read-only. This attribute is necessary to prevent them from being deleted when using gnatclean to clean a project.''

So be sure to do this.

OpenCSW (for Solaris on SPARC and x86)
OpenCSW has binary packages of GCC 3.4.6 and 4.6.2 with Ada support. The package names are gcc3ada and gcc4ada respectively.

pkgsrc: NetBSD, DragonFly, FreeBSD and Solaris
The pkgsrc portable package file system has a small Ada framework. It is based on FSF GCC 5.4 currently and the FSF GCC 6.2 is available as well. The AdaCore GPL versions are not present, nor are non-GCC based compilers.

The pkgsrc system is released in quarterly branches, which are normally recommended. However, a user could also choose the "head" which would the very latest package versions. The pkgsrc system supports 21 platforms, but for Ada this is potentially limited to 5 due to the bootstrap compiler requirement: NetBSD, DragonFly, SunOS (Solaris/Illumos), OpenBSD/MirBSD, and FreeBSD.

There are two ways to install the software. The quickest and easiest way is to install prebuilt binaries using the command "pkg_add ". For example, to install the GNAT Programming Studio and all of its dependencies including the GNAT compiler, all you need is one command:

pkg_add gps

If a specific package is not available, or the user just prefers to build from source (this can take a long time), then a typical command would be:

cd /usr/pkg/devel/gps && bmake install

As with the binary installation, if any dependencies are missing they will be built first, also from source.

Available software as of 14 December 2016

SuSE Linux
All versions of SuSE Linux have a GNAT compiler included. SuSE versions 9.2 and higher also contains ASIS, Florist and GLADE libraries. The following two packages are needed:

gnat gnat-runtime

For SuSE version 12.1, the compiler is in the package gcc46-ada libada46

For 64 bit system you will need the 32 bit compatibility packages as well:

gnat-32bit gnat-runtime-32bit

Ubuntu
Ubuntu (and derivatives like Kubuntu, Xubuntu...) is a Debian-based Linux distribution, thus the installation process described above can be used. Graphical package managers like Synaptic or Adept can also be employed to select the Ada packages.

ICC from Irvine Compiler Corporation
Irvine Compiler Corporation provides native and cross compilers for various platforms. The compiler and run-time system support development of certified, safety-critical software.

Commercial, proprietary. No-cost evaluation is possible on request. Royalty-free redistribution of the run-time system is allowed.

Janus/Ada 83 and 95 from RR Software
RR Software offers native compilers for MS-DOS, Microsoft Windows and various Unix and Unix-like systems, and a library for Windows GUI programming called CLAW. There are academic, personal and professional editions, as well as support options.

Janus/Ada 95 supports subset of Ada 2007 and Ada 2012 features.

Commercial but relatively cheap; proprietary.

MAXAda from Concurrent
Concurrent offers MAXAda, an Ada 95 compiler for Linux/Xeon and PowerPC platforms, and Ada bindings to POSIX and X/Motif.

Commercial, proprietary.

ObjectAda from PTC (formerly Aonix/Atego)
PTC offers ObjectAda native (Windows, some flavors of Unix, and Linux) and cross (PPC, Intel, VxWorks, and ERC32) compilers.

Limited support of Ada 2012 is available.

Commercial, proprietary.

PowerAda from OC Systems
OC Systems offers Ada compilers and bindings to POSIX and X-11:
 * PowerAda, an Ada 95 compiler for Linux and AIX,
 * LegacyAda/390, an Ada 83 compiler for IBM System 370 and 390 mainframes

Commercial, proprietary.

ApexAda from PTC (formerly IBM Rational)
PTC ApexAda for native and embedded development.

Commercial, proprietary.

SCORE from DDC-I
DDC-I offers its SCORE cross-compilers for embedded development. SCORE stands for Safety-Critical, Object-oriented, Real-time Embedded.

Commercial, proprietary.

TADS from Tartan
Tartan offers the Tartan Ada Development System (TADS), with cross-compilers for some digital signal processors.

Commercial, proprietary.

XD Ada from DXC
XD Ada is an Ada 83 cross-compiler for embedded development. Hosts include VAX, Alpha and Integrity Servers running OpenVMS. Targets include Motorola 68000 and MIL-STD-1750A processors.

Commercial, proprietary.

XGC Ada from XGC Software
XGC compilers are GCC with custom run-time libraries suitable for avionics and space applications. The run-time kernels are very small and do not support exception propagation (i.e. you can handle an exception only in the subprogram that raised it).

Commercial but some versions are also offered as free downloads. Free Software.