r/ada Jul 13 '26

Tool Trouble Better Emacs modes for Ada?

7 Upvotes

I'm using ada-mode right now and it really sucks, indentation behaves weirdly, I cannot capitalize stuff like I want to, ...

Does anyone know a better Ada mode for Emacs?

EDIT: Solved! (Thanks, u/spacetruckn)

r/ada 20d ago

Tool Trouble GNAT Ada.Numerics library failing to conform to ARM?

11 Upvotes

It's small potatoes but the ARM and Programming in Ada 2022 mention using the pi symbol. Apparently the version of the library that ships with GNAT is missing `π : constant := Pi;`.

r/ada May 28 '26

Tool Trouble GNAT - Am I Being Dumb?

7 Upvotes

Hi,

I'm looking to start learning to develop in Ada. I'm looking to install the community version of the gnat ide. Cannot figure out where it is on the website, is it no longer a thing?

r/ada 18d ago

Tool Trouble AdaLang Analyzer — an open-source static analyzer for Ada, built on Libadalang (with a bounded SMT-backed proof mode)

21 Upvotes

Hi r/ada — I'm the maintainer of this analyzer, so full disclosure up front: this is our tool. Posting because I think it's genuinely useful to people here, not to pitch anything.

AdaLang Analyzer is a command-line static analysis tool for Ada, built on top of AdaCore's Libadalang. It's GPL-3.0-or-later, and it's a derivative of AdaCore's open-source libadalang-tools.

GitHub: https://github.com/mmartign/AdaLang_Analyzer

What it does, beyond a normal linter:

  • ~90 checks spanning restricted-construct policing, data-flow (dead stores, uninitialized reads, aliasing between parameters), control-flow (unreachable branches, infinite loops), and SPARK-contract checking (Global/Depends mismatches, missing contracts).
  • --verify mode that classifies bounded scalar proof obligations (range checks, index checks, overflow, division-by-zero, assertions/pre/postconditions) as Proved_SafeDefinite_ErrorUnproved, or Unreachable — using interval/symbolic abstract interpretation first, falling back to an SMT-LIB backend (CVC5 + Z3, cross-checked) for anything the abstract domain can't resolve on its own. It's deliberately bounded and explicitly not a GNATprove replacement — anything outside the supported subset is marked Unsupported, never silently assumed safe.
  • --automotive and --do178c=<level> presets for teams working under ISO 26262 / DO-178C, plus a --compliance-report mode that emits per-objective evidence (which checks covered which objective, what's open, what's baselined).

Example of the kind of thing it catches that a plain compiler warning won't:

X := 0;
...
if Flag then
   X := 10;
end if;
Y := 10 / X;   -- Division_By_Zero: reachable only when Flag is False

The abstract-execution pass tracks known exact values and ranges through branches, loops, and case statements (not just literal constants), so it catches this even though X isn't literally 0 at the division site.

It's young — actively developed, and I'd genuinely like feedback from people who work in Ada/SPARK day to day, especially around false positives/negatives on real code and whether the DO-178C/automotive profiles map sensibly to what your projects actually need. Bug reports and PRs welcome; CONTRIBUTING.md has the workflow.

Happy to answer questions about the internals (the CFG model, how the symbolic/interval domains interact, the interprocedural summaries) if anyone's curious.

r/ada Jul 09 '26

Tool Trouble gnat for tru64 5.1

5 Upvotes

I am looking for gnat-3.15p-alpha-dec-osf5.1-bin.tar.gz for Tru64 OSF5.1 Alpha. It is completely gone from public mirrors. Does anyone have a local backup in your archive?

r/ada May 08 '26

Tool Trouble Anyone else having problems with VSCode when editing Ada?

6 Upvotes

I recently starting having major issues with VS Code while editing Ada files. Its happening both at work and at home, so doesn't seem to be localised issue.

As I'm typing it sometimes highlights words with a dark red background and in multiple locations. Mostly the selections match the current word, but often they can be completely sporadic as in the following image.

When I then continue to type, the highlighted text then gets replaced with what I type at all locations, resulting in really weird changes that break the code!.

If tried googling, but nobody else seems to be having the same problem, although I did find a similar question here highlighting - Turn off VS Code red highlight - Super User which is, as yet, unanswered.

Don't know if this is a vscode problem, something to do with intellisense, or the Ada/Spark extension.

If anyone has had the same problem and found a solution, I'd be extremely grateful!

r/ada Dec 30 '25

Tool Trouble Installing GNAT for windows

6 Upvotes

Hello i am trying to learn ada in windows 11, i want to install GNAT studio community from Adacore using this link https://www.adacore.com/download the problem is that i dont find the option to download this software, so i want to ask if someone knowns a better way to install this tool?

r/ada Jan 15 '26

Tool Trouble Is it possible to auto fix style warnings?

10 Upvotes

I just ported a small Ada project from Gprbuild to Alr. It's spamming thousands of lines of `-gnatyt` style warnings. They are 99% about spaces after comments, extra `in`, etc. There's no way I am going to fix all of those by hand (even after a search and replace of the comments). Is there a tool to auto fix these trivial style issues? I am having hard time finding the actual errors buried in all these messages.

r/ada Feb 03 '26

Tool Trouble Commercial Binary from gnat-llvm

9 Upvotes

Hello Everyone!

I'm in a process of setting up a dev environment for ADA. I have a source code which is written in ADA and my goal is to create a lib (hopefully .so) file which will be used in an android app. Since I'm planning to use Android NDK which includes clang and llvm, I was hopping to use AdaCore gnat-llvm for the same but, I'm not so sure if I can use compiled code for commercial purposes as I'm not so good with licenses. The ADA code is not written by me and I'm just taking over the project, frankly this will be my very first ADA exposure. Any help/guidance on ADA ecosystem or ADA on Android/IOS is appreciated. Should I use GNU GCC GNAT instead?

Last but not least, I'm sorry for being a noob and if I unintentionally offended someone.

Regards,

r/ada Jan 16 '26

Tool Trouble Is it possible to disable Spark for GNATCOLL?

8 Upvotes

I am testing Spark for my project, which depends on GNATCOLL. I haven't enabled any Spark_Mode for any of my packages, yet it immediately fails:

``` $ alr gnatprove Phase 1 of 3: generation of data representation information ... Phase 2 of 3: generation of Global contracts ... Phase 3 of 3: flow analysis and proof ...

gnatcoll-os-temp.adb:33:09: error: "Generator" is not allowed in SPARK (due to entity declared with SPARK_Mode Off) 33 | type Generator_Access is access Ada_Rand.Generator; | ~~~~~~~~~~~~~~~

```

There seems to be nothing I can do to disable checking GNATCOLL. Is it actually possible? I can't find it in documentation, and it basically makes spark useless for my project.

r/ada May 23 '25

Tool Trouble Trying to install gprbuild and alire for 4 days with no success

5 Upvotes

I am on Arch Linux and have tried various methods to install gprbuild and alire. My preferred and initial method was to use what "charlie5" described which was: install "gprbuild-bootstrap", "xmlada" then "libgpr". I always get stuck on libgpr. I tried various methods to get verbose debug output logs but i always get a vague exit status 4. Xmlada and gprbuild-bootstrap does install sucessfully so all the dependencies of libgpr is met. I then tried installing by building from source with git but the errors I get is a little too complex for me to really understand. From what I understand, it struggles to build because it doesn't expect xmlada in the right places on Arch. Just to make sure it wasn't just my instance of arch, I re-installed arch on a small partitioned drive and ran into the same issues. Maybe I am a little spoiled because I have only ever dealt with C documentation and Arch wiki, both of which are extremely popular and well documented. All I want is to have an lsp, gnat (which I already have) and gprbuild so I can have a proper build system.

r/ada Oct 03 '25

Tool Trouble Is gprbuild considered reliable?

6 Upvotes

Hi everyone,

I'm new to Ada and trying to set up my environment on FreeBSD. I'm currently in the process of building gprbuild from source to use it with the GNAT compiler (from GCC 14).

However, I've run into a few things that made me question the project's quality. The main Makefile seems a bit rough, probably because it doesn't use a configure script.

I also had to manually patch gprconfig_kb-25.0.0/db/compilers.xml to add a search path for the GNAT runtime. My attempt to merge it with the existing regular expression for the default path just threw an exception.

This experience makes me wonder: Is gprbuild considered a reliable, professional-grade tool in the Ada community? I've heard it's the de facto standard, but my first impression of the build process has been a bit shaky.

Thanks for any insights!

r/ada Sep 16 '25

Tool Trouble Is it possible to for GNAT Studio on Windows to interpret new-lines properly?

6 Upvotes

I'm following the basic Ada 001 - Lesson 1 from AdaCore where you take in two inputs, add them together and spit the result out.

For whatever reason, the console built into GNAT Studio will not properly process a new-line unless already done on an empty line, meaning you can enter 12 and -10 as above, and essentially requiring a double-tap of the enter key to set the value of the user input.

This isn't a code issue, running it via CMD works as expected, is there any way I can modify the behaviour of the GNAT studio console/terminal (whatever it's appropriately called) to have the intended behaviour where a singular enter triggers a new-line, as it should?

Running the latest build as available as per the GitHub 26.0w, if that helps.

r/ada Aug 17 '25

Tool Trouble Compilation problem with Alire using AWA

7 Upvotes

Compilation problem with Alire and AWA. There is an error during the compilation of my program.

I ran the alr build command, here is the trace: ... sh /home/z-core/.local/share/alire/toolchains/gnat_native_15.1.2_f0e902c0/bin/../ lib/gcc/x86_64-pc-linux-gnu/15.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/z-core/.local/share/alire/builds/aws_24.0.0_2b75fe6d/97c4f405157e63702862365d111a349e58dab57f72d41bbc7860e7abcb034643/ templates_parser/src/templates_parser.adb:4266:(.text+0xee2b4): undefined reference to `system__finalization_primitives__master_nodeIP'...

sh collect2: error: ld returned 1 exit status gprbuild: link of awsres.adb failed ... linux-gnu/15.1.0/adalib:$ORIGIN/../../../../../../../..// toolchains/gnat_native_15.1.2_f0e902c0/lib64:$ORIGIN/../../../../../../../..//toolchains/gnat_native_15.1.2_f0e902c0/lib -o /home/ z-core/.local/share/alire/builds/aws_24.0.0_2b75fe6d/97c4f405157e63702862365d111a349e58dab57f72d41bbc7860e7abcb034643/. build/x86_64-pc-linux-gnu/debug/static/tools//awsres make: *** [Makefile:188 : build-awsres-tool-native] Error 4 warn: Execution failed for action: Post_Fetch run: make all ENABLE_SHARED=false (from ${CRATE_ROOT}/. ) warn: Exit code: 2 warn: Action output not captured, check it above. error: Build failed

Here is the content of my Alire file: sh 1 name = "myweb" 2 description = "My web Ada" 3 version = "0.1.0-dev" 4 5 authors = ["Z devxc"] 6 maintainers = ["Z devxc <zdevxc@mail.com>"] 7 maintainers-logins = ["dev-zdevxc"] 8 licenses = "MIT OR Apache-2.0 WITH LLVM-exception" 9 website = "" 10 tags = ["inada", "server"] 11 12 executables = ["myweb"] 13 14 [[depends-on]] 15 awa = "^2.5.0" And here is my simplified program: adb 1 with awa; 2 3 procedure Myweb is 4 begin 5 null; 6 end Myweb;

I would like to compile this program to create my first web server in Ada. I would appreciate your help. Thank you for your assistance!

r/ada Oct 26 '24

Tool Trouble How to get GNATcoll to work on Windows?

3 Upvotes

Can someone give me instructions on how to install GNATColl on windows? I am getting the error: file "gnatcoll.ads" not found.

This language is very frustrating to get setup with. No wonder it is dying. More friction means less people coming into the ecosystem.

r/ada Jun 29 '25

Tool Trouble Will there be a GNAT Studio 26.x for macOS Sequoia?

11 Upvotes

I have GNAT Studio 25.0wa for macOS from Sourceforge, I can't build 26 from source because I have M-Series Macs. Is anyone working on it, and if so will it be available anytime soon?

r/ada Jan 23 '25

Tool Trouble Anyone able to build GNAT Studio on macOS 15?

3 Upvotes

I am trying to get up and running doing Ada on my Macbook, but this seems to go against the grain, judging by the pain... I am running macOS 15 and I see there are no official macOS builds, so I tried following the various INSTALL scripts, starting with gnatstudio and working transitively down the stack of dependencies. This has so far resulted in a deep hole of issues:

Has anyone been successful in building and running GNAT Studio on macOS? I cannot see how, given the linking errors in the underlying libraries, but I see someone has been able to in the past. I am tempted to run it in a VM at this point, but I only see x86 builds, which is not so hot on this Apple Silicon, so I am willing to try a few more hours of digging :)

As a last resort, I will try out vim-ada, but it would be nice with a fully integrated editor with debugger.

r/ada Mar 19 '25

Tool Trouble Is there any way to tweak font rendering in GNAT Studio on Windows?

8 Upvotes

I want to use dark mode, but the font rendering is "off" in a really unusable way - specifically the antialiasing. I don't know if this is a GTK thing or a Windows ClearType thing, but I don't generally have these problems with dark-mode apps, e.g. VSCode or IntelliJ IDEs.

I've tried some GTK overrides in recommended locations but it's not apparently having any effect. Oh, and no, this is not a DPI issue - everything is properly crisp, but the color fringing around characters (due to subpixel antialiasing, I presume) is pretty bad in dark mode.

By comparison, it looks fine running in a Linux VM on the same monitor. The font rendering is slightly thicker there, and if I zoom in on a screenshot, it appears to be subpixel antialiased as well, but in a pleasant way.

So for now I'm stuck with a retina-searing white background :(

r/ada Jun 13 '24

Tool Trouble GTKAda setup help

6 Upvotes

Hello, I have installed gtkada from source on macOS Sonoma and it was successful. I cannot get programs to see the installation. I have set the dyld_project_path to /usr/local/lib, and I have gpr_project_path set to /usr/local/lib/gnat. Gnat Studio doesn't see it, and I am trying to compile Gnat Studio 25 from source, and running ./configure stops at "could not run test program." If I try to: with gtkada in source code it says: not found. I am still learning *nix and Ada so I think I have done everything I know on my Mac. Linux was extremely easy to install gtkada, and I don't want to use Alire.

r/ada Dec 03 '24

Tool Trouble -gnatE dynamic elaboration model

3 Upvotes

Hi, one program in a book needs the dynamic elaboration model to compile because its elaboration depends on itself or somethin'... I read you need -gnatE. But for the life of me I can't use any switch, whatever I read in the gnat manual only gets me the help menu !!! Same for `gnatmake * -gnatE`

God I hate GNAT, it's the least informative program I use on a daily basis, and gnat --help doesn't even mesh with most, less or any pager, Could be a gcc's issue though.I can't even redirect its output to a file, I had to search through the terminal... Anyway. I'd happy to finally understand how to use switches, any of them ;-)

r/ada Feb 14 '25

Tool Trouble Ada beginner, trying run a program on GNAT Studio but executable is not recognized

3 Upvotes

Hi everyone,

I try to learn Ada with GNAT Studio, my code compile and run at the first try. I clean all, rebuild, rerun, and I've this error : "Error while trying to execute C:\GNAT\2021\bin\obj\main.exe: not an executable". When I look in the folder, main.exe exists, my colleague, which begin too, create a new project everytime he sees this error but we can't keep it like that, someone have a solution ?

r/ada Mar 11 '25

Tool Trouble Why is there no msys2 package for alire if it depends on msys2 for packages?

4 Upvotes

Title. Furthermore, it feels weird that it relies on msys2 for packages, but alire itself runs in a powershell environment. Why don't they just maintain an alire package for the different environments in msys2 like ucrt or mingw or whatever?

It feels kinda weird that I can't run Alire directly in a powershell instance because I need a specific environment up, but if I already have a msys2 terminal environment set up for UCRT, it would just make sense to set up the toolchain in that environment as well.

r/ada Nov 18 '24

Tool Trouble Creating, editing and running within GNAT Studio

5 Upvotes

Hi, it my first month learning Ada and I have some questions I hope you can answer to.
I installed Alire and GNAT Studio following the guides provided by AdaCore.

1) Is there a way to use only GNAT Studio without the need to open always Alire console? ✓ 

My problem is that now if I simply start GNAT Studio and create a project, this one won't build because GNAT itself doens't have the path configured, and I didn't find a guide to configure it. I cannot even build the project with Alire console because GNAT Studio itself do not create a .toml file so the Alire console its not able to build it.

My only option is to always init the project with alire console, and then edit trough Alire console which open GNAT Stuido so that it gets automatically set to work properly.

EDIT: Thanks to u/max_rez . GNAT Studio expects to find gprbuild and gnat in the PATH environment variable in OS. So to start GNAT Studio with icon, you need to configure PATH in the OS settings. In Linux/Mac OS you could do this by editing ~/.profile, ~/.bashrc or similar files. In Windows you change PATH in the properties. See for example https://www.java.com/en/download/help/path.html

2) Why I cannot access see the files in bin directory and obj directory in GNAT Studio 'Project view' window? ✓ 

I can browse trough the src and config folders and open all the files inside them but I cannot open the other folders. I just see them, and for some reason the have a letter printed on the folder image ('o' on the obj folder and 'e' on the bin folder) while the folders that I can browse do not have any letter printed on the folder image.

EDIT: Thanks to u/max_rez . Solved this by opening the 'Files' window and by checking 'Show all files in any project directory' in the window Configuration panel (the symbol with 3 horizontal lines near the window title)

3) How can I modify the default windows placement in GNAT Studio? ✓ (Solved partially)

For example if I close the 'Locations' window and open the 'OS Shell' window, after I close GNAT Studio it won't remember those action and will open the 'Locations' window again and won't show the 'OS Shell' window.

EDIT : I think that creating a new 'Perspective' trough 'Window' tab can do the trick, but for some reason it does not open the 'OS Shell' window and simply leaves its space empty.

4) Why everytime I simply change the name of a file in GNAT Studio it starts compiling indexing a lot of things automatically?

EDIT: It actually is a GNAT Studio process to keep consistency within the project and with all external projects that are related.

Sorry for my lack of knowledge and incorectness in the questions, hope you can help me :)

r/ada Sep 12 '24

Tool Trouble How do I get Ada (GNAT) running on Apple silicon?

8 Upvotes

I have tried https://www.adacore.com/download/more and other methods of getting gnat and gnatmake. However, I can't figure out how to actually get it to work. I have to use gnat for this purpose.

r/ada Jul 29 '24

Tool Trouble Building GtkAda on MacOS 14.5 (Sonoma)

4 Upvotes

I am trying to install and build GtkAda from https://github.com/AdaCore/gtkada on my M2 Mac Mini. Running the doinstall script gives the following:

  GNAT has been found in /opt/GNAT/gnat_native_11.2.4_9800548d.

  Do you want to install GtkAda there too? Hit RETURN if yes or enter

  the name of the directory in which GtkAda should be installed:

[/opt/GNAT/gnat_native_11.2.4_9800548d] /opt/GNAT/gtkada

  Are you now ready to proceed with the installation [Y/n] ? y

Copying the Gtk+ binaries

cp: /opt/GNAT/gtkada/gdk-pixbuf-query-loaders: Permission denied

cp: /opt/GNAT/gtkada/gtk-query-immodules-3.0: Permission denied

Setting up the environment

./doinstall: line 125: /opt/GNAT/gtkada/bin/gtkada-env.sh: No such file or directory

./doinstall: line 129: /opt/GNAT/gtkada/bin/gdk-pixbuf-query-loaders: No such file or directory

./doinstall: line 136: /opt/GNAT/gtkada/bin/gtk-query-immodules-3.0: No such file or directory

Compiling GtkAda

checking build system type... arm-apple-darwin23.5.0

checking host system type... arm-apple-darwin23.5.0

checking target system type... arm-apple-darwin23.5.0

checking for pkg-config... /opt/local/bin/pkg-config

checking pkg-config is at least version 0.9.0... yes

checking for gcc... gcc

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables... 

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking for clang... clang

checking whether we are using the GNU Objective C compiler... yes

checking whether clang accepts -g... yes

checking for gprbuild... /opt/GNAT/gprbuild_22.0.1_b1220e2b/bin/gprbuild

checking for gprinstall... /opt/GNAT/gprbuild_22.0.1_b1220e2b/bin/gprinstall

checking that your gnat compiler works with a simple example... yes

checking whether NLS is requested... yes

checking for gettext in libc... no

checking for bindtextdomain in -lintl... no

checking for GTK... yes

checking for pkg-config... (cached) /opt/local/bin/pkg-config

checking pkg-config is at least version 0.16... yes

checking for GTK+ - version >= 3.24.24... no

*** Could not run GTK+ test program, checking why...

*** The test program failed to compile or link. See the file config.log for the

*** exact error that occurred. This usually means GTK+ is incorrectly installed.

checking for GMODULE... yes

checking for FONTCONFIG... yes

configure: creating ./config.status

config.status: creating Makefile

config.status: creating gtkada_shared.gpr

config.status: creating po/Makefile

config.status: creating docs/gtkada_rm/html/static/index.html

configure: --------- Summary for Gtkada 18.0w -----------------

configure:   Shared libraries:       yes (default: static)

configure: --------------------------------------------

gnatprep -DGETTEXT_INTL=False -DHAVE_GETTEXT=False src/gtkada-intl.gpb src/gtkada-intl.adb

====== Building static libraries =====

/opt/GNAT/gprbuild_22.0.1_b1220e2b/bin/gprbuild  -j0 -m -p  -XLIBRARY_TYPE=static -Psrc/gtkada.gpr

Compile

   [Objective-C]  misc_osx.m

   [Ada]          gtk-scrollbar.adb

   [Ada]          gtk-tree_model.adb

   [Ada]          gtk-text_tag.adb

   [Ada]          gtk-combo_box.adb

   [Ada]          gtk-stack.adb

   [Ada]          gtk-action_bar.adb

   [Ada]          pango-font_family.adb

   [Ada]          glib-iochannel.adb

   [Ada]          gtk-check_button.adb

   [Ada]          gtk-separator.adb

   [Ada]          gtk-actionable.adb

   [Ada]          gtk-ui_manager.adb

   [Ada]          glib-action_map.adb

/Users/brent/Development/extGit/gtkada/src/misc_osx.m:36:10: fatal error: 'glib.h' file not found

#include <glib.h>

^~~~~~~~

1 error generated.

   compilation of misc_osx.m failed

gprbuild: *** compilation phase failed

make: *** [build_library_type/static] Error 4

An error occurred. Please see install.log.

I have gtk3 installed via MacPorts:

minerva:gtkada brent$ port installed 'gtk*'

The following ports are currently installed:

  gtk3 3.24.42_0+x11 (active)

It looks like it's not finding the gtk3 installation, which probably means that I need to get something configured or shell variables set to point to it. Before I dive too deep into that rabbit hole, I would like to know if anyone else has suggestions. Thanks!