After downloading or cloning the sources of the MFrontGallery project, a typical usage of the project is divided in four steps (common to most cmake projects):

Cloning the master branch of the MFrontGallery project

The master branch of the MFrontGallery project can be cloned as follows:

$ git clone https://github.com/thelfer/MFrontGallery

Configuration

The sources are assumed to be in the MFrontGallery directory. While not strictly required, it is convienient to create a build directory (the example assumes it to be at the same level as the MFrontGallery directory):

$ mkdir build
$ cd build

The configuration step is triggered by calling cmake:

$ cmake  ../MFrontGallery/ [options]

The interfaces are selected by a set of cmake options prefixed by enable as described in the next paragraph.

Available options

Standard cmake variables

Variables affecting the compilation of MFront files

Option passed to domain specific languages

The following variables can be used to define options passed to domain specific languages:

MFrontGallery may use more refined variables to define the options passed to MFront’ domain specific languages. The name of those variables depends on the name of the considered interface and the type of the material knowledge considered.

Assuming that the castem interface as been enabled for behaviours, the build identifier passed to the domain specific languages of MFront’ files compiled with this interface is defined by one of the following variables:

The definition of all those variables is optional.

Interface selection

Interfaces to material properties

See also the enable-castem-material-properties and enable-cyrano-material-properties options below.

Interfaces to behaviours

See also the enable-castem-behaviours and enable-cyrano-behaviours below.

Interfaces to models

Debug options

Generation of the website

The enable-website option selects if the website of the project shall be generated. This requires pandoc (mandatory) and pandoc-crossref (optional) to be available.

Additional behaviours

Automatic documentation generation using mfront-doc

Compilers and compile flag selections

The CC and CC environment variables are used respectively to

If the boolean variable USE_EXTERNAL_COMPILER_FLAGS is set to true (i.e. to the ON value following cmake conventions), the CFLAGS and CXXFLAGS environment variables are used to define the compile flags used to compile C and C++ sources respectively.

Option specific to gcc

Option specific to clang

TFEL executables

By default, the configuration step assumes that the various binaries provided by the TFEL project (including mfront) can be found in the current environment.

Compilation

The selected libraries can be built as follows:

$ cmake --build . --target all

Unit tests

Unit tests can be executed as follows:

$ cmake --build . --target check

Installation

The built shared libraries can be installed as follows:

$ cmake --build . --target install