Installing kratos in Ubuntu Linux
The objective of current tutorial is to "standardize" the installation of Kratos on an Ubuntu system. Please note that 90% of the operations described are necessary for the installation of libraries in the system rather than for the compilation of the Kratos itself.
Contents |
SYSTEM LIBRARIES INSTALL
Set the download server to "main server". This can be done operning the Synaptic Package Manager and going to Settings-Repository : in the section Ubuntu Software change the option Download from: Main server
we detail here the installation of some basic packages. Note that not all of the packages are strictly needed however our advice is to install all of them if you are not sure of what you are doing
essential packages:
sudo apt-get install -y build-essential sudo apt-get install -y subversion sudo apt-get install -y rapidsvn sudo apt-get install -y libblas3gf sudo apt-get install -y liblapack3gf sudo apt-get install -y libblas-dev sudo apt-get install -y liblapack-dev sudo apt-get install -y python-dev sudo apt-get install -y gfortran sudo apt-get install -y csh sudo apt-get install -y swig sudo apt-get install -y python-matplotlib
useful packages (not strictly needed for the kratos):
sudo apt-get install -y emacs sudo apt-get install -y kate sudo apt-get install -y python-scipy sudo apt-get install -y python-numpy sudo apt-get install -y python-scientific
sudo apt-get install -y g++ sudo apt-get install -y python
IF YOU DON'T NEED MPI
BOOST library:
You can download the late release of boost libraries from boost web page or you can use directly the boost libraries that you find in the repositories by typing
sudo apt-get install libboost-all-dev sudo apt-get install libboost-dbg
IF YOU NEED MPI
install the packages
sudo apt-get install -y openmpi-bin sudo apt-get install -y openmpi-dev sudo apt-get install -y libparmetis3.1 sudo apt-get install -y libparmetis-dev
then install the boost_mpi packages:
sudo apt-get install libboost-mpi-python-dev sudo apt-get install libboost-mpi-pythonX.XX.XX
note that the X.XX.X is to be replaced with the version of the lib that comes with the system
ALTERNATIVELY, and just if you have a very good reason to do it, you can compile manually the boost library including mpi, which can be done by following the instructions at How to compile the Boost if you want to use MPI
GET KRATOS
Follow the instructions of How to get Kratos to create your local kratos copy.
Kratos Libraries
The installer now performs automatically the compilation of the libraries needed
COMPILE THE KRATOS
The compilation of the Kratos is now cmake-based. Cmake can be installed in the system by simply typing
sudo apt-get install cmake
HOWEVER please note that cmake is improving very fast and the "cmake-experience" improves with every release, as a consequence we advise to download and install the latest cmake release
once cmake is installed in the system go to the directory
cd cmake_build
then copy
cp example_configure.sh.do_not_touch configure.sh
edit "configure.sh" to activate libs as you wish (or leave it as it is for the defaults), and finally run
sh configure.sh
and the kratos should compile and install
Detailed README instructions are available in the directory "cmake_build"
CREATE IN DEBUG
Debug compilation can be obtained by simply substituting "Release" --> "Debug" within your "configure.sh". Alternative options are "RelWithDebInfo" and "MinSizeRel"
If you want to have available both a release build and a debug build, just create another directory (say cmake_debug_build), copy into it your configure file and run it from that directorye
FINAL STEP
you have to let the system know where the kratos is installed
this can be done by adding the line (assuming kratos is installed in "${HOME}/kratos/libs"
export PYTHONPATH=${HOME}/kratos/libs:$PYTHONPATH export PYTHONPATH=${HOME}/kratos:$PYTHONPATH
to the ".bashrc" (a hidden configuration file in the home directory)
Additionally you may have to add your "${HOME}/kratos/libs" directory to LD_LIBRARY_PATH. This can be done adding these lines:
export LD_LIBRARY_PATH=${HOME}/kratos/libs:$LD_LIBRARY_PATH
to the ".bashrc"