macOS Sonoma GtkAda installed, but Gnat Studio and others do not see it

223 Views Asked by At

I have Macs with macOS Sonoma and I have successfully compiled and installed GtkAda from source that I got from AdaCore, with no errors. It's installed at /usr/local/lib/gnat and /usr/local/lib/gtkada, but nothing sees it. I use Gnat Studio and of course it complains about not finding "gtkada" compiling from the command line has the same issue. I have not updated the LD_LIBRARY_PATH, and related because I don't know how if that's the issue. This works on Linux and Windows very easily, but I'm not sure what else to do at this point. I have listed my Macs with Sonoma, but I've actually never had it work with Ventura either, so I don't think that has anything to do with it. I know I'm missing something, and probably something simple.

2

There are 2 best solutions below

8
On

MacOS equivalent of LD_LIBRARY_PATH is DYLD_LIBRARY_PATH. Also make sure you have GPR_PROJECT_PATH pointing to the directory with gtkada.gpr.

Why not use Alire, BTW?

8
On

This works for me (but, the installations have happened in stages, so I may have left out a step or two).

Install the Homebrew package manager.
Include these lines in your startup script (note, I use bash, these should be OK in zsh):

eval $(/opt/homebrew/bin/brew shellenv)
export C_INCLUDE_PATH=$HOMEBREW_PREFIX/include
export CPLUS_INCLUDE_PATH=$HOMEBREW_PREFIX/include
export LIBRARY_PATH=$HOMEBREW_PREFIX/lib

Open a new Terminal window, type brew help to check the PATH is OK. Close the old window to avoid confusion about what’s on the PATH!

Run brew install gtk+3.

You need a native aarch64 compiler, because the Homebrew package manager knows you’re on Apple silicon and installs aarch64, aka arm64, binaries.

Install gcc-13.1.0-aarch64 - go to the bottom of the page for the .dmg. Read the note about setting up your PATH.

Run alr toolchain --select -- you should be able to choose gnat_external=13.1.0 and gprbuild=23.0.0.

Now run alr get gtkada, and ignore when it says that the solution is incomplete, just accept it (Alire 2.0 will understand Homebrew (and MacPorts) and would run the brew install for you).

Now change directory into the new gtkada_23.0.0_bac4d634 and alr build.