[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes how to install the CLN package on your system.
2.1 Prerequisites | ||
2.2 Building the library | ||
2.3 Installing the library | ||
2.4 Cleaning up |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.1.1 C++ compiler | ||
2.1.2 Make utility | ||
2.1.3 Sed utility |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To build CLN, you need a C++ compiler.
Actually, you need GNU g++ 3.0.0
or newer.
The following C++ features are used: classes, member functions, overloading of functions and operators, constructors and destructors, inline, const, multiple inheritance, templates and namespaces.
The following C++ features are not used:
new
, delete
, virtual inheritance.
CLN relies on semi-automatic ordering of initializations of static and global variables, a feature which I could implement for GNU g++ only. Also, it is not known whether this semi-automatic ordering works on all platforms when a non-GNU assembler is being used.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To build CLN, you also need to have GNU make
installed.
Only GNU make
3.77 is unusable for CLN; other versions work fine.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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 about half an hour 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
Specifies the C compiler.
CFLAGS
Flags to be given to the C compiler when compiling programs (not when linking).
CXX
Specifies the C++ compiler.
CXXFLAGS
Flags to be given to the C++ compiler when compiling programs (not when linking).
CPPFLAGS
Flags to be given to the C/C++ preprocessor.
Examples:
$ CC="gcc" CFLAGS="-O" CXX="g++" CXXFLAGS="-O" ./configure |
$ CC="gcc -V 3.2.3" CFLAGS="-O2 -finline-limit=1000" \ CXX="g++ -V 3.2.3" CXXFLAGS="-O2 -finline-limit=1000" \ CPPFLAGS="-DNO_ASM" ./configure |
$ CC="gcc-4.2" CFLAGS="-O2" CXX="g++-4.2" CXXFLAGS="-O2" ./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.
Currently CLN works only with the GNU g++
compiler, and only in
optimizing mode. So you should specify at least -O
in the
CXXFLAGS, or no CXXFLAGS at all. If CXXFLAGS is not set, CLN will be
compiled with -O
.
The assembler language kernel can be turned off by specifying
-DNO_ASM
in the CPPFLAGS. If make check
reports any
problems, you may try to clean up (see Cleaning up) and configure
and compile again, this time with -DNO_ASM
.
If you use g++
3.2.x or earlier, I recommend adding
`-finline-limit=1000' to the CXXFLAGS. This is essential for good
code.
If you use g++
from gcc-3.0.4 or older on Sparc, add either
`-O', `-O1' or `-O2 -fno-schedule-insns' to the
CXXFLAGS. With full `-O2', g++
miscompiles the division
routines. Also, do not use gcc-3.0 on Sparc for compiling CLN, it
won't work at all.
Also, please do not compile CLN with g++
using the -O3
optimization level. This leads to inferior code quality.
Some newer versions of g++
require quite an amount of memory.
You might need some swap space if your machine doesn't have 512 MB of
RAM.
By default, both a shared and a static library are built. You can build
CLN as a static (or shared) library only, by calling configure
with the option `--disable-shared' (or `--disable-static').
While shared libraries are usually more convenient to use, they may not
work on all architectures. Try disabling them if you run into linker
problems. Also, they are generally slightly slower than static
libraries so runtime-critical applications should be linked statically.
2.2.1 Using the GNU MP Library |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Starting with version 1.1, CLN may be configured to make use of a
preinstalled gmp
library for some low-level routines. Please
make sure that you have at least gmp
version 3.0 installed
since earlier versions are unsupported and likely not to work. This
feature is known to be quite a boost for CLN's performance.
By default, CLN will autodetect gmp
and use it. But 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:
$ CFLAGS="-O2" CXXFLAGS="-O2" CPPFLAGS="-I/opt/gmp/include" \ LDFLAGS="-L/opt/gmp/lib" ./configure --with-gmp |
If you do not want CLN to make use of a preinstalled gmp
library, then you can explicitly specify so by calling
configure
with the option `--without-gmp'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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 |
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Richard B. Kreckel on January, 19 2008 using texi2html 1.76.