LinuxInstall

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
(Replaced content with "The information in this page was moved to GitHub: https://github.com/KratosMultiphysics/Kratos/wiki/Linux-Build")
 
(68 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== Install Kratos the easy way ==
+
The information in this page was moved to GitHub: https://github.com/KratosMultiphysics/Kratos/wiki/Linux-Build
If you are the owner of an Ubuntu-based linux machine, then you can directly install a .deb file. Such package ( [http://kratos.cimne.upc.es/attachments/download/385/KratosMultiphysics-3.0.0.deb Download] ) automatically installs the Kratos together with all of the libraries necessary for its correct usage and leaves the
+
system ready for being used.
+
 
+
== Compile your own version of Kratos ==
+
Developers, users of non-ubuntu machines and sudoers are expected to download and compile the source files.
+
 
+
 
+
'''This tutorial assumes that a reasonably modern distribution is being used'''. Older versions may require compiling some of the files "by hand"
+
 
+
One should begin by the installation of the '''prerequisites''', that is, of the libraries that are not part of the Kratos but that are needed for its compilation.
+
 
+
'''The installation of such prerequisites is described at [[Install Kratos Prerequisites]].  '''
+
 
+
 
+
All of the kratos installation is based on the use of "cmake" for which a modern version is needed.
+
 
+
Since "'''cmake'''" is continuosly being improved we advice the user to get and install the most modern version.
+
 
+
You can follow an installation guide here '''[[InstallCmake]].'''
+
 
+
 
+
 
+
 
+
 
+
At this point we are finally ready to install the '''Kratos'''.
+
Let's assume that we are in the current user's home directory:
+
 
+
  $HOME/
+
 
+
We shall first of all get a clean version by downloading from the repository.
+
 
+
  mkdir kratos
+
  cd kratos
+
  svn checkout <nowiki>https://svn.cimne.upc.edu/p/kratos/kratos</nowiki> "."
+
 
+
we can finally proceed to the compilation of the files. The idea is that each user can write a configuration file and activate or deactivate the
+
applications to be included.
+
 
+
In order to simplify the compilation an example configuration file is provided in the directory "cmake_build".
+
 
+
The user is expected to make a copy of the example file and to change it according to his needs
+
 
+
  cd cmake_build
+
  cp example_configure.sh.do_not_touch configure.sh
+
 
+
now it is possible to edit the configuration file to modify it as needed. Applications are activated by setting them to ON and deactivated by setting them to OFF.
+
 
+
while the current configuration is designed to work "out-of-the-box" on ubuntu, on other systems one may be required to tell the cmake the position of the libraries.
+
The file '''README''' included in the cmake_build directory attempts to cover the common cases.
+
 
+
Once this is done we can proceed to the compilation by doing
+
 
+
  sh configure.sh
+
 
+
which, if completed correctly, is expected to compile the kratos and install it in the directory where it was downloaded, that is
+
 
+
  $HOME/kratos
+
 
+
 
+
In order to be able to use the Kratos we need now to tell to the system's python installation where to find the Kratos libraries. This can be done by setting the environment variable '''PYTHONPATH''' and '''LD_LIBRARY_PATH'''
+
 
+
by appending the Kratos installation directory to the existing path information by typing:
+
 
+
  echo "export PYTHONPATH=${HOME}/kratos:$PYTHONPATH" >> $HOME/.bashrc
+
  echo "export LD_LIBRARY_PATH=${HOME}/kratos/libs:$LD_LIBRARY_PATH" >> $HOME/.bashrc
+
 
+
The previous shell command adds one line at the end of the file '.bashrc', located in your home folder.
+
 
+
Refresh the environment variables values by typing:
+
 
+
  source ~/.bashrc
+
 
+
=== Prescribing a different installation path ===
+
The cmake provides the possibility of prescribing a different installation path for Kratos
+
 
+
this can be done for example by adding the line
+
  -DKRATOS_INSTALL_PREFIX="/path/to/my/kratos/installation" \
+
  -DINSTALL_PYTHON_FILES=ON \
+
to your "configure.sh", so to instruct to install the Kratos in the specified directory.
+
 
+
{{Warning|
+
* Cmake requires all definitions in a single line! The line concatenation character '\' therefore MUST NOT be followed by any whitespace in the same line as this would prevent the cmake from running the lines below
+
}}
+
 
+
Of course, if this is done, the PYTHONPATH environment variable should be modified accordingly (for example as)
+
  export PYTHONPATH=/path/to/my/kratos/installation/:$PYTHONPATH
+
 
+
 
+
=== Preparing a deb package ===
+
Kratos can be configured to generate deb packages. In order to do this, the
+
installation directory '''has to be set''' to "/opt/kratos" by adding
+
  -DKRATOS_INSTALL_PREFIX="/opt/kratos" \
+
  -DINSTALL_PYTHON_FILES=ON \
+
 
+
to our "configure.sh" configuration file.
+
 
+
The debian package is then generated by:
+
    make package
+
 
+
== Installation problems ==
+
If you have two different Python versions installed on your computer it may appear a problem. To solve it the path to Python library should be specified by adding
+
to "configure.sh" configuration file for example
+
  -DPYTHON_LIBRARY="/usr/lib/python2.7/config/libpython2.7.so" \
+
  -DPYTHON_INCLUDE_DIR="/usr/include/python2.7"
+

Latest revision as of 08:38, 2 July 2018

The information in this page was moved to GitHub: https://github.com/KratosMultiphysics/Kratos/wiki/Linux-Build

Personal tools
Categories