Wiki

Clone wiki

lifev-release / lifev-env

Go back


LifeV environment

In order to simplify the configuration of LifeV and the installation of the necessary third-part libraries, we suggest to setup a LifeV environment and develop within the environment.

Firstly, clone the environment repository and enter the new directory:

$ git clone https://bitbucket.org/lifev-dev/lifev-env.git
$ cd lifev-env

If you are a lifev-developer, clone with the following command instead:

$ git clone git@bitbucket.org:lifev-dev/lifev-env
$ cd lifev-env

Scope of the enviroment is to give a standardized structure of the directories of development and building of LifeV and a standard set of configuration and build scripts for the external libraries.


Compilation of the third-part libraries

Trilinos and LifeV require some third-part libraries to be built. In particular, the following packages are required:

  • cmake: usually already present in the system, it is used for configuring and creating the necessary makefiles for building the source code

  • openblas: low level linear algebra package, providing both BLAS and LAPACK bindings

  • boost: collection of utility libraries

  • metis: graph partitioning library

  • parmetis: parallel version of metis

  • hdf5: management of the HDF5 file format for storing data (usually simulation results)

  • suitesparse: linear algebra library with linear solvers and utilities

NOTE: one of the principal aim of the scripts is to provide the ability to control the compilation of the libraries, their linking and the inter-dependencies. This is essential both to avoid linking errors and also runtime issues, which can be extremely difficult to debug (happening, for example, when mixing libraries provided system-wide and libraries compiled manually).

NOTE: the build scripts are just an example provided for helping users to build the third-part libraries. They are written to be readable and maintainable. Therefore, it could happen that a script needs to be modified in order to work properly on a particular machine or setup. However, we invite the people using the scripts to provide their changes to the community by committing them and opening appropriate pull-requests.

Under the directory ./libs a set of example build scripts is provided. To compile the libraries:

  • Enter the directory ./libs

  • Copy the file config_example.sh to config.sh

  • Customize the configuration file config.sh with the compiler to use and the wanted versions of the libraries. When compiling on a personal machine, usually the settings can be left at the default values. If the system provides (a sufficiently updated) cmake it can be used by uncommenting the corresponding line in config.sh, otherwise it can be downloaded and built as the other libraries.

    NOTE: the config_example.sh file is prepared with default settings suitable for personal machines. If compiling on a cluster, the settings have to be modified in order to use the right compilers and the provided modules and precompiled libraries.

  • The directory structure is as follows:

    • Directory ./packages, where the downloaded packages are stored

    • Directory ./sources, where the source code is extracted from the packages

    • Directory ./builds, containing the build files for the libraries

    • Directory./installs, with the final installation of the libraries

  • Compile the libraries in the following order:

    • Execute ./build_cmake.sh (if it is necessary to download and build cmake)

    • Execute ./build_openblas.sh (even if the system provides version of the BLAS and LAPACK libraries it may be better to have full control on them, by compiling an own version of them; on a cluster it is better to use the installed modules, if provided)

    • Execute ./build_boost.sh

    • Execute ./build_metis.sh

    • Execute ./build_parmetis.sh

    • Execute ./build_hdf5.sh

    • Execute ./build_suitesparse.sh

    • Execute ./build_trilinos.sh

Troubleshooting:

  • If wget gives the error "ERROR 404: Not Found" the link to download the package could be outdated, or the version requested could be too old. Go to the website of the package and check the latest version and the link to download the source package, then change the build script accordingly.

  • Sometimes, if cmake gives you "strange" errors, try to manually delete the configured directory and re-run cmake.


Compilation of LifeV

Firstly, LifeV has to be cloned from the online git repository:

  • Go back to the main directory of lifev-env

  • Run the correct clone- script to clone the correct git repository

Then, LifeV has to be configured:

  • Copy lifev_config_example.sh to lifev_config.sh

  • Customize lifev_config.sh to your needs, by selecting the modules to compile and adding additional parameters if necessary

    • The variable LIFEV must contain the directory in which the sources of LifeV have been downloaded

    • The variable POSTFIX can contain an optional string appended to the directories, useful when having multiple LifeV source trees

    • The variable BUILD_TYPE reflects the wanted build type and should be either Release or Debug

    • The variables ENABLE_* are used to enable/disable different modules of LifeV; they can be 0, 1, or commented out (to leave them at default value)

    • The variable PARAMS can contain optional additional parameters to pass to cmake

  • Launch the configuration by issuing the command:

    $ ./configure_lifev.sh
    
  • If everything goes smoothly, then LifeV can be built by issuing:

    $ make -C lifev-release-build -j 8
    

    where we have assumed that lifev-release-build is the build directory and 8 is the amount of processes to spawn to build the LifeV in parallel.


Tutorial

You are know ready to start using lifev. Please visit our tutorial


Alternative installation guides

Install LifeV with Docker

Install LifeV on Ubuntu

LifeV on MacOS 10.12

VMTK on MacOS 10.12


Old installation advices (obsolete)

LifeV installation scripts

LifeV libraries configurations

Trilinos Installation Notes

Updated