My adventures with GNATcoll

## UPDATE! ##

I’ve since learned that you _don’t_ have to clean away anything to avoid failure during the “make” step.

Simple pass the “PROCESSORS=n” variable to “make” and you’re good to go:

  1. $ ./configure ….
  2. $ PROCESSORS=4 make
  3. $ make install

I do though still think that this should be apparent in the install instructions. As it stands now, it’s an undocumented feature.


On my quest to port all my PHP/XSLT web-applications to Ada, I’ve started using GNATcoll for the stuff that needs access to a database.

It has so far been an excellent companion.

But whenever I have to compile it, I stumble on an annoying “bug” in the gnatcoll-gpl-2010-src package found at the website.

Here’s what I do:

  1. Download and install the latest gnat-gpl, which at the time of writing is 2010
  2. Download the latest gnatcoll-gpl package, which at the time of writing is 2010
  3. Unpack gnatcoll-gpl and do the “./configure, make, make install” dance
  4. Watch it fail

The first error you get when doing the “make” step, looks something like this:

gprbuild: illegal option “-j” on the command line

A quick search reveals the use of this option in 4 files:

  • ./ Switches (“Ada”) use (“-m”, “-j” & Processors);
  • ./src/ -m -j${PROCESSORS} -P$(PROJECT) $@ -p -largs $(POSTGRES_PATH)
  • ./Makefile:26:gprbuild -m -j${PROCESSORS} -XLIBRARY_TYPE=${LIBRARY_TYPE} -Pgnatcoll_build -p

All you have to do is clean away the “-j${PROCESSORS}” and “, “-j” & Processors” parts, and you’re good to go. This should, of course, be done _before_ you execute your ./configure.

I reported this error to the “gnat-gpl at” email address back in September 2010, but it seems that they’ve yet to fix it, which is pretty odd, considering how utterly trivial a thing it is to fix. I honestly believe that software downloaded from the website should compile out of the box using the latest gnat-gpl compiler. The fact that it does not sends a bit of an amateurish signal – in my opinion.

If someone with a bit of clout in regards to the libre AdaCore software reads this, then please consider fixing it, or at least write something about it in the accompanying README file.

Leave a Reply