How to Install GNAT Community Edition on Ubuntu

GNAT is a compiler for the Ada programming language for Linux and Windows. It supports Ada 2012 and above, spark and C. It comes with Tool Chain, GNAT Studio, SPARK Discovery, GNATemulator, Ada Web Server, Libadalang, GNATpp, GNATdoc, GNATprep, GNATmetric and GtkAda.

GNAT Studio

Download GNAT Community Edition

Install GNAT Community Edition

Download the latest x86 GNU Linux installer from the above GNAT Community Edition download link and save it on your Downloads folder. Now open the terminal app (ctrl+alt+t) and run below commands one by one.

Here “gnat-2021-20210519-x86_64-linux-bin” is the downloaded file name. You can change below commands based on your file name.

cd Downloads
sudo chmod +x ~ gnat-2021-20210519-x86_64-linux-bin
./gnat-2021-20210519-x86_64-linux-bin

It will start the GNAT Community Edition installer. Follow the instructions and complete the installation.

GNAT Community Edition installer

GNAT Community Edition installation

By default, it will install in /Home/opt/GNAT directory under your username. Now go to the /opt/GNAT/2021/bin/ directory and find gnatstudio program file. GNAT Studio is a powerful IDE for Ada and SPARK.

Also Read:  ZQuest Classic Game Engine

GNAT Community Edition path

Right click on the gnatstudio file and select Run as a Program. It will automatically add itself to the PATH – it will also find the cross compiler, if you have installed everything in the default locations. Now start your Ada programming.

Extras:

How to flash boards using the pyocd in GNAT Studio:

To flash boards using the pyocd in GNAT Studio, you might need privileges to access the USB ports. To do it by creating (as administrator) the file /etc/udev/rules.d/mbed.rules and add the line

SUBSYSTEM=="usb",MODE:="666"

then restarting the service by doing

sudo udevadm control --reload
sudo udevadm trigger
If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.



Leave a Reply