5.2 Variants of the Libraries

The distribution of the Aldor libraries comes in three variants:

All these variants are not compatible with each other.

ALLPROSE provides a simple mechanism for several variants of the project and testcases library which are built on the corresponding Aldor libraries. The following variable specifies which library variants should be built.

ToDo 2 Must change include/myalps.as.nw and tools/generateTestCases.pl.nw if we have other POSTFIXes than "d", "-gmp", or "".

We would rather like to suggest that all variants of libraries come with the same name but are collected in different subdirectories, i. e., all libraries related to the debug version should go into $ALDORROOT/lib/debug, all libraries related to the GMP version should go under $ALDORROOT/lib/gmp. In these directories the libraries should all have the same name. For example, instead of libalgebra.al, libalgebrad.al, and libalgebra-gmp.al in the directory lib, we would have libalgebra.al in the subdirectories lib/ordinary, lib/debug, and lib/gmp. In that way the corresponding file include/algebra.as could be made a bit simpler.

ToDo 3 Currently, there is some restriction on the variants, since the include files include/myalps.as.nw and include/testcases.as select the library name only depending on the Aldor command line switches -dDEBUG and -dGMP.
27library variants 27  (21)  30
VARIANTSTOBUILD=debug
# ordinary
# gmp

Defines:
VARIANTSTOBUILD, never used.

The above value of VARIANTSTOBUILD can be any value xxx as long as there are corresponding variables VARIANTPOSTFIXxxx and VARIANTFLAGSxxx etc.

For each of the variants there are four variables. They are put on the command line for the specific variant as can be seen in the targets libraryvariant.% and executablevariant.% in Makefile.inc.nw.

If there is some need to have specific flags for certain executables, it is possible to define them through a variable VARIANTSOMENAMEFLAGSxxx where SOMENAME has to be replaced by the actual name of the specific executable (without any variant postfix). For example if the name of the executable is Foo, and it needs the flags ’-Dbar -Drandom’ for the ordinary variant. Then one would have to define the following variable.

VARIANTFooFLAGSordinary=-Dbar -Drandom

Of course this limits the possible names of executables, since their names appear as substrings in a Makefile variable.

30library variants 27+   (21)  27
VARIANTPOSTFIXordinary=
VARIANTASSERTIONordinary=
VARIANTFLAGSordinary=-q3 -qinline-all -lalgebra -laldor
VARIANTEXECUTABLEFLAGSordinary=

VARIANTPOSTFIXgmp=-gmp
VARIANTASSERTIONgmp=-dGMP
VARIANTFLAGSgmp=-q3 -qinline-all -lalgebra-gmp -laldor
VARIANTEXECUTABLEFLAGSgmp=-Cruntime=foam-gmp,gmp,m

VARIANTPOSTFIXdebug=d
VARIANTASSERTIONdebug=-dDEBUG
VARIANTFLAGSdebug=-q1 -lalgebrad -laldord
VARIANTEXECUTABLEFLAGSdebug=

Defines:
VARIANTASSERTION, never used.
VARIANTEXECUTABLEFLAGS, never used.
VARIANTFLAGS, never used.
VARIANTPOSTFIX, never used.