Showing posts with label GCC. Show all posts
Showing posts with label GCC. Show all posts

Wednesday, October 4, 2017

New Ada for Slackware released

Finally, long after released of GNAT GPL 2017 and GCC in 7.x series in Slackware-current, I got some time to work on the Ada environment for Slackware and got a working version of GPS.

The new release is at GitHub

Thursday, May 4, 2017

GCC 7.1 is out

GCC 7.1 was released on May 2.

I tried it out and recompiled all my Ada related builds, finally I got a stable GPS that does not crash after opening a project file. It still crashed on me, maybe I should revert to an older version?

I have updated my build scripts ada-4-slackware on gitHub. There is still some problems with ASIS 2016, some API changed for the new compiler, will update the build script once got time.

Tuesday, September 13, 2016

Ada programming environment based on GCC 6.2 and GNAT GPL 2016 in Slackware64 14.2

New release of Slackware and new version of GNAT GPL 2016 prompt me to update the Ada programming environment under Slackware.

First, I was trying to use the stock 5.3 compiler, but encounter gnat compiler error when compiling gprbuild. So has to use the FSF GCC 6.2 as the based.

The FSF GCC compiler

At the writing, the latest release of GCC is 6.2.0. First I update the build script to matched what's in the current tree. I have changed the build directory to a fixed location to avoid the random location in the original script. As it is needed for gnat_util build, a fixed location is easier for the script to find the right files. Built and install without problem.

GNAT Environment package

This package contains startup scripts to setup Ada project path environment variable ADA_PROJECT_PATH and GPR_PROJECT_PATH. They will be installed into /etc/profile.d by the doinst.sh.

Also soft link of the GNAT Ada run time libraries are also created in doinst.sh.

XMLAda

For XMLAda GPL 2016, the default build process is making use of gprbuild, which depends on XMLAda. I followed what was done on Arch Linux and created a custom Makefile.SlackBuild. But I installed the package with the following scheme, similar to what GNAT GPL 2016 is doing but with sub-directories for each sub-module:
 usr/include/xmlada
             |- input
             |- unicode
             ...
 usr/lib64/xmlada
           |- input
           |  |- static
           |  `- relocatable
           |- unicode
           |  |- static
           |  `- relocatable
           ...
The document build requires Sphinx, as SlackBuilds.orgprovides all necessary build scripts, it is a matter of installing the relevant packages and dependencies.

GPRBuild

The 2016 version of gprbuild required gprbuild itself. So Similar to XMLAda, a custom Makefile was borrowed from the Arch Linux project and modified to suite the needs of Slackware. A patch was developed for the gprinstall program, so that its default library subdir and library soft link subdir points to lib64 under Slackware64. A gpr library is also created, as it is needed by a few other programs

GNAT_UTIL

The GNAT Util Libraryprovides access to GNAT compiler internals for AdaCore utilities. The latest release is 5.1.0, it is used for our GCC 6.2.0. The build went well.

GTKAda

It does not build very well at the first few builds, it keeps installing libs into /usr/lib in stead of /usr/lib64 on 64-bit system. It seems the generate file still insist on the lib's path. So more sed commands are added to change the lib path to lib64 on 64-bit system. After that, it built without problem with proper installation path.

Aunit

Aunit's build script has no big change from the previous version, except for the version bump.

GNATColl

I used version 16.1 from GitHub. GNATColl compiled OK, with minor problem with lib's installation path, similar to the problem in GtkAda. I always got gpr.gpr problem when compiling GPS, latter I found that not sure why, the installing process of gnatcoll will install a copy of the gpr.gpr project file and related object file and source into its own directory structure with some modification to gpr.gpr and causing error on the project file. I have to manually remove all gpr related files and directories and entries in the manifests file. Then GPS will compile with correct project file.

GPS

After fixing the gprbuild, gpr and gnatcoll libraries, GPS compile without problem. When running GPS, it gave python script warning about pep8 and jedi, after install those two from SlackBuilds.org, everything is working fine.

Florist

No trouble when compile and install florist.

Asis

Asis has no problem to compile and install after fixed the gprbuild install path.

Gnatmem and Ahven

Gnatmem (need to compile the binutils for Slackware 14.2 and use the build tree) and Aheven gave no trouble when compiled for the 2016 version.

All build scripts are available at GitHub.

Thursday, September 10, 2015

Building Ada programming environment with GCC 5 and GNAT GPL 2015

I would like to rebuild the Ada programming environment based on GCC 5 and GNAT GPL 2015 in Slackware64 14.1, as Ada 2012 support is more mature in GCC 5.

The FSF GCC compiler

At the writing, the latest release of GCC is 5.2.0.  First I update the build script to matched what's in the current tree.  I would to like to replace the stock Slackware64 14.1's compiler with the new one, but GCC changed the default standard C++ library ABI since 5.1.0.  To make it compatible with GCC 4, a configure switch (--with-default-libstdcxx-abi=gcc4-compatible) was added to the build script.  Also, I have changed the build directory to a fixed location to avoid the random location in the original script.  As it is needed for gnat_util build, a fixed location is easier for the script to find the right files.  I had problem on i586 platform, which I had to explicitly add the --disable-multilib switch to the configuration and remove the conditional test for it.  Built and install without problem.

P.S. Due to GPRBuild will look for GNAT's runtime library as libgnat-5.2.so in stead of libgnat-5.so, build script was modified to create the softlink when packaging the GNAT compiler.  Also created libgnarl-5.2.so from libgnarl-5.so

XMLAda

For XMLAda GPL 2015, the default build process is making use of gprbuild, which depends on XMLAda.  I followed what was done on Arch Linux and created a custom Makefile.SlackBuild.  But I installed the package with the following scheme, similar to what GNAT GPL 2015 is doing but with sub-directories for each sub-module:
 usr/include/xmlada
             |- input
             |- unicode
             ...
 usr/lib64/xmlada
           |- input
           |  |- static
           |  `- relocatable
           |- unicode
           |  |- static
           |  `- relocatable
           ...
The document build requires Sphinx, as SlackBuilds.org provides all necessary build scripts, it is a matter of installing the relevant packages and dependencies.

GPRBuild

The 2015 version of gprbuild required gprbuild itself.  So Similar to XMLAda, a custom Makefile was borrowed from the Arch Linux project and modified to suite the needs of Slackware.  My first build was without error, but it failed to build when trying it for gnat_uitl, complained about:
gnat_util.gpr:21:09: warning: no compiler specified for language "C", ignoring all its sources
gnat_util.gpr:21:09: warning: no compiler specified for language "Ada", ignoring all its sources
Further investigation showed that the default target for gprconfig was wrong, it was set to "Slackware" when generating gprconfig-sdefault.ads in my build script, due to not fully understand what it means.  After set it to "$ARCH-slackare-linux", it still failed on linking, looking for GNAT's runtime library libgnat-5.2.so, which does not exist for a standard GCC build, as it only has libgnat-5.so.  After created a soft link from libgnat-5.so, it builds and working.

GNAT_UTIL

The GNAT Util Library provides access to GNAT compiler internals for AdaCore utilities.  The latest release is 5.1.0, since there are no changes on Ada part of the GCC for 5.2.0, it is sufficient for us.  The build went well except for the initial gprbuild target problem.

GTKAda

GTKAda require Gtk+3 version after 3.8.3, the stock version in Slackware 14.1 is 3.8.2, need to upgrade to a latter version.  The version in Slackware current tree is too new, I settled on the latest 3.8 release 3.8.9 and rebuild the GTK+3 package.  The GL support is turned on for this version, but when building test program, it complained:
gtkada-gpl-2015-src/src/lib/gtkada_gl/static/libgtkada_gl.a(gdkgl.o): undefined reference to symbol 'XFree'
/usr/lib/libX11.so.6: error adding symbols: DSO missing from command line
After patching the testgtk.gpr with linker option to link with -lX11 -lm, it built and run fine.

Aunit

Aunit's build script needed to adapt to gprinstall command, other than that, it built smoothly.

GNATColl

GNATColl compiled OK, with minor problem with libgnarl-5.2.so.

GPS

The IDE compiler could be compiled now given all dependencies had been built.  The build did not go smoothly related to some xmlada library issues, back and forth a few times, finally got it compiled.  When running GPS, it gave python script warning about pep8 and jedi, after install those two from SlackBuilds.org, everything is working fine.

Florist

The florist library changed to use gprinstall, which breaks the install process.  After adjust the build script and patched the Makefile.in generated proper project file for used with others, it built and install fine.

Asis

Asis has little problem for installing to correct path, some patch needed to be re-do, after that, everything built and installed correctly.

Gnatmem and Ahven

Gnatmem gave no trouble when compiled for the 2015 version.  Ahven's 2.6 version changed the build process and I had to create a gpr file for it.  Other than that, there is no big problems.

Where are the build scripts

All build scripts are available at GitHub.

Monday, May 4, 2015

Building Ada promgramming enviroment for Slackware

Slackware has finally upgraded the system GCC to 4.9.2 in current. Here I presented my work to compile GPS using FSF's GCC 4.9.2. It is based on my previous attempt to build the environment with GCC 4.7.0. This time lots of things have changed, new GCC and GNAT GPL released and they make the attempt much more easier than previous one. GCC 5.1 has just been released, but Slackware use 4.9.2 in the current branch for now, so we stick with 4.9.2.

The Compiler

There is no need to change the build script any more, but we need some of the compiler internal files. So run the standard build script for GCC.

XMLAda

For this one, I am using the xmlada-for-gps-6.0.1-src.tgz from GNAT GPL 2014, in stead of xmlada-gpl-2014-src.tar.gz. They are almost exactly the same with minor changes.

GPRbuild

I am using the gprbuild-gpl-2014-src.tar.gz. GPRbuild expected some support functions that are not in the FSF GNAT compiler. Namely the "GNAT.Rewrite_Data" package and some low level support functions in os_lib.c. I gather the missing functions from the GNAT GPL 2014 version and make up some packages for it. Then it builds without problem.

GNAT_UTIL

This GNAT Util Library provides access to GNAT compiler internals for AdaCore utilities. It makes the previous effort of trying to mimic what Debian do redundant. In the build script, the source and build directory of the GCC compiler needs to be specified for it to work correctly.
I am using the 4.9.1 one from the sourceforge project. For there is no 4.9.2 version and there are basically no differences for the generation of gnat_util.

GTKAda

With the standard gtkada-gpl-3.8.2-src.tgz, there is nothing special, it builds without problem. One may have to note that currently it does not support GL.

Aunit

Aunit GPL 2014 also builds without too much problem.

GNATcoll

GNATcoll compile without problem with some patches.

GPS

Oh, finally, we could build the IDE. It depends on pygobject3, which could be build using SlackBuilds.org's supply script.

Florist, ASIS, GNATMEM, Ahven

The rests are relatively easy and build fine with the build script. For gnatmem, we need to rebuild the binutils and specified the directory in gnatmem build script.

Other experimental scripts

I have tried to build the Ada-RM, GNAT RM, GNAT user guide to integrated with GPS, it seems working for me.

Where are the build scripts

All build scripts are available at GitHub.