Georgenhausen, 26-Apr-2000
This is Release 11 of GNU Ada 3.12p (also known as GNAT) for RPM-based GNU/Linux distributions based on the C library 2.1 such as Red Hat 6.x or SuSE 6.{2,3}
GNAT is an industry strength compiler for the Ada95 programming language. It can also compile programs for the previous Ada83 standard.
GNAT has been developed as Open Source Software by Ada Core Technologies (ACT, see www.gnat.com).
The compiler is covered by the GNU Public License (GPL). You find this license in file /usr/doc/gnat/COPYING. The runtime system is covered by a modified version of the GPL, which allows you to write proprietary programs and to include the runtime into such programs. Please read more details in /usr/doc/gnat/gnatinfo.txt.
This distribution is a project of the Ada for Linux Team (ALT) and is intended to make GNU Ada easy installable and usable on typical GNU/Linux systems. We plan to make packages that work for most GNU/Linux distributions and will give you an almost identical GNU Ada installation on all such systems. Our current homepage is http://www.gnuada.org/alt.html.
Please note that this public version is not supported by ACT. If you plan to write industrial applications with GNU Ada we strongly suggest that you contact ACT to get the supported "GNAT Professional" version and to get a support contract. You may contact them through their homepage www.gnat.com or via email to sales@gnat.com.
There are also separate binary packages for the Ada Semantic Interface Specification (ASIS) implementation, the implementation of Annex-E (Distributed Systems) of the Ada95 Reference Manual (codename: GLADE) and the POSIX 1003.5 binding (codename: Florist). There is only one source package to produce all these binary packages because the build process is tightly integrated.
This distribution supports the native threads implementation (also known as LinuxThreads) of the GNU/Linux 2.x kernels based on the GNU C Library glibc-2.1. It will probably not work on GNU/Linux distributions which only support the older libc5 C library.
There is an alternate threading implementation from the Florida State University (FSU). It's a non-native thread runtime that is known to fully support the requirements of Annex C & D of the Ada Reference Manual. Most Ada programs don't need this alternate threading implementation. Therefore support for this threading library has not been included in this distribution.
Please note that there are plans to integrate GNAT with the next major release of gcc (gcc 3.0). At the moment, GNAT is based on a patched version of gcc-2.8.1 and this is known to be a stable configuration.
The packages are installed so that they don't disturb any existing gcc or egcs installation. One consequence of that is, that you don't call the compiler with the gcc command. Instead we have the command gnatgcc. If you use - as recommended - the gnatmake tool to build your programs you'll not notice any difference, because gnatmake automatically uses the gnatgcc command. All other tools referencing gcc are changed to use gnatgcc.
This distribution also contains a GNU Ada aware gdb debugger. It uses also a different name than gdb, it is gnatgdb.
I hope that others look into what I did and come up with fixes and improvements!
The GNU Ada distribution is split into five binary RPM files:
gnat-3.12p-runtime-1-11.i386.rpm This is the GNU Ada runtime system. It contains five shared libraries:
libgnat-3.12p.so.1 - this is the non-tasking part of the GNU Ada runtime.
libgnarl-3.12p.so.1 - this is the tasking part of the GNU Ada runtime.
libgarlic-3.12p.so.1 - this is the runtime required for distributed systems programs.
libasis-3.12p.so.1 - this is the runtime of the Ada Semantic Interface Specification implementation.
libflorist-3.12p.so.1 - this is the runtime of the Posix 1003.5 binding. This package must be installed if you want to run programs compiled with GNU Ada if and only if they are compiled to use the shared runtime (which is the default).
We put all the basic shared libraries into this single runtime package to simplify the deployment of the runtime. The libraries are already build in one tightly integrated build process, so this would not create a maintenance problem. This package is a prerequisite for the compiler package.
gnat-3.12p-11.i386.rpm This is the GNU Ada development system. It contains a) The Ada compiler named gnatgcc (not gcc to avoid conflicts with existing gcc/egcs implementations) and related files and tools. b) The gnathtml, gnatelim and gnatstub tools. c) The debugger gnatgdb, a gdb variant that understands GNU Ada95. This package installs a GNU Ada filesystem standard according to my current proposal. This is a directory structure that specifies, where various additional packages and objects should be stored. See the document gnat-FHS-Proposal in the documentation directory of this package.
gnat-glade-3.12p-11.i386.rpm This are the tools and Ada packages required to build distributed programs.
asis-3.12p-11.i386.rpm This are the tools and Ada packages required to build programs using the Ada Semantic Interface Specification Implementation.
florist-3.12p-11.i386.rpm This are the Ada packages required to build programs using the Posix 1003.5 binding.
The directory /usr/lib/ada/adainclude is added to the compilers default search path to look for sources. The directory /usr/lib/ada/adalib is added to the compilers default search path to look for library files (.ali, .o, .a).
The ASIS packages are not automatically included by the compiler. If you want to write applications using ASIS, you might use the environment variable ASIS_DIR to find the ASIS implementation. This variable usually points to /usr/lib/asis unless you've used --prefix to relocate the package. You can use this directory just with the -I switch to include ASIS. This environment variable is set in the shell scripts /etc/profile.d/gnat.sh or /etc/profile.d/gnat.csh depending on what shell you use. Please verify, that your system executes that script during logon. If not, add this line to your .profile (for sh users) or .login (for csh users): source /etc/profile.d/gnat.sh (or .csh for csh users). Please note that these scripts are symlinks to corresponding files in /usr/lib/ada/etc. This is necessary to support relocatability of the packages. These scripts are created dynamically during installation and are removed when you uninstall the packages. The scripts in /etc/profile.d will not be listed in the packages file list, but you will see there the corresponding files in /usr/lib/ada/etc.
This distribution supports a shared GNAT runtime. This has the advantage of typically much smaller binaries and slightly reduced link times. The disadvantage is, that you need to deploy the runtime together with your programs and that the programs run slightly slower. For the runtime you may simply redistribute the runtime RPM belonging to this distribution. Please note, that the usage of shared libraries is an added feature of the ALT project and is not as well tested as the static case. In most cases it works. In cases you believe that the shared libraries causes problems just link statically (e.g. "-bargs -static" for gnatmake). This will give you the original ACT behaviour. Please note that due to the implementation of LinuxThreads, in an GNU Ada multitasking program the stacksize for the individual threads is limited (typically 2MB). In the previous 3.11p version of the ALT provided packages even non-tasking programs always get the tasking runtime when linked with the shared runtime. This has changed in this release (thanks to basic work of ACT in this area). Only programs that need tasking get the tasking runtime even in the shared case. The GNAT binder/linker mechanism will automatically use an -rpath option if you link against a non-standard shared run-time build with the Makefile.adalib makefile. For the default runtime this is not(!) done. The default runtime is installed in a way that guarantees that it can always be found at runtime.
Please do not strip the shared libraries. At least the gnatmem utility and the correct function of the debugger depends on symbolic information stored in the symbol table of the shared library.
The correct function of gnatgdb depends on the support of so called real-time signals by the kernel. This is mainly required to be able to support the debugging of threaded programs when glibc-2.1 is installed. This support is available with GNU/Linux kernel 2.1.70 or better. We suggest that you install a 2.2.x kernel.
The environment variable ASIS_DIR is for user comfort. It has no effect on the default behaviour of the compiler and the tools.
The installation of the development package automatically installs the Ada mode for emacs in the directory /usr/lib/ada/etc/adamode To enable Ada mode for emacs, you should put the following lines into your $HOME/.emacs file:
(defvar gnat-root (getenv "GNAT_ROOT")
"Default prefix for GNAT installation.")
(if (equal gnat-root nil)
(setq
gnat-root "/usr"))
(setq load-path (cons
(concat gnat-root "/lib/ada/etc/adamode")
load-path))
(setq Info-directory-list
(cons (concat gnat-root "/lib/ada/info")
Info-directory-list))
(require 'ada-mode)
(unless ada-xemacs
(global-font-lock-mode t)
(add-hook
'find-file-hooks 'turn-on-font-lock-if-enabled))
Please create a new $HOME/.emacs file if you don't have one already. If you have installed GNAT in a non-standard location you must fix the path to the adamode directory according to the new location.
We install the directory /usr/share/ada/html containig a collection of HTML files about GNAT, Ada in general and additional packages you may have installed. I've synchronised parts of my patches with the patches of Sam Tardieu, the maintainer of the Debian packages. Our goal is to have a in large parts common and compatible GNAT distribution on all the GNU/Linuxes..
We have renamed the GNAT enabled gdb into gnatgdb to avoid conflicts with the regular gdb on your system. If you try to debug an Ada program linked with the shared GNAT runtime, then commands like »break exception«, »break assert« etc. will fail if you try to execute them before the subprocess running the program has been created by gdb. This is because these commands implicitly try to set breakpoints on entries in the GNAT runtime, but shared libraries are loaded by gdb when it starts the program. You can solve this problem by setting a breakpoint on the entry »main« and then starting the program. When you get the gdb prompt again, all the shared libraries are loaded and you can apply now your additional special Ada »break« commands. Then continue execution with the »cont« command.
You can use the rpm utility or any other package utility based on rpm to install the packages. If you install the first time, you should use the option "-i" with rpm. If it is an update, use "-U". The runtime must be installed before the development system.
Example 1: This is a first time install
rpm -i
gnat-3.12p-runtime-1-11.i386.rpm
rpm
-i gnat-3.12p-11.i386.rpm
and optionally the GNAT-GLADE, ASIS or FLORIST packages.
Example 2: This is an update installation
rpm -U
gnat-3.12p-runtime-1-11.i386.rpm
rpm
-U gnat-3.12p-11.i386.rpm
and optionally the GNAT-GLADE, ASIS or FLORIST packages.
Example 3: Delete and Install
Sometimes the update option of RPM doesn't seem to work. In this case you can first delete the current packages and then install the new ones.
rpm -e gnat
rpm -e
gnat-3.12p-runtime
rpm -i
gnat-3.12p-runtime-1-11.i386.rpm
rpm
-i gnat-3.12p-11.i386.rpm
The packages and the software in there are designed to be relocatable. That means you can install and use them in any directory. The default install prefix is "/usr" and the installation will install files in subdirectories under "/usr". But you may use the --prefix option of rpm to install it in another place.
Example:rpm -i --prefix=/opt/Ada
gnat-3.12p-runtime-1-11.i386.rpm
rpm
-i --prefix=/opt/Ada
gnat-3.12p-11.i386.rpm
and optionally the GNAT-GLADE, ASIS or FLORIST packages. This will install the packages under the "/opt/Ada" directory. Please note that in case you relocate the software there are environment variables that have to be set, otherwise the software may not work.
GNAT_ROOT Must be set to the prefix directory you specified with --prefix. The installation generates the script /etc/profile.d/gnat.sh (and .csh) where this is done for you. On Red Hat and SuSE this script is executed automatically during the login. On other distributions you have to check this.
LD_LIBRARY_PATH The GNU Ada installation first tries to avoid to use this variable. It primarily attempts to modify /etc/ld.so.conf so that the dynamic linker automatically searches for the Ada runtime. If that modification is not possible, the installation uses the generated script /etc/profile.d/gnat-rts.sh (or .csh) to set the LD_LIBRARY_PATH for you. On Red Hat and SuSE this script is executed automatically during the login. On other distributions you have to check this. The main advantage of using /etc/ld.so.conf is, that any program on the system can find the Ada runtime. With the LD_LIBRARY_PATH approach only programs started from your logon session can find it. This is important if you want to run distributed programs. In that case the partitions might be started by the rshd daemon and not from a shell.
If you install GNU Ada in a non-standard place you usually have to log out and log in again to get your new environment. Please note that this is not necessary if you install GNU Ada in the standard location. If you don't have good reasons for relocation it is strongly recommended to install GNU Ada in its standard location. Both packages have to use the same prefix.
If you work on a GNU/Linux machine where you don't have root access, this GNAT distribution is your friend thanks to RPMs flexibility. It allows you to install the package under an arbitrary directory to which you have access. We will describe the necessary steps using an example directory structure which you perhaps will adopt:
Lets assume, you have created this directory structure $HOME/local $HOME/local/bin $HOME/local/lib $HOME/local/etc and you want to use $HOME/local as the root for your GNAT installation.
The first thing you have to do is to create your private RPM database that records all the packages and files you've installed. Create an rpm subdirectory somewhere, for example
mkdir -p $HOME/local/etc/rpm
Then type this command:
rpm --dbpath $HOME/local/etc/rpm --initdb
This will create the RPM database in the etc directory of your private directory tree.
Now you can start to install the packages. There is one little disadvantage using a newly initialised database: it doesn't know about already installed packages and therefore can't check the package dependencies. You have to use the --nodeps switch to install the new packages. To install GNAT, just type this
rpm --dbpath $HOME/local/etc/rpm -ivh --nodeps \ --prefix=$HOME/local \ gnat-3.12p-runtime-1-11.i386.rpm gnat-3.12p-11.i386.rpm
and you're done. You may optionally also install following this scheme the GNAT-GLADE, ASIS or FLORIST packages.
The above install modifies automatically your $HOME/.profile and/or $HOME/.login scripts. Please have a look at it. You have to log out and log in again to activate the GNAT settings. Sorry about that, but there is no easy way around that if you don't have root access.
The other packages of the ALT distribution can be installed repeating step 3 for these packages. This is due to the fact that all ALT packages are fully relocatable RPMs and are configured to fit into our framework.
If you are worried about not
checking dependencies, you can even achieve that if you have a few
megabytes more of diskspace available under your private directory
hierarchy. Instead of Step 2, you do this
2a) Copy the existing
database into your directory. Type
cp -pf /var/lib/rpm/*.rpm $HOME/local/etc/rpm
2b) Next run this command
rpm --dbpath $HOME/local/etc/rpm --rebuilddb
Now you have an exact duplicate of your systems RPM database in your own directories and can add packages on top of this. You should then omit the '--nodeps' option in step 3. This database will occupy 10 - 15 MB diskspace on a typical GNU/Linux system.
To uninstall a package from this private install tree, you should type
rpm --dbpath $HOME/local/etc/rpm -e packagename
Please note, that if you uninstall GNAT itself, the uninstall scripts don't fix the modified ~/.profile and/or ~/.login automatically. You have to edit them manually and to remove the activations of the GNAT startup scripts.
Before you consider to build the packages yourself from the sources please notice that this requires: - Build time of the package is approx. 1 hour on a 300MHz PII with 128MB Ram and reasonably fast and free disks. - You need this diskspace
approx. 300MB under the rpm build/source directory structure
Get the gnat-3.12p-11.nosrc.rpm source package and install it with:
rpm -i gnat-3.12p-11.nosrc.rpm
You may wonder about this nosrc.rpm extension. This is because the source RPM doesn't contain all the sources. I left out the original tarballs from gdb, gcc, gnat, asis and glade as well as the official GNU/Linux gdb patch. If you install this package and look into the spec file, all those missing files are referenced with a full ftp path. You may get them form their locations and store them under the RPM source directory (/usr/src/redhat/SOURCES or /usr/src/packages/SOURCES). After that you can do the build. Maybe you want to try the rpm option to get the files via ftp automatically, but I never tried that. If I would have included all the tarfiles the source RPM would be approx. 25MB:-(
Go to /usr/src/redhat/SPECS and type:
rpm -bb gnat.spec
Please note that SuSE uses /usr/src/packages instead of /usr/src/redhat.
Wait.
Have Fun!
Jürgen <juergen.pfeifer@gmx.net>