1.6.0
|
Warning: some background knowledge on the following topics is required. Before getting started, please make sure to get familiar with them (a few introductory references are listed, but many more resources can be easily found on the web).
- Command line interface on
Unix/Linux
(tutorial, cheat sheet).- Command line text editors, such as
Vim
(cheat sheet),Emacs
(cheat sheet), ornano
(cheat sheet).Git
(Pro Git book, cheat sheet, visual cheat sheet).
lifex
has the following dependencies:
C++17
-compliant compiler and related standard library (such as GCC
)MPI
installation (such as OpenMPI
or MPICH
)CMake
≥ 3.12.0
deal.II
≥ 9.3.1
VTK
≥ 9.0.3
Boost
≥ 1.76.0
Doxygen
and Graphviz
You need to install the previous dependencies in order to be able to successfully configure and build lifex
.
We recommended you to follow step 0 for a pain-free procedure to get all the dependencies you need. Then you can safely go through step 1.
Note (for advanced users): you may also consider to install all of the dependencies manually. Please refer to the above links for further instructions.
lifex
dependenciesDifferent procedure are available depending on the operating system you are using.
The defaut installation relies upon the
mk
(Linux
, recommended for MOX developers)package.
Only if the previous option does not work for you, you may consider one of the following alternatives:
Note:
Windows 10
users may consider installingWindows Subsystem for Linux (WSL)
, a compatibility layer for runningLinux
binaries on aWindows
host (versionWSL 2
recommended). All the aboveLinux
options, includingmk
, are available forWSL
.
mk
For Linux
systems, we have packed a number of scientific computing softwares, including all lifex
dependencies, in a x86-64
binary package called mk
.
The recommended procedure is to install mk
directly on your system as described below.
Note: in case you have a previous (<
v2024.0
) installation ofmk
, delete it withsudo rm -rf /u/
.
Note: the following steps 1 and 2 are not needed on MOX clusters.
mk
archive from this link.mk-2024.0-lifex.tar.gz
just downloaded and type the following command: ${HOME}/.bashrc
file (or equivalent): You can now proceed to step 1.
Note: the
mk
modules are compatible with any recent enoughLinux
distribution. On some (old) distros, you may experience errors like"version GLIBC_X.YY not found"
. If this is your case, we recommend you to update your operating system to a more recent version, possibly shipping aglibc
version not older thanX.YY
.
lifex-env
Note: Skip this step if you have already installed
lifex
dependencies using one of the other methods in this section.
lifex-env
is a set of shell scripts that download, configure, build, and install lifex
dependencies on Linux
-based systems.
lifex-env
(this step may require a long time to complete).${HOME}/.bashrc
file (or equivalent), replacing /path/to/lifex-env/
with the prefix where lifex-env
has been installed: You can now proceed to step 1.
Spack
Note: Skip this step if you have already installed
lifex
dependencies using one of the other methods in this section.
lifex
dependencies are also available on Spack
, a package manager for Linux
and macOS
.
Make sure that a C/C++
compiler, python
, make
, git
, curl
are installed.
More details about deal.II
on Spack
can be found here.
${HOME}/.bashrc
file (or equivalent), replacing /path/to/spack/
with the path where you want to install Spack
: Spack
with: ${HOME}/.bashrc
file (or equivalent): Spack
as an environment module manager with ${HOME}/.bashrc
file (or equivalent): deal.II
and VTK
(this step may require a long time to run) with ${HOME}/.bashrc
file (or equivalent): You can now proceed to step 1.
Docker
Note: Skip this step if you have already installed
lifex
dependencies using one of the other methods in this section.
Two minimal Ubuntu
distributions, with lifex-env
and mk
installed respectively, are available for use with Docker
.
First you need to install Docker
following these instructions.
The lifex
image(s) can be downloaded using the following commands (root privileges are required):
Then a corresponding container can be run through
Please refer to Docker
documentation for further instructions on how to use Docker
.
You can now proceed to step 1.
lifex
GitLab
accountIt is strongly recommended that you associate an SSH
key to your GitLab
account in order to be able to use all of the git
functionalities without being prompted to enter your credentials each time.
SSH
key on your system following these steps.GitLab
account following these instructions.git
with your real name and email address: Note: the settings above must be formatted properly, i.e. names and surname(s) should start with an uppercase letter and be separated by a (single) space character.
Note: please make sure that these settings are consistent on all computers you are using
lifex
on.
lifex
Move to a target folder (make sure its path does not contain special characters such as &
, $
or brackets) and run:
Note: if you are unable to use the
SSH
protocol, a standard-authenticationHTTPS
URL is available:git clone --recursive https://your_username@gitlab.com/lifex/lifex.git
lifex
First create a build folder and enter it:
Then run lifex
configuration with
Add the optional -DCMAKE_BUILD_TYPE=Debug
flag to build with debug symbols and no compile-time optimization.
Note (for developers):
lifex
can use eitherTrilinos
orPETSc
as linear algebra backends. The backend can be customized with-DLIN_ALG=Trilinos
(the default value) or-DLIN_ALG=PETSc
.
Note (for developers): in order to enable
Doxygen
andGraphviz
, make sure that thedoxygen
anddot
executables are in your systemPATH
environment variable (see also Coding guidelines).
Note (for advanced users): if you compiled and installed
deal.II
,VTK
orBoost
manually in any other way thanmk
,Spack
orDocker
, specify the installation directories with thecmake
flags-DDEAL_II_DIR=/path/to/dealii/
,-DVTK_DIR=/path/to/vtk/
and-DBOOST_DIR=/path/to/boost/
.
Note (for
Docker
users): please specify thecmake
flag-DMPIEXEC_PREFLAGS="--allow-run-as-root"
to enable the container to run parallel executables.
lifex
Run the compilation with
where <N>
is the desired number of parallel processes (e.g. make -j2
). By default, this builds all the targets available.
Note: this step can be very memory intensive, especially if more than one process is used for compilation (i.e. if
<N>
is greater than one). If compilation fails, consider reducing the number of processes.
If you only need to compile part of the library, specific targets can be selected with, e.g.:
(make help
prints the list of all possible targets).
lifex
installationLarge additional data and meshes are required by automatic tests and available externally. Run
to download (or update) them.
Finally, to check whether everything works successfully, setup and run the testing platform with
Note: by default, parallel tests related are run in parallel using
MPI
on all the processors detected on the host system. Configurelifex
with thecmake
flag-DMPIEXEC_MAX_NUMPROCS=<N>
to set a custom number of parallel processes.
Note (for developers): more computationally intensive tests can be run with
ctest -L test_hard
.
You did it, have fun with lifex
!
lifex
app by visiting Run a lifex app.lifex
into a portable binary package: Building portable executables