AFNIX installation guide

1 - Installation Guide

This chapter describes the installation procedures for the AFNIX writing system distribution. This chapter explains how to set and compile this distribution.

1.1 - Software distribution

The complete distribution can be downloaded from the AFNIX home page . The result is a complete source tree that is ready for compilation. The distribution contains also the documentation as well as examples. The distribution is supported on a variety of platforms as indicated below that can be either 32 bits or 64 bits machines. The distribution is also available at the FreeBSD port collection .

Platform Processor Operating system
Linux X86-32, X86-64 Linux 4.x, 5.x, 6.x (Fedora, Debian, Ubuntu, ...)
FreeBSD X86-32, X86-64 FreeBSD 13.x.x, 14.x.x

Specific platforms like GNU KBSD or GNU Hurd havce limited support. Feel free to report any issue at AFNIX bug . Specific processors like the Alpha, M68K, ARM, MIPS, RISCV and SUPERH are also supported on certain distributions. The PowerPC (PPC) processor has been discontinued. The Solaris SPARC platform has been discontinued. Do not hesitate to contact the development team for specific processor or platform support at AFNIX contact .

1.2 - Installation procedure

The core software is written in C++. It has been successfully built with the latest GNU GCC 10 . The clang compiler has also been succesfully tested. You will also need the GNU Make package. With some distributions the command is called gmake . Note that the Makefile hierarchy is designed to operate safely with the -j GNU Make option.

1.2.1 - Unpacking the distribution

The distribution is available as a compressed tar file. Note that the documentation is distributed in a separate file. The following command unpacks the distribution.

 gzip -d afnix-src-[version].tar.gz
zsh> tar  xf afnix-src-[version].tar

]]>
      

1.2.2 - Quick command reference

The list of commands to execute is given in the example below. A detailed description for each command is given hereafter. The make world command is the default command that builds the whole tree with the default compiler.

 ./cnf/bin/afnix-setup -o --prefix=/usr/local/afnix
zsh> make status
zsh> make [-j]
zsh> make test
zsh> make install
zsh> make clean

]]>
      

With some platforms, the make command should be replaced by the gmake command. The make status command is optional and can be used to report the internal value contents. In particular, the version and the installation parameters are reported.

1.2.3 - Configuration

The afnix-setup command can be invoked to setup a particular configuration. You should have your compiler on your search path. Normally, the command given below is enough.

 ./cnf/bin/afnix-setup -o --prefix=/usr/local/afnix

]]>
      

This command checks that the target platform can be detected and configured. The -o option configures the compilation in optimized mode. Use the -g option can be used to configure the build process in debug mode. The --prefix option sets the installation directory. Note that the compilation process is done in the distribution tree and that the --prefix option affects only the installation operations. The -v option is the verbose option. Other options are available for fine tuning.

Option Description Default
-h Print a help message n/a
-v Set the verbose mode n/a
-g Set the debug mode yes
-o Set the optimized mode no
--help Same as -h n/a
--prefix Set the target install directory /usr/local
--shrdir Set the shared install directory /usr/local/share
--altdir Set the alternate install directory /usr/local
--sdknam Set the target sdk by name platform dependent
--sdkdir Set the target sdk directory platform dependent
--ccname Set the default compiler platform dependent
--shared Compile and link dynamically yes
--static Compile and link statically no
--openmp Enable the optional openmp compilation no

The prefix option set the root installation directory. The binary and library installation directories are derived from it. The shrdir set the shared installation directory which is normally used for the installation of the manual pages on most popular systems. the altdir sets the alternate installation directory. Normally this path should be empty as it affects the path for the etc directory. This flag should be used when using a prefix to unusual destination. The ccname option can be used to force a particular compiler with the help of a compiler configuration file. The -s or --static option can be used to build a static executable. Normally, this option should not be used since it restrict the use of extension modules. The shared controls whether or not the dynamic libraries should be built. This option is detected automatically for a particular platform and should be used only by package maintainer. There exists also specific options which are mostly for package maintainers. At this time, the build process integrates the Debian, Ubuntu and Fedora specific packaging mechanism.

Option Description Default
--pkgnam Set the distribution package none
--pkgbin Set the optional package bin directory none
--pkglib Set the optional package lib directory none
--pkgprj Set the optional package prj directory none
--pkghdr Set the optional package hdr directory none
--pkgetc Set the optional package etc directory none
--pkgman Set the optional package man directory none
--pkgdoc Set the optional package doc directory none
--pkgwww Set the optional package www directory none
--pkgsrv Set the optional package srv directory none

1.2.4 - Compiling the distribution

The compilation process is straightforward. With some platforms, the make accepts the -j that enables concurrent operations.

 make [-j]

]]>
      

This will build the complete distribution locally. If an error occurs, it is best to report it at the AFNIX bug report mail address.

1.2.5 - Testing the distribution

The distribution contains all test suites. The test suites are compiled and executed with the following command.

 make test

]]>
      

This command run the test suites for each library as well as the test suites for each application client. Most of the base library test suites are written in C++ with the application test suites written in the core writing system.

1.2.6 - Installing the distribution

Once the system has been built and tested, it can be installed. By default, the distribution tree is installed into the /usr/local directory. This can be overwritten with the --prefix option during the configuration process.

 make install

]]>
      

There are several variables that controls the behavior of the install rule. Each variable has its default value sets during the setup configuration. However, this variable can also be altered during the installation process

Variable Description Default
PREFIX The root install directory /usr/local
SHRDIR The shared install directory /usr/local/share
ALTDIR The shared alternate directory /usr/local/etc
SDKDIR The system kit directory platform dependent
BINDIR The binary install directory prefix/bin
LIBDIR The library install directory prefix/lib
HDRDIR The header files install directory prefix/include/afnix
ETCDIR The extra files install directory altdir/etc/afnix

1.2.7 - Installing the documentation

The documentation is installed independently of the software. The doc rule builds the documentation and the publish rule installs the documentation. Several variables also control the documentation installation path.

Variable Description Default
DOCDIR The documentation install directory shrdir/doc/afnix
MANDIR The manual pages install directory shrdir/man

1.2.8 - Cleaning the distribution

The distribution is cleaned with the clean rule.

 make clean

]]>
      

This rule does not clean the configuration. For a complete cleaning the reset rule is more appropriate.

 make reset

]]>
      
1.3 - Running AFNIX

The axi command invokes the interpreter. In order to operate properly, the LD_LIBRARY_PATH environment variable must be configured with the directory containing the shared libraries. If the libraries have been installed in a standard location like /usr/local/lib , there is nothing to do.

1.3.1 - Running some examples

The directory exp contains various examples which can be run. Each example is labeled according to their use in the volume 1 of the documentation set. Example 0101.als prints the message hello world . Example 0501.als prints various information about the system configuration.

 axi EXP0501
major version number   : 4
minor version number   : 0
patch version number   : 0
interpreter version    : 4.0.0
program name           : axi
operating system name  : linux
operating system type  : unix
machine size           : 64
afnix official uri     : http://www.afnix.org

]]>
      
1.4 - Special features

The build process provides several features that permits to customize the compilation process as well as the nature of the final executable. Most of the time, these options are reserved for the package maintainer and are given below for illustration purpose.

1.4.1 - Special target extensions

Extensions are specific libraries or executables which are not build automatically during the build process. The user is responsible to decide which extension is needed for the system All extensions are located under the src/ext directory. Simply going into the appropriate directory and running the make command will build the extension.

The asi extension creates a static interpreter with all libraries automatically included in the final executable. The extension is simply build with the following command. Note that this extension overwrite the previous executable in the bld/bin directory.

 make -C src/ext/asi

]]>
      

1.4.2 - Extra files

The distribution comes with some extra files. The most important is the Emacs mode afnix-mode . The original source file is written in Emacs Lisp and is available in the etc directory of the distribution. This file should be installed according to the current Emacs installation.


2 - Maintainer notes

This chapter contains additional notes for the package maintainer. They are also useful for anybody who is in charge of integrating the distribution in a build process. The chapter describes the distribution tree with more details.

2.1 - The distribution tree

The distribution tree is composed of various directories. Each of them has a Makefile which can be called locally or from the top level.

The process of building a package solely depends on the distribution type. Most likely, the standard distribution should contain the binary executables as well as some configuration file and the manual pages. The documentation and the development header files can put in separate packages.

2.2 - Configuration and setup

The configuration process involves the use of the afnix-setup command located in the cnf/bin directory. This command is used to configure the distribution. Package maintainers are encouraged to use it with specific options.

2.2.1 - Platform detection

The afnix-guess command is used during the configuration process to detect a supported platform. This command can be run in stand-alone mode. Various options can be used to tune the type of information requested.

Option Description
-h Print a help message
-n Print the platform name
-v Print the platform version
-M Print the platform major number
-m Print the platform minor number
-p Print the processor name

Without option, the utility prints a platform and processor description string.

 ./cnf/bin/afnix-guess
linux-5.4-x64

]]>
      

2.2.2 - Platform defaults

The directory cnf/def contains a platform specific default file. The file determines what is the default compiler and linking mode. This file is used by the afnix-setup command. For example, the afnix-darwin.def file contains:


      

Such options instructs the configuration utility, that the default compiler is gcc and the linking mode should operates in dynamic mode by using the dylib rule. These default values can be overwritten with the equivalent option of the afnix-setup command. Note that the compiler version is automatically detected by the system. The afnix-vcomp command will return the appropriate compiler version running on the target system.

2.2.3 - C++ source file conventions

THe source tree has two types of C++ files. The first type has the extension .cxx and the second type has the extension .cpp . The .cxx -- and the associated .hxx -- files are only used to indicate a system dependency. These files are found only in the src/lib/plt directory. The .cxx extension indicates that the file might use system specific include files. The .cpp -- and the associated .hpp -- files are the normal C++ source files. The .cpp extension is used to indicate that these files will not use a system specific file. By default this rule is enforced in the compiler configuration file by specifying some compiler flags which do not authorize such access.

2.2.4 - Configuration files

The configurations files are located in the cnf/mak directory. Normally they should be left untouched. The most important one is the afnix-rule.mak file that defines most of the compilation and linking rules. Additionally, during the setup operation, the afnix-setup command creates several files in the bld/cnf directory. The bld is the build directory. The afnix-plat.mak file is the platform configuration file and the afnix-comp.mak is a link to the appropriate compiler configuration file.

2.3 - Compilation

Normally, the compilation process is immediate. Just invoking the make command will do the job. However, some package maintainer have the desire to overwrite some flags. Some options are provided to facilitate this task.

For example, it is common to have some maintainer to compile with both the debug and optimize flags. This can be done with the following command (assuming an optimized configuration):


      

All include files, compiled libraries and executables are placed in the bld directory. This directory contains the bld/bin for binaries, bld/lib for libraries and bld/hdr for the header files.

2.4 - Building the package

The package can be built by accessing the bld directory or by invoking the install rule. The second method is not recommended for package construction, since it might trigger some file installation without any control.

The etc/unx directory contains some special files that might be used for the package construction. A sample list of them is given hereafter.

2.5 - Specific makefile rules

The top level Makefile contains several rules that might be useful for the package maintainer.


3 - Release notes

This chapter contains the release notes for the different releases. Release notes are given in descending order for a particular version. The standard notation is major.minor.patch which represents respectively, the major, minor and patch number. A major version number changes indicates a substantial change in the distribution, including new tools, application interface and license. A minor version number change indicates noticeable change, with or without new tools but without application interface change nor license change. Finally, a patch number change indicates a simple change to fix problem. There is no additional features in a patch nor an application interface change.

3.1 - Release 4.0
3.2 - Release 3.9
3.3 - Release 3.8
3.4 - Release 3.7
3.5 - Release 3.6
3.6 - Release 3.5
3.7 - Release 3.4
3.8 - Release 3.3
3.9 - Release 3.2
3.10 - Release 3.1
3.11 - Release 2.9
3.12 - Release 2.8
3.13 - Release 2.7
3.14 - Release 2.6
3.15 - Release 2.5
3.16 - Release 2.4
3.17 - Release 2.3
3.18 - Release 2.2
3.19 - Release 2.1
3.20 - Release 2.0
3.21 - Release 1.9
3.22 - Release 1.8
3.23 - Release 1.7
3.24 - Release 1.6
3.25 - Release 1.5
3.26 - Release 1.4
3.27 - Release 1.3
3.28 - Release 1.2
3.29 - Release 1.1
3.30 - Release 1.0

The 1.0 release is the initial release. This release replaces the old ALEPH programming language which has been discontinued.