This section describes how to install the CLN package on your system.
To build CLN, you need a C++ compiler.
Actually, you need GNU g++ 2.7.0
or newer.
On HPPA, you need GNU g++ 2.8.0
or newer.
I recommend GNU g++ 2.95
or newer.
The following C++ features are used: classes, member functions, overloading of functions and operators, constructors and destructors, inline, const, multiple inheritance, templates.
The following C++ features are not used:
new
, delete
, virtual inheritance,
exceptions.
CLN relies on semi-automatic ordering of initializations of static and global variables, a feature which I could implement for GNU g++ only.
To build CLN, you also need to have GNU make
installed.
To build CLN on HP-UX, you also need to have GNU sed
installed.
This is because the libtool script, which creates the CLN library, relies
on sed
, and the vendor's sed
utility on these systems is too
limited.
As with any autoconfiguring GNU software, installation is as easy as this:
$ ./configure $ make $ make check
If on your system, `make' is not GNU make
, you have to use
`gmake' instead of `make' above.
The configure
command checks out some features of your system and
C++ compiler and builds the Makefile
s. The make
command
builds the library. This step may take 4 hours on an average workstation.
The make check
runs some test to check that no important subroutine
has been miscompiled.
The configure
command accepts options. To get a summary of them, try
$ ./configure --help
Some of the options are explained in detail in the `INSTALL.generic' file.
You can specify the C compiler, the C++ compiler and their options through
the following environment variables when running configure
:
CC
CFLAGS
CXX
CXXFLAGS
Examples:
$ CC="gcc" CFLAGS="-O" CXX="g++" CXXFLAGS="-O" ./configure $ CC="gcc -V 2.7.2" CFLAGS="-O -g" \ CXX="g++ -V 2.7.2" CXXFLAGS="-O -g" ./configure $ CC="gcc -V 2.8.1" CFLAGS="-O -fno-exceptions" \ CXX="g++ -V 2.8.1" CXXFLAGS="-O -fno-exceptions" ./configure $ CC="gcc -V egcs-2.91.60" CFLAGS="-O2 -fno-exceptions" \ CXX="g++ -V egcs-2.91.60" CFLAGS="-O2 -fno-exceptions" ./configure
Note that for these environment variables to take effect, you have to set
them (assuming a Bourne-compatible shell) on the same line as the
configure
command. If you made the settings in earlier shell
commands, you have to export
the environment variables before
calling configure
. In a csh
shell, you have to use the
`setenv' command for setting each of the environment variables.
On Linux, g++
needs 15 MB to compile the tests. So you should better
have 17 MB swap space and 1 MB room in $TMPDIR.
If you use g++
version 2.7.x, don't add `-O2' to the CXXFLAGS,
because `g++ -O' generates better code for CLN than `g++ -O2'.
If you use g++
version 2.8.x or egcs-2.91.x (a.k.a. egcs-1.1) or
gcc-2.95.x, I recommend adding `-fno-exceptions' to the CXXFLAGS.
This will likely generate better code.
If you use g++
version egcs-2.91.x (egcs-1.1) or gcc-2.95.x on Sparc,
add either `-O' or `-O2 -fno-schedule-insns' to the CXXFLAGS.
With full `-O2', g++
miscompiles the division routines. Also, for
--enable-shared to work, you need egcs-1.1.2 or newer.
By default, only a static library is built. You can build CLN as a shared
library too, by calling configure
with the option `--enable-shared'.
To get it built as a shared library only, call configure
with the options
`--enable-shared --disable-static'.
If you use g++
version egcs-2.91.x (egcs-1.1) on Sparc, you cannot
use `--enable-shared' because g++
would miscompile parts of the
library.
Starting with version 1.0.4, CLN may be configured to make use of a
preinstalled gmp
library. Please make sure that you have at
least gmp
version 3.0 installed since earlier versions are
unsupported and likely not to work. Enabling this feature by calling
configure
with the option `--with-gmp' is known to be quite
a boost for CLN's performance.
If you have installed the gmp
library and its header file in
some place where your compiler cannot find it by default, you must help
configure
by setting CPPFLAGS
and LDFLAGS
. Here is
an example:
$ CC="gcc" CFLAGS="-O2" CXX="g++" CXXFLAGS="-O2 -fno-exceptions" \ CPPFLAGS="-I/opt/gmp/include" LDFLAGS="-L/opt/gmp/lib" ./configure --with-gmp
As with any autoconfiguring GNU software, installation is as easy as this:
$ make install
The `make install' command installs the library and the include files
into public places (`/usr/local/lib/' and `/usr/local/include/',
if you haven't specified a --prefix
option to configure
).
This step may require superuser privileges.
If you have already built the library and wish to install it, but didn't
specify --prefix=...
at configure time, just re-run
configure
, giving it the same options as the first time, plus
the --prefix=...
option.
You can remove system-dependent files generated by make
through
$ make clean
You can remove all files generated by make
, thus reverting to a
virgin distribution of CLN, through
$ make distclean
Go to the first, previous, next, last section, table of contents.