GNAT AUX for OpenIndiana

First the OpenIndiana project ported KVM, and now the DragonLace guys have made GNAT AUX available for this new Solaris based OS:

I had previously built a flawless GNAT-AUX on an obsolete OpenSolaris version SXCE 130. It was fairly trivial to built a static bootstrap compiler on the latest version of OpenIndiana (oi_151a). The lang/gnat-aux package has been updated to support the x86 Solaris target, and also updates all supported platforms to provide working runtime symbolic traceback. It just missed the 2011Q3 branch, so it’s only available in the pkgsrc trunk.

Awesome!

OpenIndiana is looking better and better. The now defunct OpenSolaris project was pretty interesting, but very rough around the edges. OpenIndiana already seems much more polished and with Ada now available on the platform, I’m drawn to do some testing.

Building FSF GCC with GNAT for Mac OS X

Building FSF GCC with GNAT for Mac OS X is not a trivial task, despite Simon J. Wright’s very clear and concise notes/instructions.

I’m building on a 15″ Macbook Pro with a 2.4 GHz Intel Core 2 Duo processor and 4 GB of RAM, running Mac OS X Lion 10.7.1 with Xcode 4.1. FSF GCC Ada requires a working GNAT compiler. I started with GNAT GPL 2011, which I installed at /opt/gnat-gpl-2011, so I adjust my PATH to make this compiler the default choice: $ PATH=/opt/gnat-gpl-2011/bin:$PATH

So it all starts with GNAT GPL from libre.adacore. This step is by far the simplest to understand. Going forward it gets a lot more complicated, and unless you’re some kind of compiler wizard, you’re probably going to find Simon’s notes invaluable for getting FSF GCC up and running on your Mac.

Zero Testsuite Failures for GNATDroid = Ada on Android

The DragonLace project is at it again! John Marino has acquired an Android device and, after building GNATDroid-ARMv7, has confirmed that he could compile Ada programs on FreeBSD and execute them on the Android tablet.

That is just awesome news, both for FreeBSD users and Ada programmers in general. The work done by John is simply amazing.

You can read the entire announcement here.

Ada Programming For Android?

The DragonLace.net project, who’re responsible for bringing the GNAT AUX Ada compiler to the *BSD users, are hard at work on enabling Ada programmers to build software for Android devices without having to touch Java, or as John Marino said in a recent comp.lang.ada post on the subject:

It would be a nice project for someone to blaze the trail on writing Native Android phone/table applications without any Java. This is possible from Android 2.3 onwards using the “NativeActivity” functionality provided with the Android Native Development Kit (NDK). The API require C bindings, but it shouldn’t be too difficult.

More information is available at the DragonLace.net website, specifically these two articles:

This is in my humble opinion both very good and very exciting news! I am currently involved in the development of an Android application, and I would personally have loved if it could’ve been done in Ada instead of Java.

I know some of the Ada-DK members have Android devices (myself included), so perhaps we should spend a few open Ada-DK meetings on testing this stuff? Could be both a learning and fun experience.

GNAT GPL 2011 is out!

And so is the 2011 versions of all the libre.adacore.com software, such as AWS, XML/Ada and GNATcoll.

GNAT GPL 2011 is, as you probably know, the GPL edition of the AdaCore Ada compiler. The package comes complete with compiler and the excellent Ada/C/C++ IDE GNAT Programming Studio.

Obviously there are a lot of changes and new stuff in the 2011 GNAT GPL package, but some of the most notable are:

  • Improved support for Ada 2012
  • More flexible and more efficient project manager tool
  • Support for unloading Ada plug-ins
  • Improved support for Ada constructs on the .NET platform
  • More detailed exception messages (-gnateE switch)
  • complete support for Lego MINDSTORMS hardware, including audio and I2C sensors

I’m especially interested in the new Ada 2012 features and in the -gnateE switch. I could do with some more information in my exceptions.

I haven’t tried any of the new stuff yet, as download speeds are currently abysmal. GNAT GPL is downloading at 18.8kb/s so it’ll be a while yet before I can get my hands on the shiny new stuff.

Ada Outperforms Assembly: A Case Study

I’d like to start this post with a short quote from the article:

How can a compiler for a high order language beat assembly code in both size and performance? It is because of a reasonably high level of maturity on the part of both compiler technology in general and the compiler vendor in specific. When a vendor brings a wealth of experience to bear on the task of optimization, it goes beyond the capabilities of any one individual, no matter how experienced.

I wholeheartedly agree with that, and I think it is reasonable to expect that a compiler vendor will only get better at maintaining and improving on his product(s) as time passes. The above was originally written in 1992, in an article by Patricia K. Lawlis (PhD) and Terence W. Elam (PE, CMfgE) for the Proceedings of TRI-Ada ’92, Orlando, FL, November 16-20, Association for Computing Machinery (ACM), New York, 1992.

Here’s the abstract of the article:

With the intent of getting an Ada waiver, a defense contractor wrote a portion of its software in Ada to prove that Ada could not produce real-time code. The expectation was that the resultant machine code would be too large and too slow to be effective for a communications application. However, the opposite was verified. With only minor source code variations, one version of the compiled Ada code was much smaller while executing at approximately the same speed, and a second version was approximately the same size but much faster than the corresponding assembly code.

And here’s the link: Ada Outperforms Assembly: A Case Study.

It is a very interesting read, both for the historical and technical perspectives. And it doesn’t hurt either that Ada is shown in a very positive light. And to think; the compiler vendors have had almost 20 years since then to improve on their product!

FreeBSD-8.2 and GNAT AUX – initial impressions

Over the past months I’ve written a few posts about the dragonlace.net project, which aims to bring the GNAT Ada compiler to the *BSD world and Solaris world.

They call their compiler GNAT AUX.

It is, as I’ve stated in previous posts, an impressive feat that GNAT AUX is now available for more or less all their targets.

So I decided to stop just reporting on the progress of GNAT AUX, and instead try it out myself. I’m more or less a complete BSD beginner, so the ride was somewhat bumpy due to me fumbling around. I chose FreeBSD-8.2 as my testing ground, and while it felt a lot like my dear and beloved Slackware, it was also sufficiently different to allow for a few “DUH!” moments as I learned the ropes. The _excellent_ FreeBSD online manual was a great help. I wish all operating systems had such a nice and concise manual.

With FreeBSD-8.2 up and running I installed the GNAT AUX port, and it just worked. It compiled cleanly without a hitch, and when it was done I had a nice Ada compiler running:

GNATMAKE 4.6.0 20110107 (experimental) -=> GNAT AUX [FreeBSD64]

Awesome!

Next up I grabbed the AWS port, and that too worked out of the box.

I even tried compiling AWS using the latest Git checkout

git clone --recursive http://forge.open-do.org/anonscm/git/aws/aws.git

And that too worked, almost, out of the box. I merely had to use “gmake” instead of “make”.

Two down, three to go.

I’m a big fan of GNATColl, so naturally I had to try and compile that also. There’s currently no port of GNATColl, so I had to do that manually. I grabbed the latest SVN checkout

svn co http://svn.eu.adacore.com/anonsvn/Dev/trunk/gps/gnatlib/

And compiled it according to instructions, except I needed to substitute “make” with “gmake”, just as with AWS.

I had a bit of trouble getting GNATColl to find my PostgreSQL installation, but that turned out to be because I’d installed the wrong PostgreSQL port. As soon as I installed the right one (postgresql-libpqxx) it worked. GNATColl compiled without a hitch. How very nice!

Last on the block was Florist, the Ada binding to POSIX. This is available from libre.adacore.com, and this too compiled without a hitch.

Everything appeared to be working just fine.

But then I tried the hello_world demo program that comes with AWS, and that did not go well. It compiled just fine, but when I tried to start it, it complained about a missing aws.ini file. I created that file, and then it complained about a missing hello_world.ini file. I also created that and silently hoped that the third try would be a success. Sadly it was not:

raised GNAT.SOCKETS.SOCKET_ERROR : [36] Operation now in progress

At that point I decided to give up on hello_world and instead try building my own AWS based web toolbox. It’s just a simple little project I’m working on, as a part of the ongoing effort of getting rid of PHP in my shop.

I grabbed the software and tried compiling it using plain gnatmake:

yolk-process_control.ads:99:63: "SIGPWR" not declared in "Names"

Hmm, not a good sign. I got rid of the offending “SIGPWR” handler and tried again, and now it compiled without issue. YAY!

I then tried running the demo application and got this:

Execution terminated by abort of environment task

I suspect maybe this has something to do with the fact that I setup my own signal handlers in the application, using the Ada.Interrupts.Names package.

Or maybe it’s because I use Florist/POSIX to switch user when the application start.

I don’t know, and I haven’t had time to investigate further.

So what have I learned from this experience:

  1. GNAT AUX is easy to install, and so is the rest of the dragonlace.net Ada port packages.
  2. AWS, GNATColl, Florist and my own toolbox compiles fine using GNAT AUX.
  3. The AWS hello_world demo and my own AWS application won’t run out of the box.

I’m very impressed with how easy it has been to get my usual Ada environment up and running on FreeBSD-8.2, and I’m not at all convinced that the errors I’m getting when trying to run the AWS hello_world and my own AWS application is not due to my own fault. I will have to investigate further, when time permits.

DragonLace and Ada Support on *BSD / *Solaris / Android

In a lengthy post to comp.lang.ada John Marino of DragonLace fame outlines the current status of Ada support for *BSD, *Solaris and Android.

And things are looking pretty good:

For a long time, support for Ada was poor to non-existent for the four major BSD platforms of FreeBSD, NetBSD, DragonFlyBSD, and OpenBSD. GNAT would not build from source, although FreeBSD i386 was pretty close. Over the last year, I’ve developed a substantial set of patches and now GNAT from GCC-4.6 passes the entire ACATS and gnat.dg testsuite without failure on FreeBSD, DragonFlyBSD, and NetBSD on both the AMD64 and i386 platforms. The version is called “GNAT-AUX” and it also builds on OpenBSD with only a single failure the same two platforms.

The amount of work that has gone into this is amazing, and I personally look forward (very much!) to the day where Android apps can be build using Ada. How cool would that be?

If you visit the DragonLace website, you’ll see that the project is only 3 measly failures away from having achieved perfect status for its GNAT AUX port project.

I think I’m going to have to install one or more BSD’s and start testing my own AWS powered web tool box!

This project is a _huge_ boon to the Ada community.

Ada Tools in NetBSD pkgsrc Repository

Obviously I should’ve reported on this yesterday, but I got caught up in a bunch of meetings and other boring non-Ada things.

But here you go, with a slight delay:

The big news of the day is that NetBSD has imported all the packages(*) into the pkgsrc repository. This means that NetBSD and DragonFlyBSD users can build GNAT, the GNAT Programming Studio, and others from source today if they update pkgsrc to the repository head. They will show up in a few months in the next quarterly release (2011Q1), and at that time maintainers for NetBSD and DragonFlyBSD will build the binary packages.

You can read the full announcement here.

This is obviously good news, both for Ada in general and for *BSD users specifically.

Oh, and on a final note you can now subscribe to the DragonLace maillist for instant news and discussion about the project.

GNAT AUX Ported to Android

Building Android applications in Ada is no longer a faraway dream, now that the DragonLace project has managed to successfully built the GNAT AUX cross compiler Android.

This is very exciting news indeed, and seeing a screenshot of an Ada hello world program running in the Android SDK is just amazingly cool.

But don’t take my word for it – go read the full announcement instead.