Below is a quick‑start guide to get the Ada compiler (GNAT) up and running on Arch Linux.
Below is a quick‑start guide to get the Ada compiler (GNAT) up and running on Arch Linux. All commands assume you are logged in as a user with `sudo` privileges.
---
The GNAT Community Edition is available directly from the official Arch repositories.
sudo pacman -Syu # Update the system first
sudo pacman -S gnat # Installs the compiler, runtime, and standard libraryAfter the install you should have:
| Tool | Path | Purpose | |------|------|---------| | `gnatmake` | `/usr/bin/gnatmake` | Build Ada programs | | `gnat` | `/usr/bin/gnat` | Compiler driver | | `gnatbind` | `/usr/bin/gnatbind` | Binder | | `gnatlink` | `/usr/bin/gnatlink` | Linker | | `gnatgcc` | `/usr/bin/gnatgcc` | GCC wrapper for Ada |
---
Create a simple “Hello, Ada!” program:
cat <<'EOF' > hello.adb
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
Put_Line ("Hello, Ada!");
end Hello;
EOFCompile and run:
gnatmake hello.adb
./helloYou should see:
Hello, Ada!---
If you want the latest bleeding‑edge version or a specific build, you can use an AUR helper:
# Using yay (replace with your preferred AUR helper)
yay -S gnat-communityThe AUR package usually builds the same binaries as the official repo but may include newer patches.
---
GNAT Pro is a commercial product from AdaCore. To install it:
Example: `gnatpro-2024.1-linux-x86_64.tar.xz`
tar xf gnatpro-2024.1-linux-x86_64.tar.xz
cd gnatpro-2024.1-linux-x86_64
sudo ./install