## Compiling and Installing

Installation — Instructions for compilation and installation

## Prerequisites

The NumCosmo library depends on several other libraries, most of them are commonly found on most modern linux distributions. Their description are here: Library Dependencies.

For Debian like systems (including Ubuntu) it is necessary to install the following prerequisite packages:

• For most systems the following packages can be found in the main repositories: gobject-introspection, gir1.2-glib-2.0, libgirepository1.0-dev, gcc, pkg-config, libglib2.0-dev, libgmp3-dev, libmpfr-dev, libgsl0-dev, libsqlite3-dev, libfftw3-dev.

If you want to build from the repository you also need: autotools-dev, libtool, gtk-doc-tools.

• The other packages are usually not found on the official repositories.

• For atlas support on Debian see: http://wiki.debian.org/DebianScience/LinearAlgebraLibraries.
• For atlas support on Ubuntu you need something similar to: libatlas-base-dev, liblapack-dev.

They also have versions optimized to some processors, however, ideally you should compile these packages locally to take full advantage of you system.

• The other packages sometimes can be found with the following package names: libnlopt-dev, libsundials-dev, libcfitsio3-dev, libcuba3-dev.

The packages above also support the usual: configure; make; make install (however, see NumCosmo compilation)

For RPM based distributions (including Fedora, OpenSuse, etc) it is necessary to install the following prerequisite packages:

• For most systems the following packages can be found in the main repositories: pkg-config, gobject-introspection-devel, glib2-devel, gsl-devel, gmp-devel, mpfr-devel, fftw3-devel, sqlite3-devel.

If you want to build from the repository you also need: autoconf, automake, libtool, gtk-doc.

• The other packages are usually not found on the official repositories.

• The other packages sometimes can be found with the following package names: nlopt-devel, sundials-devel, libcfitsio-devel, lapack-devel, atlas-devel, lapack-devel.

Most of the packages above also support the usual: configure; make; make install (however, see NumCosmo compilation)

## NumCosmo compilation

You can also obtain the sources directly from the git repository, for example the command:

 1  git clone git://git.sv.gnu.org/numcosmo.git 

For the version cloned from the repository it is necessary to first build the configure script, to do that, execute:

 1  NOCONFIGURE=yes ./autogen.sh 
this command requires additional dependencies cited above. Note that if you don't want to develop the library itself you probably want to get a release from the link above where the configure script is already built and, therefore, there is no need of additional dependencies.

To prepare the project for compilation one can run from the sources directory

 1  ./configure --prefix=/usr --libdir=/usr/lib 
in the command above the installation prefix and library directories are explicit set, this is necessary to install the gobject typelibs in the correct path and allow its usage.

Note also that for some 64 bits system the library directory is /usr/lib64 and, therefore, in this case the command above must be properly modified. In the default directory organization the bindings typelibs stay in /usr/lib/girepository-1.0/ and the bindings xml in /usr/share/gir-1.0/. You can look for these directories to check where the system bindings are located to determine the correct directories to pass to the configure script.

 1  ./configure --help 

After running successfully the configure script the library can be compile by running

 1  make -j4 
where the -j4 tells make to run four parallel compilation. It can be used to take advantage of system with multiple cores.

To check if everything went ok, run

 1  make check 
and to install in your system
 1  make install 
note that, for the last command, the user must have root privileges to install the library in the system.