Configuration and installation of a |
To run the configuration of a
If the packages depends on external libraries or tools, they will be checked during the configuration step. The installation instructions of each package describe what should be installed.
A
cd <path_to_build>
cmake <pkg_dir>
make
Before starting, here some warnings on the configuration steps with cmake: it uses a cache file CMakeCache.txt to store the values of the configuration variables. Thus if you need to redo the configuration step from scratch, you have to clean this file:
rm CMakeCache.txt; cmake <pkg_dir>
A convenient and safe way is to do it systematically and to use the following alias:
alias CMake='rm -f CMakeCache.txt; cmake'
That is what we will do in the following.
If on the contrary, you want to keep or edit the configuration variables, you can use ccmake interface and have access to the stored value of these configuration variables and change them:
ccmake .
By default, each package provides a library of the same name. The option which controls the construction of libraries is LIBS. The default value is LIBS=ON. If it is turned OFF, then the other options TEST, GLUE, APP, BENCH will also be turned OFF. Here is how it can be turned OFF:
CMake <pkg_dir> -DLIBS=OFF
The option which controls the test is TEST. To build these tests, you have to assign TEST=ON. The default value is TEST=OFF. Here is how it can be set:
CMake <pkg_dir> -DTEST=ON
make test
This will create in the executable tests in ./test.
The option which controls the construction of the applications from the folder app is APP. The default value is APP=ON. Here is how it can be turned off:
CMake <pkg_dir> -DAPP=OFF
make
If the application executables are built, they are put in the folder ./bin.
The option which controls the construction of a module for the
CMake <pkg_dir> -DGLUE=ON
make
This will create a module in the folder ./lib.
The option which controls the construction of modules for
CMake <pkg_dir> -DAXEL=ON
make
This will create plugins which will put in the folder plugins of the application axel.
To construct the documentation, you need also to have texmacs and doxygen installed. The variable which control the generation of the documentation is DOC. You can use the commands:
CMake <pkg_dir> -DDOC=ON
make
This will create a folder ./html/pkg which contain the html documentation.
When the package contains subpackages, if the option for a subpackage say pkg1 is ON, then all the other subpackages on which pkg1 depends are turned ON. If the option for the subpackage pkg1 is OFF, then all the other subpackages which depend on pkg1 are turned OFF. If the mode DEV is turned ON, there is no default subpackage selection. In this case, to use a subpackage, the corresponding option has to be turned ON explicitely:
CMake <pkg_dir> -DDEV=ON -DNUMERIX=ON
Some of the packages on which the libraries depend may be external to the distribution. To know which are the external packages, see the file mmxtools/mmx/download_table.mmx. These external packages are usually installed globally in the environment but in some cases it is necessary to configure and compile them directly. Such external libraries will be downloaded, configured and built if the option EXTERNAL passed to cmake is ON:
CMake -DEXTERNAL=ON ../pkg
The corresponding libraries and headers will be installed in the folder include, lib where cmake is used.
In the case of numerix, it depends on two external libraries: gmp for integer and rational numbers, mpfr for floating point numbers. If they are not installed globally, theey will be downloaeded and built if the option EXTERNAL is turned ON.
Once cmake is run, the command make can be used:
make
To see more details on the command that are run to build files, one can use the option VERBOSE:
make VERBOSE=1
To see the available targets of the make command, use
make help
To specify the place where you install the package, use CMAKE_INSTALL_PREFIX:
CMake <pkg_dir> -DCMAKE_INSTALL_PREFIX=$HOME/local make && make install
If the variable CMAKE_INSTALL_PREFIX is not specified, the package will be installed with the prefix /urs/local (if you don't have the permission to write in this directory, you can use sudo make install).
To see the other available targets, you can use:
make help