Installing software from the plain source code can be a quite tedious job. So if you are a normal user and have never compiled a program from its source code by yourself you are maybe on the wrong page.
To build the source distribution some programs must be installed
In addition to this programs a couple of libraries are needed
If you are a Linux user you are most probably on the lucky side since most of these programs are included in the package library of modern Linux distributions. For Windows the situation is more difficult. Windows users may lookup the installation procedure for all of the required tools and libraries on the project sites of the software.
Once all dependencies (see above) are satisfied one can start with the build. To simply build the code run
$>scons
in the root directory of the source tree. Scons tries to do some auto-configuration to find out if you have all necessary libraries installed and adds them to the link list if it can find them. If you have libraries installed in non-standard locations you can use several build variables on the command line to let scons know where to look for them. There are basically three of these build variables
For all three variables the build system will assume that libraries are installed under /lib and header files below /include with respect to the installation prefix.
If you have, for instance, BOOST installed below /opt/boost you can use the following command line to build libpninx
$>scons BOOSTPREFIX=/opt/boost
To install the code use
$> scons install
Which will try to install the library along with its development files and documentation below the default installation prefix which is /usr on Linux systems. Clearly you need administrative permissions to install software at this location (in other words: you must be root). If you want to install the library to a different location the PREFIX build variable can be used. For instance
$> scons PREFIX=/opt/pninx install
will install everything below /opt/pninx. There are three other installation related build variables which allow fine grained control over where code will be installed
LIBDIR - installation path for librariesINCDIR - installation path for header filesDOCDIR - installation path for documentationThese build variables override the PREFIX variable. For instance if you use
$> scons PREFIX=/usr/local LIBDIR=/usr/local/lib64 install
Everything goes below /usr/local but the libraries will not be installed in /usr/local/lib but in /usr/local/lib64.
In the examples above scons was always called without a particular target. In such a case the default target all. There are several other targets available
library - which will only build the library codetest - for only building test codedoc - builds the API documentationinstall - installs the package (and runs a build if it has not been done yet)pdfdoc - build PDF documentation (users and administrators guide)pdfdocinstall - installs the PDF documentation.The default target all is equivalent to calling
$> scons library test doc
The PDF documentation is not built (and thus not installed) by default in order to ensure a successful build even on machines with an outdated Latex installation.
Not done yet.