[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.2 Configuration
To configure GiNaC means to prepare the source distribution for
building. It is done via a shell script called configure
that
is shipped with the sources and was originally generated by GNU
Autoconf. Since a configure script generated by GNU Autoconf never
prompts, all customization must be done either via command line
parameters or environment variables. It accepts a list of parameters,
the complete set of which can be listed by calling it with the
‘--help’ option. The most important ones will be shortly
described in what follows:
- ‘--disable-shared’: When given, this option switches off the build of a shared library, i.e. a ‘.so’ file. This may be convenient when developing because it considerably speeds up compilation.
- ‘--prefix=PREFIX’: The directory where the compiled library and headers are installed. It defaults to ‘/usr/local’ which means that the library is installed in the directory ‘/usr/local/lib’, the header files in ‘/usr/local/include/ginac’ and the documentation (like this one) into ‘/usr/local/share/doc/GiNaC’.
- ‘--libdir=LIBDIR’: Use this option in case you want to have the library installed in some other directory than ‘PREFIX/lib/’.
- ‘--includedir=INCLUDEDIR’: Use this option in case you want to have the header files installed in some other directory than ‘PREFIX/include/ginac/’. For instance, if you specify ‘--includedir=/usr/include’ you will end up with the header files sitting in the directory ‘/usr/include/ginac/’. Note that the subdirectory ‘ginac’ is enforced by this process in order to keep the header files separated from others. This avoids some clashes and allows for an easier deinstallation of GiNaC. This ought to be considered A Good Thing (tm).
- ‘--datadir=DATADIR’: This option may be given in case you want to have the documentation installed in some other directory than ‘PREFIX/share/doc/GiNaC/’.
In addition, you may specify some environment variables. CXX
holds the path and the name of the C++ compiler in case you want to
override the default in your path. (The configure
script
searches your path for c++
, g++
, gcc
,
CC
, cxx
and cc++
in that order.) It may
be very useful to define some compiler flags with the CXXFLAGS
environment variable, like optimization, debugging information and
warning levels. If omitted, it defaults to ‘-g
-O2’.(1)
The whole process is illustrated in the following two
examples. (Substitute setenv VARIABLE value
for
export VARIABLE=value
if the Berkeley C shell is
your login shell.)
Here is a simple configuration for a site-wide GiNaC library assuming everything is in default paths:
$ export CXXFLAGS="-Wall -O2" $ ./configure |
And here is a configuration for a private static GiNaC library with several components sitting in custom places (site-wide GCC and private CLN). The compiler is persuaded to be picky and full assertions and debugging information are switched on:
$ export CXX=/usr/local/gnu/bin/c++ $ export CPPFLAGS="$(CPPFLAGS) -I$(HOME)/include" $ export CXXFLAGS="$(CXXFLAGS) -DDO_GINAC_ASSERT -ggdb -Wall -pedantic" $ export LDFLAGS="$(LDFLAGS) -L$(HOME)/lib" $ ./configure --disable-shared --prefix=$(HOME) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |