Ada Programming/Installing
From Wikibooks, the open-content textbooks collection
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.
This list is incomplete. Please extend it as necessary.
[edit] AdaMagic from SofCheck
SofCheck produces 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 offers:
- AdaMagic, an Ada-to-C translator
- AppletMagic, an Ada-to-Java bytecode compiler
Costs money; non-free. See http://www.sofcheck.com.
[edit] AdaMULTI from Green Hills Software
Green Hills Software sells development environments for multiple languages and multiple targets, primarily to embedded software developers.
| Languages supported | Ada 83, Ada 95, C, C++, FORTRAN |
|---|---|
| License for the run-time library | proprietary |
| Native platforms | GNU/Linux on i386, Microsoft Windows on i386, and Solaris on SPARC |
| Cross platforms | INTEGRITY, INTEGRITY-178B and velOSity from Green Hills; VxWorks from Wind River; several bare board targets. Safety-critical GMART and GSTART run-time libraries certified to DO-178B level A. |
| Available from | http://www.ghs.com |
| Add-ons included | IDE, debugger, TimeMachine, integration with various version control systems, source browsers, other utilities |
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 new Ada standard published in 2007 but they do continue to actively market and develop their existing Ada products.
[edit] DEC Ada from HP
DEC Ada is an Ada 83 compiler for OpenVMS. While “DEC Ada” is probably the name most users know, the compiler is now called “HP Ada”. It had previously been known also by names of "VAX Ada" and "Compaq Ada".
[edit] 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 from.
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.
[edit] GNAT GPL Edition
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.
| Languages supported | Ada 83, Ada 95, Ada 2005, C |
|---|---|
| License for the run-time library | pure GPL |
| Native platforms | GNU/Linux on i386, Microsoft Windows on i386, and Darwin (Mac OS X) on PowerPC |
| Cross platforms | none. |
| Compiler back-end | GCC 4.1.1 |
| Available from | http://libre.adacore.com (requires free registration). |
| Add-ons included | GDB, GPS, GtkAda in source and binary form; many more in source-only form. |
[edit] 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.
[edit] 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).
| Languages supported | Ada 83, Ada 95, C |
|---|---|
| License for the run-time library | GNAT-modified GPL |
| Native platforms | GNU/Linux on i386 (with glibc 2.1 or later), Microsoft Windows on i386, OS/2 2.0 or later on i386, Solaris 2.5 or later on SPARC |
| Cross platforms | none. |
| Compiler back-end | GCC 2.8.1 |
| Available from | ftp://ftp.cs.kuleuven.ac.be/pub/Ada-Belgium/mirrors/gnu-ada/3.15p/ |
| Add-ons included | ASIS, Florist, GLADE, GDB, Gnatwin (on Windows only), GtkAda 1.2, GVD |
[edit] 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.
| Languages supported | Ada 83, Ada 95, Ada 2005, C, and optionally C++ |
|---|---|
| License for the run-time library | GNAT-modified GPL |
| Native platforms | many, see http://www.adacore.com/home/gnatpro/configurations |
| Cross platforms | many, see http://www.adacore.com/home/gnatpro/configurations; even more on request |
| Compiler back-end | GCC 4.1.1 |
| Available from | http://www.adacore.com by subscription (costs money) |
| Add-ons included | ASIS, Florist, GDB, GLADE, GPS, GtkAda, XML/Ada, and many more in source and, on request, binary form. |
[edit] GCC
GNAT has been part of GCC since October 2001, and GCC uses the GNAT Modified General Public License for the Ada run-time library. The Free Software Foundation does not distribute binaries, only sources.
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 have gradually added support for Ada 2005 as the language standard was finalised.
As of GCC 4.3, released on 2008-03-05:
| Languages supported | Ada 83, Ada 95, Ada 2005, C, C++, Fortran 95, Java, Objective-C, Objective-C++ |
|---|---|
| License for the run-time library | GNAT-modified GPL |
| Native platforms | none (source only) |
| Cross platforms | none (source only) |
| Compiler back-end | GCC 4.3 |
| Available from | http://gcc.gnu.org in source only form. |
| Add-ons included | none. |
[edit] 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. For GNU/Linux users, there are instructions for building your own GNAT compiler at: http://ada.krischik.com/index.php/Articles/CompileGNAT
Both GPL and GMGPL versions of GNAT are available.
| Languages supported | Ada 83, Ada 95, Ada 2005, C. (Some distributions also support Fortran 90, Java, Objective C and Objective C++) |
|---|---|
| License for the run-time library | pure or GNAT-modified GPL |
| Native platforms | Fedora Core 4 and 5, MS-DOS, OS/2, Solaris 10, SuSE 10 (more?) |
| Cross platforms | none. |
| Compiler back-end | GCC 2.8.1, 3.4, 4.0, 4.1 (various binary packages) |
| Available from | http://gnuada.sourceforge.net |
| Add-ons included | AdaBrowse, ASIS, Booch Components, Charles, GPS, GtkAda (more?) |
[edit] 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.
| Languages supported | Ada 83, Ada 95, Ada 2005, C (more?) |
|---|---|
| License for the run-time library | GNAT-Modified GPL |
| Native platforms | GNU/Linux on i386 |
| Cross platforms | Various AVR microcontrollers |
| Compiler back-end | GCC 3.4 (4.1 in progress) |
| Available from | http://avr-ada.sourceforge.net |
| Add-ons included | none |
[edit] 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.)
[edit] AIDE (for Microsoft Windows)
AIDE - 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. AIDE is intended for beginners and teachers, but can also be used by advanced users.
| Languages supported | Ada 83, Ada 95, C |
|---|---|
| License for the run-time library | GNAT-modified GPL |
| Native platforms | Microsoft Windows on i386 |
| Cross platforms | none. |
| Compiler back-end | GCC 2.8.1 |
| Available from | http://rochebruneadsl.free.fr/stephane/aide/ |
| Add-ons included | ASIS, GDB, GPS, GtkAda (more?) |
[edit] Blastwave (for Solaris on SPARC and x86)
Blastwave has binary packages of GCC 3.4.5 and 4.0.2 with Ada support. The package names are gcc3ada and gcc4ada respectively.
| Languages supported | Ada 83, Ada 95, parts of Ada 2005, C, C++, Fortran 95, Java, Objective-C, Objective-C++ |
|---|---|
| License for the run-time library | GNAT-modified GPL |
| Native platforms | Solaris and OpenSolaris on SPARC |
| Cross platforms | none. |
| Compiler back-end | GCC 3.4.5 and 4.0.2 (both available) |
| Available from | http://www.blastwave.org |
| Add-ons included | none (?) |
[edit] Cygwin (for Microsoft Windows)
Cygwin, the Linux-like environment for Windows, also contains a version 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).
[edit] Debian (GNU/Linux and GNU/kFreeBSD)
There is a Debian Policy for Ada (mirror), which tries to make Debian the best Ada development and deployment platform. The development platform includes the compiler and many libraries, prepackaged 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:
apt-get 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: libgnatvsn (licensed under GNAT-Modified GPL) and libgnatprj (the project manager, licensed under pure GPL). Debian packages make use of these libraries.
| 3.1 Sarge | 4.0 Etch | 5.0 Lenny | |
|---|---|---|---|
| Release date | June 2005 | April 2007 | September 2008? |
| Languages supported | Ada 83, Ada 95, C | Ada 83, Ada 95, parts of Ada 2005, C, C++, Fortran 95, Java, Objective-C, Objective-C++ | |
| License for the run-time library | GNAT-modified GPL (both ZCX and SJLJ versions starting from 5.0 Lenny) | ||
| Native platforms: | 3.1 Sarge | 4.0 Etch | 5.0 Lenny |
| kfreebsd-i386 | yes | yes | |
| alpha | yes | yes | |
| amd64 | yes | yes | |
| hppa | yes | yes | |
| i386 | yes | yes | yes |
| ia64 | yes | yes | |
| mips | yes | yes | |
| mipsel | yes | yes | |
| powerpc | yes | yes | yes |
| ppc64 | yes | ||
| s390 | yes | yes | |
| sparc | yes | yes | yes |
| Cross platforms | none | ||
| Compiler back-end | GCC 2.8.1 | GCC 4.1 | GCC 4.3 |
| Available from | http://www.debian.org | ||
| Add-ons included | 3.1 Sarge | 4.0 Etch | 5.0 Lenny |
| AdaBindX | 0.7.2 | ||
| AdaBrowse | 4.0.2 | 4.0.2 | 4.0.2 |
| AdaCGI | 1.6 | 1.6 | 1.6 |
| AdaControl | 1.6r8 | 1.8r4 | |
| AdaSockets | 1.8.4.7 | 1.8.4.7 | 1.8.4.7 |
| ASIS | 3.15p | 2005 | 2007 |
| AUnit | 1.01 | 1.03 | 2.0 |
| AWS | 2.0 | 2.2 | 2.3 |
| Charles | 2005-02-17 | ||
| Florist | 3.15p | 2006 | 2007 |
| GDB | 5.3 | 6.4 | 6.4 |
| GLADE | 3.15p | 2006 | 2007 |
| GNADE | 1.5.1 | 1.6.1 | 1.6.1 |
| GNAT Checker | 1999-05-19 | ||
| GPS | 2.1 | 4.0 | 4.2 |
| GtkAda | 2.4 | 2.8.1 | 2.10 |
| OpenToken | 3.0b | 3.0b | 3.0b |
| TextTools | 2.0.3 | 2.0.3 | 2.0.5 |
| XML/Ada | 1.0 | 2.2 | 3.0 |
The ADT plugin for Eclipse (see #ObjectAda_from_Aonix) can be used with GNAT as packaged for Debian Etch. Specify "/usr" as the toolchain path.
[edit] 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.
[edit] FreeBSD
FreeBSD's ports collection contains GNAT GPL 2005 Edition (package gnat-2005).
| Languages supported | Ada 83, Ada 95, parts of Ada 2005, C |
|---|---|
| License for the run-time library | pure GPL |
| Native platforms | FreeBSD on i386 (more?) |
| Cross platforms | none. |
| Compiler back-end | GCC 3.4.6 |
| Available from | http://www.freebsd.org |
| Add-ons included | none? |
[edit] 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.
| Languages supported | Ada 83, Ada 95, Ada 2005, C (more?) |
|---|---|
| License for the run-time library | pure or GNAT-modified GPL (both available) |
| Native platforms | Gentoo GNU/Linux on amd64, powerpc and i386 |
| Cross platforms | none. |
| Compiler back-end | GCC 3.4, 4.1 (various binary packages) |
| Available from | http://www.gentoo.org |
| Add-ons included | AdaBindX, AdaBroker, AdaDoc, AdaOpenGL, AdaSockets, ASIS, AUnit, Booch Components, CBind, Charles, Florist, GLADE, GPS, GtkAda, XML/Ada |
[edit] GNAT for Macintosh (for Mac OS 9 and X)
GNAT for Macintosh provides a version of GNAT with Xcode integration and bindings.
[edit] Mandriva Linux
The GNU Ada compiler can be installed on a Mandriva system with this command:
urpmi gnat
[edit] MinGW (for Microsoft Windows)
MinGW - Minimalist GNU for Windows contains a version of the GNAT Compiler.
The following list should help you install. {I may have forgotten something - but this is wiki, just add to the list}
- Install MinGW-3.1.0-1.exe.
- extract binutils-2.15.91-20040904-1.tar.gz.
- extract mingw-runtime-3.5.tar.gz.
- extract gcc-core-3.4.2-20040916-1.tar.gz.
- extract gcc-ada-3.4.2-20040916-1.tar.gz.
- extract gcc-g++-3.4.2-20040916-1.tar.gz (Optional).
- extract gcc-g77-3.4.2-20040916-1.tar.gz (Optional).
- extract gcc-java-3.4.2-20040916-1.tar.gz (Optional).
- extract gcc-objc-3.4.2-20040916-1.tar.gz (Optional).
- extract w32api-3.1.tar.gz.
- Install mingw32-make-3.80.0-3.exe (Optional).
- Install gdb-5.2.1-1.exe (Optional).
- Install MSYS-1.0.10.exe (Optional).
- Install msysDTK-1.0.1.exe (Optional).
- extract msys-automake-1.8.2.tar.bz2 (Optional).
- extract msys-autoconf-2.59.tar.bz2 (Optional).
- 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 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.
[edit] 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 64 bit system you will need the 32 bit compatibility packages as well:
gnat-32bit gnat-runtime-32bit
[edit] ICC from Irvine Compiler Corporation
Irvine Compiler Corporation provide native and cross compilers for various platforms. The compiler and run-time system support development of certified, safety-critical software.
Costs money, but no-cost evaluation is possible on request. Royalty-free redistribution of the run-time system is allowed. Non-free. See http://www.irvine.com
[edit] 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. Cost money but relatively cheap; non-free.
[edit] ObjectAda from Aonix
Aonix offers native and cross compilers for various platforms, that cost money and are non-free. They come with an IDE, a debugger and a plug-in for Eclipse.
On Microsoft Windows and GNU/Linux on i386, Aonix offers two pricing models, at the customer's option: either a perpetual license fee with optional support, or just the yearly support fee: For Linux, that's $3000 for a single user or $12,000 for a 5-user service pack. See the full press release.
In addition, they offer "ObjectAda Special Edition": a no-cost evaluation version of ObjectAda that limits the size of programs that can be compiled with it, but is otherwise fully functional, with IDE and debugger. Free registration required; see http://www.aonix.com/oa_evaluation_request.html.
A recent contribution by Aonix is ADT for Eclipse. The Ada Development Tools add Ada language support to the Eclipse open source development platform. ADT can be used with Aonix compilers, and with GNAT. An open source vendor supported project is outlined for ADT at Eclipse. Codenamed Hibachi and showcased at the Ada Conference UK 2007 and during Ada-Europe 2007, the project has now been officially created.
[edit] Power Ada from OC Systems
See http://www.ocsystems.com/prod_powerada.html
[edit] Rational Apex from IBM Rational
Native and cross compilers, cost money, non-free. See http://www-306.ibm.com/software/awdtools/developer/ada/index.html
[edit] SCORE from DDC-I
Cross-compilers for embedded development, cost money, non-free. SCORE stands for Safety-Critical, Object-oriented, Real-time Embedded. See http://www.ddci.com.
[edit] XD Ada from SWEP-EDS
Cross-compilers for embedded development, cost money, non-free. Hosts include Alpha and VAX machines running OpenVMS. Targets include Motorola 68000 and MIL-STD-1750A processors. Ada 83 only. See http://www.swep-eds.com/XD%20Ada/Xd%20ada.htm
[edit] 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). Cost money, but some versions are also offered as free downloads. Free Software.
| Languages supported | Ada 83, Ada 95, C |
|---|---|
| License for the run-time library | ? |
| Native platforms | none. |
| Cross platforms | Hosts: sun-sparc-solaris, pc-linux2.*; targets are bare boards with ERC32, MIL-STD-1750A, Motorola 68000 family or Intel 32-bit processors. PowerPC and Intel 80186 targets on request. |
| Compiler back-end | GCC 4.1? |
| Available from | http://www.xgc.com/ |
| Add-ons included | Ravenscar-compliant run-time kernels, certified for avionics and space applications. |

