August 9, 2020

[Note] Ada on Ubuntu 20

Installing Ada


Apt has two packages.  GNAT-GPS (IDE) didn't work properly for me:
  • gnat-gps - integrated development environment for C and Ada
  • gnat - GNU Ada compiler

Get this file from here and install instead -- it will install everything in one directory:
https://www.adacore.com/community


Compiling in console

$ vi helloworld.adb

with Ada.Text_IO;
procedure Hello is
begin
    Ada.Text_IO.Put_Line("Hello, world!");
end Hello;

$ gnatmake helloworld.adb
$ ll
total 52
drwxrwxr-x 2 kkim kkim  4096 Aug  8 20:02 ./
drwxrwxr-x 4 kkim kkim  4096 Aug  8 20:00 ../
-rwxrwxr-x 1 kkim kkim 30000 Aug  8 20:01 helloworld*
-rw-rw-r-- 1 kkim kkim   211 Aug  8 20:02 helloworld.adb
-rw-rw-r-- 1 kkim kkim  1662 Aug  8 20:01 helloworld.ali
-rw-rw-r-- 1 kkim kkim  1640 Aug  8 20:01 helloworld.o
$ ./helloworld
Hello, world!


 
Tutoria, misc
 

Open Source Ada projects

No comments: