Mentions légales du service

Skip to content
Snippets Groups Projects

Laplacian example

Getting started

Privileged option: using guix

The project includes a ./guix.scm guix development file (see this blog article for a comprehensive usage) as well as a ./.guix/channels.scm channels file.

Building the project within a guix shell

Obtain a shell

We can obtain a reproducible guix shell through (see time-machine):

guix time-machine --channels=./.guix/channels.scm -- shell --container --link-profile

Note that we use guix containers in this instruction (see --container documentation in guix shell reference) to prevent any possible host system interference, which assumes that LXC is enabled on the host system. Otherwise guix time-machine --channels=./.guix/channels.scm -- shell --pure may be employed, but interference with the host system then remains possible.

Build

Within this shell we can build the project as follows:

cmake --preset=default
cmake --build --preset=default

Test

The example can then be tested with:

cd build/default/examples/
./example_SOR

Alternative builds

Note that time-machine is not necessary. In this case, make sure guix-hpc is turned-on, which thus must be included in the /.config/guix/channels.scm channels, for instance as:

(cons (channel
        (name 'guix-hpc)
        (url "https://gitlab.inria.fr/guix-hpc/guix-hpc.git"))
      %default-channels)

In another environment

In another environment, a fortran compiler as well as cmake and make must be available. When mpi will be turned on (not currently available), mpi will also be required. The project can then be built with cmake (see below).

CMake set up

CMake presets

The project embeds a ./CMakePresets.json cmake presets configuration file. There are two presets (cmake --list-presets) but currently the the default preset is available.

The project can be built with cmake --build --preset=default. The output build is then ./build/default/.

CMake options

There are currently two CMake options:

  • LAPLACIAN_BUILD_EXAMPLES: build examples when ON (default ON);
  • LAPLACIAN_USE_MPI: use MPI when ON (default OFF).

Note that the LAPLACIAN_USE_MPI=ON option is not yet supported, this is work in progress.