v0.15.0
Loading...
Searching...
No Matches
Installation with Spack

Table of Contents

Spack is a flexible package manager designed to support multiple versions, configurations, platforms, and compilers.

It is actively developed by a vibrant open-source community of users and contributors who maintain package configurations across a wide range of platforms, including macOS and Linux. This enables a consistent and reproducible build environment for many scientific software packages.

MoFEM is best deployed and developed using Spack, which is the recommended installation method. Please note that Spack builds all packages from source; precompiled binaries are not provided.

Note: The installation instructions listed here are for MoFEM version 0.15.0 onwards and have been tested on Ubuntu 20.04 (Focal Fossa), Ubuntu 22.04 (Jammy Jellyfish) or Ubuntu 24.04 (Noble Numbat), based on a fresh Ubuntu installation. If you encounter any issues with the installation please contact us at mofem-group@googlegroups.com.

For Windows users, these installation instructions will also work when inside the Windows Subsystem for Linux (WSL). For instructions on how to setup and use WSL see the Microsoft website on how to install linux.

For Mac users, these instructions are unlikely to work depending on the architecture of your system. Therefore, we recommend installing using docker see our docker installation page.

MoFEM Installation via Scripts (Using Spack)

‍Although we suggest using these scripts for simplicity and consistency, you can also explore other installation methods as discussed in the below sections eg. if you would like a specific version or additional users modules.

If you would like to install MoFEM using a pre-made script please follow the below instructions.

  1. Choose the directory where you want to install MoFEM.
  2. Download the installation script to that directory: mofem_installation_v0_15_0.sh
  3. (Optional) Make the script executable:
    chmod +x mofem_installation_v0_15_0.sh
  4. Run the script (you may need sudo privileges):
    ./mofem_installation_v0_15_0.sh

If you see "MoFEM installed successfully" then you are ready to start running MoFEM. You can now look at our tutorials to see examples on how to run MoFEM.

MoFEM Installation with Spack

This section walks you through installing MoFEM manually (line by line) using Spack.

Prerequisites

First, ensure you are using a linux environment and have sudo privileges.

Step 1: Install System Dependencies

Install the recommended system packages to run MoFEM:

sudo apt update && sudo apt install -y \
file \
zlib1g-dev \
openssh-server \
wget \
valgrind \
curl \
git \
g++ \
gfortran \
gdb \
m4 \
automake \
build-essential \
libtool \
libsigsegv2 \
libjpeg-dev \
graphviz \
doxygen \
cmake \
pkg-config \
gnuplot \
ca-certificates \
python3-setuptools \
python3-dev \
python3-numpy \
python3-scipy \
libx11-dev \
xauth \
xterm \
unzip \
mesa-common-dev \
libglu1-mesa-dev \
libxmu-dev \
libxi-dev \
libssl-dev \
gawk \
gettext \
libboost-all-dev \
libboost-python-dev \
openmpi-bin \
libopenmpi-dev

Step 2: Set Up Directories

Set environment variables to define the install locations and create the installation directories for MoFEM and Spack:

export MOFEM_INSTALL_DIR=$HOME/mofem_install
export SPACK_ROOT=$MOFEM_INSTALL_DIR/spack
mkdir -p $SPACK_ROOT

Step 3: Download and Unpack Spack

Download and upack the most recent version of Spack (v0.23.1 as of writing this documentation) into your spack installation folder:

curl -L https://github.com/spack/spack/archive/refs/tags/v0.23.1.tar.gz | \
tar -xz -C $SPACK_ROOT --strip-components=1

Step 4: Initialise Spack

Setup the spack environment and add to your .bashrc or .bash_profile so that it is enabled at all times:

echo "export MOFEM_INSTALL_DIR=$HOME/mofem_install" >> ~/.bashrc
echo "export SPACK_ROOT=$MOFEM_INSTALL_DIR/spack" >> ~/.bashrc
echo ". $SPACK_ROOT/share/spack/setup-env.sh" >> ~/.bashrc

Then apply by sourcing your .bashrc or .bash_profile. Restarting your terminal will also work:

source ~/.bashrc

Step 5: Configure Spack

Configure our Spack installation by finding currently installed compilers and external packages:

spack compiler find
spack external find

Step 6: Add MoFEM Package Repository

Clone the source code for MoFEM Version0.15.0 and add this to Spack as a custom repository:

# Clone the MoFEM repository
export MOFEM_BRANCH=Version0.15.0
cd $MOFEM_INSTALL_DIR
git clone --branch $MOFEM_BRANCH https://bitbucket.org/mofem/mofem-cephas.git

Then add the repository to SPACK:

spack repo add $MOFEM_INSTALL_DIR/mofem-cephas

Step 7: Create an Installation Environment

Create and activate a Spack environment using spack env create and spack env activate to install MoFEM and set the configurations for the release build as:

spack env create mofem_release
spack env activate mofem_release
spack config add "packages:all:target:[x86_64]"
spack config add "packages:all:variants:build_type=Release"

For full MoFEM functionality we recommend installing python, py-numpy and boost with python and py-numpy packaged with MoFEM to ensure version compatability by adding the additional packages to the spack environment as:

spack add python
spack add py-numpy ^python
spack add boost+python+numpy ^python ^py-numpy

Step 8: Add MoFEM to Spack

Add mofem-cephas to the spack enviroment ensuring the dependency on PETSc (^petsc+X) as:

spack add mofem-cephas@0.15.0+adol-c+med+mgis~shared+slepc+tetgen+build_tutorials install_id=0 ^petsc+X

Next we check the required packages, versions and dependencies by using spack conretize:

spack concretize -f

An example of the full concretized output can be found at the end of this document.

Note: when installing with python ensure only one python version is listed as a dependency during concretization otherwise conflicts can arise during installation.

Step 9: Install MoFEM

Once Spack has specified the required versions and dependencies we can install MoFEM, this will install all packages required by MoFEM followed by MoFEM and run internal tests as:

spack install -v --test=root mofem-cephas@0.15.0

Step 10: Create View to Executables

If the installation is successful we can create a view to the executables as:

spack env view enable $HOME/mofem_view

This allows access to the various MoFEM executables via a shortened path. The solvers are then available under $HOME/mofem_view/tutorials for those used in the tutorials or $HOME/mofem_view/users_modules/ for any optional users modules.

Step 10.1: For Users

If you plan to only run MoFEM as a user we recommend to clean the spack cache to reduce the hard disk usage of the installation by using:

spack clean -a

✅ Done! MoFEM is now installed using Spack and ready to use. You can refer to our tutorials page to see examples of how to run MoFEM.

Step 10.2: For Developers

If you plan to develop your own solver or modify the code you can access the source code cloned during the install at $MOFEM_INSTALL_DIR/mofem-cephas. However this is not ready for development. To finialise the install as a developer you must add the source code to spack with a develop path and reconcretize:

spack env activate mofem_release
spack develop -p "$HOME/mofem_install/mofem-cephas" mofem-cephas@0.15.0
spack concretize -f

Any modifications to the source code can now be compiled by reinstalling with spack using:

spack install --overwrite mofem-cephas@0.15.0

mofem_view should be updated automatically but if needed you can manually regenerate the view by running:

rm -rf mofem_view ._mofem_view/
spack env view regenerate

✅ Done! You will notice that the code was built by spack and a symbolic link provided in a directory with a name similar to $MOFEM_INSTALL_DIR/mofem-cephas/build-linux-ubuntu24.04-zen4-abc123x/core-build-Release-abc123x this name depends on the operating system and hash (abc123x) of the spack package.

Note: this is only a release version and is optimised for speed. If you are developing code it is recommend to also install a Debug version, see the next section.

MoFEM Installation with Spack - Debug version

If you are a developer and would like to install a debugging version, you can install MoFEM using a similar approach to the previous section from Step 7 onwards by replacing "Release" with "Debug". The commands are as follows:

spack env create mofem_debug
spack env activate mofem_debug
spack config add "packages:all:target:[x86_64]"
spack config add "packages:all:variants:build_type=Debug"
spack add python
spack add py-numpy ^python
spack add boost+python+numpy ^python ^py-numpy
spack add mofem-cephas@0.15.0+adol-c+med+mgis~shared+slepc+tetgen+build_tutorials install_id=0 ^petsc+X
spack develop -p "$HOME/mofem_install/mofem-cephas" mofem-cephas@0.15.0
spack concretize -f
spack install -v mofem-cephas@0.15.0
spack env view enable $HOME/mofem_debug_view

This will install a debugging version with the executables accessible via symbolic link in $HOME/mofem_debug_view. As with the release version you will notice spack provides a symbolic link to the build in a directory with a name similar to $MOFEM_INSTALL_DIR/mofem-cephas/build-linux-ubuntu24.04-zen4-abc123x/core-build-Debug-abc123x as with the release version this name depends on the operating system and hash (abc123x) of the spack package.

You can recompile anytime by using:

spack env activate mofem_debug
spack install --overwrite mofem-cephas@0.15.0

mofem_debug_view should be updated automatically but if needed you can manually regenerate the view by running:

rm -rf mofem_view ._mofem_view/
spack env view regenerate

How to add Additional Users Modules

This section describes how to add additional users modules for both users and developers, assuming the above instructions have been followed to install MoFEM and are based on installing a Release version.

‍For available Users Modules refer to Users Modules.

To add a module, first clone the source code into $HOME/mofem_install/mofem-cephas/mofem/users_modules, for example we can add adolc-plasticity as:

git clone --branch $MOFEM_BRANCH https://bitbucket.org/mofem/adolc-plasticity.git

Maintained Modules

If the module is currently maintained, add the new module to spack using:

spack repo add $HOME/mofem_install/mofem-cephas/mofem/users_modules/adolc-plasticity

then add the module to the environment by first activating the correct environent and use spack add:

spack env activate mofem_release
spack add mofem-adolc-plasticity-module@0.15.0

Note: The package name can vary depending on the module so check the terminal when adding the repo for the package name.

For users, check the package has been added to the environment by using spack concretize. If you are following these instructions after already installing MoFEM above then only the new module should show with a grey - next to its name while the rest should be green:

spack concretize -f

Install the new module by using spack install:

spack install -v mofem-adolc-plasticity-module@0.15.0

✅ Done! Once the installation is completed you are able to access the executables in the mofem_view directory. If the view has not updated run:

rm -rf mofem_view ._mofem_view/
spack env view regenerate

For developers, you can add the develop version by running:

spack develop -p "$HOME/mofem_install/mofem-cephas/users_modules/adolc-plasticity" mofem-adolc-plasticity-module@0.15.0

and reinstalling with:

spack install --overwite mofem-adolc-plasticity-module@0.15.0

Legacy or Older Modules

If the module is not currently maintained (legacy modules) or a spack package does not yet exist for the module (modules older than version 0.15.0), you can attempt to install with the following steps.

Warning: If a compilation error occurs the package will not be installed and would need manual intervention.

To add a module that does not have a spack package defined you can add it by reinstalling mofem-cephas as a development package with all the source code located in $HOME/mofem_install/mofem-cephas and adding the source code of the old users module to $HOME/mofem_install/mofem-cephas/mofem/users_modules. As an example, new modules can also be installed this way so these steps will also use adolc-plasticity.

For users, after cloning the module as described above, activate your spack environment then add mofem-cephas as a development package and reinstall mofem-cephas

spack env activate mofem_release
spack clean -a
spack develop -p "$HOME/mofem_install/mofem-cephas" mofem-cephas@0.15.0
spack install --overwrite mofem-cephas@0.15.0

✅ Done! Once the installation is completed you are able to access the executables in the mofem_view directory. If the view has not updated run:

rm -rf mofem_view ._mofem_view/
spack env view regenerate

For developers, after cloning the module as described above, activate your spack environment and reinstall mofem-cephas

spack env activate mofem_release
spack clean -a
spack install --overwrite mofem-cephas@0.15.0

✅ Done! Once the installation is completed you are able to access the executables in the mofem_view directory. If the view has not updated run:

rm -rf mofem_view ._mofem_view/
spack env view regenerate

MoFEM Installation on Oak Development Server

This section describes how to install MoFEM using Spack on the Oak development server.

Step 1. Set Up Environment in ~/.bashrc

First, configure your shell environment by adding the following lines:

echo "export TMPDIR=$HOME/tmp" >> ~/.bashrc
echo ". /mofem_install/vanilla_spack/share/spack/setup-env.sh" >> ~/.bashrc

This creates your own tmp directory to avoid conflicts with other users installations then adds the vanilla spack setup-env.sh to your .bashrc.

Then run:

source ~/.bashrc

to reload your bashrc.

Step 2. Prepare Installation Directory

Create a directory to store the installation of MoFEM:

mkdir -p $HOME/mofem_install
cd $HOME/mofem_install

Copy the packages configuration from the system directory which contains the pre-installed packages:

mkdir -p $HOME/.spack
cp /mofem_install/packages.yaml $HOME/.spack/

Step 3. Clone the MoFEM Repository

Clone the source code for MoFEM with the below command and replace develop with whichever branch you would like to clone:

git clone --branch develop https://bitbucket.org/mofem/mofem-cephas.git

Step 4. Create and Configure the Release Environment

Create a spack environment for the installation. In this case we will create an environment for a release build as:

mkdir -p $HOME/mofem_install/release_env
cd $HOME/mofem_install/release_env

then add the MoFEM repository to the users Spack:

spack repo add $HOME/mofem_install/mofem-cephas

Create a new local Spack environment in release_env, activate it and then configure the built type as Release or RelWithDebInfo:

spack env create -d $HOME/mofem_install/release_env
spack env activate -d $HOME/mofem_install/release_env
spack config add "packages:all:variants:build_type=Release"

To create a debug build see the below section for how to create a debug build on Oak:

Step 5. Add MoFEM as a Development Package to Spack

Add MoFEM and its dependencies, specifing the install_id as your user. This is automatic if using $USER. Then set mofem-cephas as a development package in spack:

spack add mofem-cephas@0.15.0+adol-c+med+mgis~shared+slepc+tetgen+build_tutorials install_id=$USER ^petsc+X
spack develop -p $HOME/mofem_install/mofem-cephas mofem-cephas@0.15.0

Step 6. Install MoFEM using Spack

Check the required packages, versions and dependencies by using spack concretize, on Oak all packages should already be installed except your own mofem-cephas package. This is identifiable by noting that installed packages have [+] or [e], and to be installed packages have -

spack concretize -f
spack install -v --test=root mofem-cephas@0.15.0

✅ Done! Once MoFEM has installed you are able to activate the environment in future sessions using:

spack env activate -d $HOME/mofem_install/release_env

You can also create a view to the binaries by using:

spack env view enable $HOME/mofem_view

This will create a symbolic link to your binaries and store them in $HOME/mofem_view. At anytime you can recompile and regenerate the view using:

spack env activate -d $HOME/mofem_install/release_env
spack install --overwrite mofem-cephas@0.15.0
spack env view regenerate

Create a Debugging Environment on Oak

For developers, it is recommended to also create a debugging build of at least mofem-cephas which has debug flags. This also works for creating debugging versions when working on source-level changes to PETSc or MOAB.

Create and Configure the Debug Environment

Following similar steps to the release version, first make a directory for the local debug environment then create and activate it. Add the configuration build_type as Debug then add mofem-cephas and set it as a development package.

mkdir -p $HOME/mofem_install/debug_env
cd $HOME/mofem_install/debug_env
spack env create -d $HOME/mofem_install/debug_env
spack env activate -d $HOME/mofem_install/debug_env
spack config add "packages:all:variants:build_type=Debug"
spack add mofem-cephas@0.15.0+adol-c+med+mgis~shared+slepc+tetgen+build_tutorials install_id=$USER ^petsc+X
spack develop -p $HOME/mofem_install/mofem-cephas mofem-cephas@0.15.0
spack concretize -f
spack install -v --test=root mofem-cephas@0.15.0
spack env view enable $HOME/mofem_debug_view

Once the installation is complete you can use and access the debug environment by using:

spack env activate -d $HOME/mofem_install/debug_env

and you can reinstall by using:

spack env activate -d $HOME/mofem_install/debug_env
spack install -v mofem-cephas@0.15.0
spack env view regenerate

OPTIONAL: Working with PETSc or MOAB Source Code

If you plan to modify PETSc or MOAB, you can clone and develop them directly by using the same debug environment. First activate the debug environment:

cd $HOME/mofem_install/debug_env
spack env activate -d $HOME/mofem_install/debug_env

Then add the source controlled PETSc and/or MOAB and mark them for local developments by providing a directory for them:

spack add moab@5.5.1
spack add petsc@3.22.1
spack develop -p $HOME/moab moab@5.5.1
spack develop -p $HOME/petsc petsc@3.22.1

Next, reconcretise and install MoFEM with these local source versions:

spack concretize -f
spack install -v mofem-cephas@0.15.0

✅ Done! MoFEM is now installed and ready for use. To make development smoother:

  • Use spack env activate -d <path> to switch environments.

MoFEM Installation on Buckethead HPC (SLURM System)

This section assumes you have an account on Buckethead, you are using slurm modules and installing into your user space, without admin privileges.

Step 1. Load Required Modules

Load the required modules for the installation:

module purge
module load gcc/14.2.0
module load mpi/openmpi/4.1.7/gcc-14.2.0

Check they have been loaded using:

module list

The terminal should display only these modules as:

Currently Loaded Modulefiles:
1) gcc/14.2.0 2) mpi/openmpi/4.1.7/gcc-14.2.0

2. Create Directory Layout

Create the required directories and layout:

export MOFEM_INSTALL_DIR=$HOME/mofem_install
export SPACK_ROOT=$MOFEM_INSTALL_DIR/spack
export TMPDIR=$HOME/tmp
mkdir -p $SPACK_ROOT
mkdir -p $TMPDIR
cd $MOFEM_INSTALL_DIR

this will create three directories, one for the mofem installation, one for spack and one for the temporary files.

Step 3. Download and Unpack Spack

Download and unpack spack into the $SPACK_ROOT directory that was created in the previous step.

curl -L https://github.com/spack/spack/archive/refs/tags/v0.23.1.tar.gz | \
tar -xz -C $SPACK_ROOT --strip-components=1

Step 4. Initialise Spack and add to ~/.bashrc

Initialise spack and add to your .bashrc.

echo "export TMPDIR=$HOME/tmp" >> ~/.bashrc
echo "export SPACK_ROOT=$HOME/mofem_install/spack" >> ~/.bashrc
echo ". $HOME/mofem_install/spack/share/spack/setup-env.sh" >> ~/.bashrc

Apply changes:

source ~/.bashrc

Step 5. Configure Spack with External Packages

Configure spack with external compilers and packages:

spack compiler find
spack external find

You must edit ~/.spack/packages.yaml and add to the file these lines:

packages:
all:
target: [x86_64]
variants: +mpi build_type=Release
openmpi:
externals:
- spec: openmpi@4.1.7
prefix: /software/mpi/openmpi/4.1.7/gcc-14.2.0
buildable: false

Step 6. Clone and Register MoFEM Repo

Clone MoFEM into the installation directory. By using this command you will clone Version0.15.0 but you can select a different branch.

cd $MOFEM_INSTALL_DIR
git clone --branch Version0.15.0 https://bitbucket.org/mofem/mofem-cephas.git

then add the repository to spack:

spack repo add $MOFEM_INSTALL_DIR/mofem-cephas

At this stage you can clone additional users modules by following this optional section.

Step 7. Create and Configure Spack Environment

Next, create and configure a release environment in spack first by creating an appropriate directory then by creating an environment in that directory and activating it. Followed by the release configurations:

mkdir -p $MOFEM_INSTALL_DIR/release_env
cd $MOFEM_INSTALL_DIR/release_env
spack env create -d $HOME/mofem_install/release_env
spack env activate -d $HOME/mofem_install/release_env
spack config add "packages:all:target:[x86_64]"
spack config add "packages:all:variants:build_type=Release"

Step 8. Add Python, py-numpy and boost+python+numpy

Next, we add the required packages for MoFEM. Similar to previous instructions above, add python, py-numpy and boost+python+numpy to the spack environment to ensure MoFEM and its dependencies are compiled with compatible versions:

spack add python
spack add py-numpy ^python
spack add boost+python+numpy ^python ^py-numpy

Step 9. Add MoFEM

Next, add MoFEM to spack and set the development path to the source code cloned previously.

spack add mofem-cephas@0.15.0+adol-c+med~mgis~shared+slepc+tetgen+build_tutorials install_id=$USER ^petsc+X
spack develop -p $MOFEM_INSTALL_DIR/mofem-cephas mofem-cephas@0.15.0
spack concretize -f
spack install -v mofem-cephas@0.15.0

Note: As of writing this documentation, this installation of MoFEM does not have the varient ~mgis. This is due to a compilation issue for tfel when using gcc@14.2.0. This occurs when spack takes the latest "safe" version (tfel@4.2.0). However if you require MFRONT you must add the latest versions to the spack environment before spack concretize -f by using for example spack add tfel@5.0.0. This is at user discretion as these have not yet been verified by spack.

Step 11. Create view

If the installation is successful we can create a view to the executables with:

spack env view enable $HOME/mofem_view

Step 12. Run MoFEM in SLURM Job

Example SLURM script to run a ctest from adv-1 using mofem_view:

#!/bin/bash
#SBATCH --job-name=test_adv1
#SBATCH --ntasks=4 # Number of tasks (processes)
#SBATCH --mem-per-cpu=1gb # Job memory request (interchangable with --mem=20gb)
#SBATCH --partition=standard # Partition name
#SBATCH --chdir=. # Run in current working directory
#SBATCH --output=o%j.log # File to which standard output should be sent (%j = Job ID)
#SBATCH --error=e%j.log # File to which standard error should be sent (%j = Job ID)
#SBATCH --nodelist=node[201-212] # List of nodes to choose from
#SBATCH --nodes=1 # Number of nodes to use
module load gcc/14.2.0
module load mpi/openmpi/4.1.7/gcc-14.2.0
source $HOME/mofem_install/spack/share/spack/setup-env.sh
spack env activate $HOME/mofem_install/release_env
MOFEM_EXE=$HOME/mofem_view/tutorials/adv-1/contact_3d_schur
cd $HOME/mofem_install/mofem-cephas/mofem/tutorials/adv-1
mpirun -np $SLURM_NTASKS $MOFEM_EXE
-file_name ./mesh_files/hertz_3d_4p.h5m \
-large_strain 0 \
-snes_max_it 40 \
-ksp_atol 1e-10 \
-ksp_rtol 1e-8 \
-pc_type fieldsplit \
-mofem_mg_levels 2 \
-order 2 \
-eps_stab 1e-5 \
-ts_type beuler \
-ts_max_time 1 \
-ts_max_steps 10 \
-ts_dt 1 \
-sdf_file ./sdf_files/sdf_hertz_3d.py \
-young_modulus 1e3 \
-poisson_ratio 0.4 \
-atom_test 3 \
-log_no_color \
2>&1 | tee log_file

FAQ

How to Compile a Program

This tutorial explains how to compile MoFEM. It assumes that you have installed the developer version of MoFEM, either using the instructions in Installation with Docker - JupyterHub or the installation script described in Installation with Spack (Scripts).

After installation, you should have the source code and corresponding binary build directories located as follows:

  • Core Library
    • Source code: $HOME/mofem_install/mofem-cephas/
    • Build directory (for example, for the Release build type): $HOME/mofem_install/mofem-cephas/build-*/core-*

‍The asterisk * in the build path stands for the hash of the particular build, e.g. build-5sehreo/core-Release-5sehreo.

You need to recompile the Core Library whenever you change any source files located in:

$HOME/mofem_install/mofem-cephas/mofem/

There are two main ways to compile: using Spack’s automated process, or manually after the CMake configuration step.

Option 1: Compile using Spack (automated)

If you want Spack to handle the entire compilation process:

spack env activate mofem
spack concretize -f
spack install -v --test=root mofem-cephas@0.15.0

This approach detects what needs to be rebuilt and compiles it.

Option 2: Compile manually after CMake configuration

If you prefer to run the build process manually after configuration:

spack env activate mofem
spack concretize -f
spack install -v --until cmake mofem-cephas@0.15.0

Then change to the appropriate build directory and run:

cd $HOME/mofem_install/mofem-cephas/build-linux-*/core-build-Release-*
make -j4
ctest -VV
make -j4 install

The -j4 flag means to use four processor threads; you can adjust this depending on your hardware. The ctest -VV command runs the test suite in verbose mode.

Note: If you have several builds of the Core Library (for example, both Debug and Release), make sure to replace the asterisk * in the path with the actual hash corresponding to the build you want to compile. All build directories are located under:

$HOME/mofem_install/mofem-cephas/

How to Create a New Module

To create your own module, the simplest way is to replicate an existing one and modify it. For example, copy the Solid Shell Module and then:

  • Move the copied module to a directory outside your MoFEM installation.
  • Change file and folder names, and update all descriptions.
  • Edit CMakeLists.txt and InstalledAddModule.cmake to reflect your new module name and structure.
  • Remove unnecessary source files.
  • Create a new remote Git repository on GitHub or Bitbucket.
  • Upload your modified module to the repository.
  • Clone and build the module following the same procedure as for an existing module.

‍If you have trouble creating a module, feel free to contact us via MoFEM Q&A.

How to Add a New Program

To add a new program within an existing module, the simplest approach is to copy an existing program and modify it. For example, copy the vec-0 tutorial:

  1. Go to:
    $HOME/mofem_install/mofem-cephas/mofem/tutorials/
  2. Copy the vec-0 program and rename it.
  3. Change filenames and descriptions.
  4. Edit the CMakeLists.txt file to ensure it matches the new program's structure.
  5. Remove unused files.
  6. Build the program:
    cd $HOME/mofem_install/mofem-cephas/build-*/core-*/mofem/tutorials
    make -j4
  7. Your new program will appear in a newly created subdirectory.

‍If you have difficulty creating a program, please contact us at MoFEM Q&A.

How to get packages installed today?

Run command:

spack find -p -L --start-date `date +%F`

and you will get:

-- darwin-elcapitan-x86_64 / clang@7.3.0-apple ------------------
ugi2gm7 mofem-cephas@develop /spack/opt/spack/darwin-elcapitan-x86_64/clang-7.3.0-apple/mofem-cephas-develop-ugi2gm7lydyjwmiwneefhxq7ahvpnuzc
gu4uheh mofem-users-modules@develop /spack/opt/spack/darwin-elcapitan-x86_64/clang-7.3.0-apple/mofem-users-modules-develop-gu4uhehai3edtqow7kivuxgpw5lmvbxz

How to find packages that were only installed today?

Run command:

ls -lhd `spack find -lp | grep mofem | awk '\''{print $3}'\''`

Contact

If you are experiencing any problems with this installation, please contact us by mofem-group@googlegroups.com.

Concretized Output Example

Here is an example of what the concretized output for MoFEM should look like:

==> Concretized 5 specs:
- n4e3pqt boost@1.83.0%gcc@9.4.0+atomic+chrono~clanglibcpp~container~context~contract~coroutine+date_time~debug+exception~fiber+filesystem+graph~graph_parallel+icu+iostreams~json+locale+log+math~mpi+multithreaded~nowide+numpy~pic+program_options+python+random+regex+serialization+shared+signals~singlethreaded~stacktrace+system~taggedlayout+test+thread+timer~type_erasure~url~versionedlayout+wave build_system=generic cxxstd=17 patches=a440f96,b8569d7 visibility=hidden arch=linux-ubuntu20.04-x86_64
- w4qwjba ^bzip2@1.0.8%gcc@9.4.0~debug~pic+shared build_system=generic arch=linux-ubuntu20.04-x86_64
[e] qyuxt44 ^diffutils@3.7%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- 364dscy ^gcc-runtime@9.4.0%gcc@9.4.0 build_system=generic arch=linux-ubuntu20.04-x86_64
[e] de3tje6 ^glibc@2.31%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- rn77itg ^icu4c@74.2%gcc@9.4.0 build_system=autotools cxxstd=17 arch=linux-ubuntu20.04-x86_64
[e] xe573ea ^autoconf@2.69%gcc@9.4.0 build_system=autotools patches=7793209 arch=linux-ubuntu20.04-x86_64
[e] vc5gedf ^automake@1.16.1%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[e] 3ytqqg3 ^libtool@2.4.6%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- t3winrc ^xz@5.4.6%gcc@9.4.0~pic build_system=autotools libs=shared,static arch=linux-ubuntu20.04-x86_64
- xp46b3s ^zlib-ng@2.2.1%gcc@9.4.0+compat~new_strategies+opt+pic+shared build_system=autotools arch=linux-ubuntu20.04-x86_64
- ohg3lh2 ^zstd@1.5.6%gcc@9.4.0~programs build_system=makefile libs=shared,static arch=linux-ubuntu20.04-x86_64
- ipocq7q mofem-cephas@0.15.0%gcc@9.4.0+adol-c+build_tutorials+copy_user_modules~ipo+med+mgis~shared+slepc+tetgen build_system=cmake build_type=Release generator=make install_id=0 arch=linux-ubuntu20.04-x86_64
- flkggzb ^adol-c@2.7.2%gcc@9.4.0~advanced_branching+atrig_erf~boost+doc~examples~openmp~sparse+stdczero+traceless_refcounting build_system=autotools patches=715b878 arch=linux-ubuntu20.04-x86_64
- iar22pq ^cmake@3.30.5%gcc@9.4.0~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release patches=dbc3892 arch=linux-ubuntu20.04-x86_64
[e] pmhy2wa ^curl@7.68.0%gcc@9.4.0+gssapi+ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs=shared,static tls=openssl arch=linux-ubuntu20.04-x86_64
[e] pgg36gi ^gmake@4.2.1%gcc@9.4.0~guile build_system=generic patches=ca60bd9,fe5b60d arch=linux-ubuntu20.04-x86_64
- zltjkes ^med@5.0.0%gcc@9.4.0+api23~doc~fortran~ipo+mpi~python~shared build_system=cmake build_type=Release generator=make arch=linux-ubuntu20.04-x86_64
- 5ywenm7 ^hdf5@1.12.3%gcc@9.4.0~cxx~fortran~hl~ipo~java+mpi+shared~szip~threadsafe+tools api=default build_system=cmake build_type=Release generator=make patches=f42732a arch=linux-ubuntu20.04-x86_64
- z7pblit ^mgis@2.2%gcc@9.4.0+c~fortran~ipo~python~static build_system=cmake build_type=Release generator=make arch=linux-ubuntu20.04-x86_64
- c4khwmk ^moab@5.5.1%gcc@9.4.0~cgm~coupler~dagmc~debug+eigen~fbigeom~fortran+hdf5~irel~metis+mpi~netcdf~parmetis~pnetcdf+shared+zoltan build_system=autotools arch=linux-ubuntu20.04-x86_64
- 4ab76xk ^eigen@3.4.0%gcc@9.4.0~ipo build_system=cmake build_type=Release generator=make arch=linux-ubuntu20.04-x86_64
[e] frxnbch ^m4@1.4.18%gcc@9.4.0+sigsegv build_system=autotools patches=3877ab5,fc9b616 arch=linux-ubuntu20.04-x86_64
- czcmfna ^zoltan@3.901%gcc@9.4.0~debug~fortran~int64+mpi~parmetis+shared build_system=autotools arch=linux-ubuntu20.04-x86_64
- 5aafpo2 ^openblas@0.3.28%gcc@9.4.0~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+pic+shared build_system=makefile patches=d0b9276 symbol_suffix=none threads=none arch=linux-ubuntu20.04-x86_64
- z4vfbha ^openmpi@5.0.5%gcc@9.4.0+atomics~cuda~debug~gpfs~internal-hwloc~internal-libevent~internal-pmix~java~lustre~memchecker~openshmem~romio+rsh~static~two_level_namespace+vt+wrapper-rpath build_system=autotools fabrics=none romio-filesystem=none schedulers=none arch=linux-ubuntu20.04-x86_64
- lqstcxe ^hwloc@2.11.1%gcc@9.4.0~cairo~cuda~gl~libudev+libxml2~nvml~oneapi-level-zero~opencl+pci~rocm build_system=autotools libs=shared,static arch=linux-ubuntu20.04-x86_64
- l7yyseu ^libpciaccess@0.17%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- vlgg5ld ^libxml2@2.13.4%gcc@9.4.0+pic~python+shared build_system=autotools arch=linux-ubuntu20.04-x86_64
- gf7zxb3 ^libiconv@1.17%gcc@9.4.0 build_system=autotools libs=shared,static arch=linux-ubuntu20.04-x86_64
- r2gsju4 ^libevent@2.1.12%gcc@9.4.0+openssl build_system=autotools arch=linux-ubuntu20.04-x86_64
- qfyfjai ^numactl@2.0.18%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[e] p7oyshl ^openssh@8.2p1%gcc@9.4.0+gssapi build_system=autotools arch=linux-ubuntu20.04-x86_64
[e] yogckef ^perl@5.30.0%gcc@9.4.0~cpanm+opcode+open+shared+threads build_system=generic arch=linux-ubuntu20.04-x86_64
- ccc7mzi ^pmix@5.0.3%gcc@9.4.0~munge~python~restful build_system=autotools arch=linux-ubuntu20.04-x86_64
- chp6uru ^parmetis@4.0.3%gcc@9.4.0~gdb~int64~ipo+shared build_system=cmake build_type=Release generator=make patches=4f89253,50ed208,704b84f arch=linux-ubuntu20.04-x86_64
- 46xyukb ^metis@5.1.0%gcc@9.4.0~gdb~int64~ipo~real64+shared build_system=cmake build_type=Release generator=make patches=4991da9,93a7903,b1225da arch=linux-ubuntu20.04-x86_64
- aprwf6g ^petsc@3.22.1%gcc@9.4.0+X~batch~cgns~complex~cuda~debug+double~exodusii~fftw+fortran~giflib+hdf5~hpddm~hwloc+hypre~int64~jpeg~knl~kokkos~libpng~libyaml~memkind+metis~mkl-pardiso~mmg~moab~mpfr+mpi+mumps~openmp~p4est~parmmg~ptscotch~random123~rocm~saws~scalapack+shared~strumpack~suite-sparse+superlu-dist~sycl~tetgen~trilinos~valgrind~zoltan build_system=generic clanguage=C memalign=none arch=linux-ubuntu20.04-x86_64
- e6yia6j ^hypre@2.32.0%gcc@9.4.0~caliper~complex~cublas~cuda~debug+fortran~gptune~gpu-aware-mpi~int64~internal-superlu~magma~mixedint+mpi~openmp~rocblas~rocm+shared~superlu-dist~sycl~umpire~unified-memory build_system=autotools precision=double arch=linux-ubuntu20.04-x86_64
- o52sgga ^libx11@1.8.10%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- tzicxkv ^inputproto@2.3.2%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- qerstve ^kbproto@1.0.7%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- hzfvsb6 ^libxcb@1.17.0%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- 73rpbf7 ^libpthread-stubs@0.5%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- zc53e3x ^libxau@1.0.11%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- hlkv2az ^libxdmcp@1.1.5%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- vwm6ewh ^xcb-proto@1.17.0%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- y3kxz3k ^util-macros@1.20.1%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- gsu3pl7 ^xextproto@7.3.0%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- agmrpio ^xproto@7.0.31%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- nv6xtsk ^xtrans@1.5.2%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- 3ymsn44 ^mumps@5.7.3%gcc@9.4.0~blr_mt+complex+double+float~incfort~int64+metis+mpi~openmp+parmetis~ptscotch~scotch+shared build_system=generic patches=373d736 arch=linux-ubuntu20.04-x86_64
- mfxadz4 ^netlib-scalapack@2.2.0%gcc@9.4.0~ipo~pic+shared build_system=cmake build_type=Release generator=make patches=072b006,1c9ce5f,244a9aa arch=linux-ubuntu20.04-x86_64
- kcjaags ^superlu-dist@9.1.0%gcc@9.4.0~cuda~int64~ipo~openmp+parmetis~rocm+shared build_system=cmake build_type=Release generator=make arch=linux-ubuntu20.04-x86_64
- khh4vvr ^pkgconf@2.2.0%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- pzrrchw ^slepc@3.22.1%gcc@9.4.0+arpack~blopex~cuda~hpddm~rocm build_system=generic arch=linux-ubuntu20.04-x86_64
- e3tbdd6 ^arpack-ng@3.9.0%gcc@9.4.0~icb~ipo+mpi+shared build_system=cmake build_type=Release generator=make arch=linux-ubuntu20.04-x86_64
- wdcko3q ^tetgen@1.5.1%gcc@9.4.0~debug+pic build_system=generic arch=linux-ubuntu20.04-x86_64
- or7ic56 ^tfel@4.2.0%gcc@9.4.0+abaqus+ansys+aster+calculix+castem+comsol+cyrano+diana-fea+europlexus~fortran~ipo~java+lsdyna~python~python_bindings build_system=cmake build_type=Release generator=make arch=linux-ubuntu20.04-x86_64
- iphfuou mofem-mixed-fracture-module@0.15.0%gcc@9.4.0+copy_user_modules~ipo build_system=cmake build_type=Release generator=make arch=linux-ubuntu20.04-x86_64
- bia3pfg py-numpy@1.26.4%gcc@9.4.0 build_system=python_pip patches=873745d arch=linux-ubuntu20.04-x86_64
- p7nsjyu ^py-cython@3.0.11%gcc@9.4.0 build_system=python_pip arch=linux-ubuntu20.04-x86_64
- cd7mbbd ^py-setuptools@69.2.0%gcc@9.4.0 build_system=generic arch=linux-ubuntu20.04-x86_64
- wfzq452 ^py-meson-python@0.16.0%gcc@9.4.0 build_system=python_pip arch=linux-ubuntu20.04-x86_64
- aoeqoej ^meson@1.5.1%gcc@9.4.0 build_system=python_pip patches=0f0b1bd arch=linux-ubuntu20.04-x86_64
- k6akp7m ^ninja@1.12.1%gcc@9.4.0+re2c build_system=generic arch=linux-ubuntu20.04-x86_64
- msrxnc5 ^re2c@3.1%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- z7swfxb ^py-packaging@24.1%gcc@9.4.0 build_system=python_pip arch=linux-ubuntu20.04-x86_64
- ztchonh ^py-flit-core@3.9.0%gcc@9.4.0 build_system=python_pip arch=linux-ubuntu20.04-x86_64
- wgwfuyv ^py-pyproject-metadata@0.7.1%gcc@9.4.0 build_system=python_pip arch=linux-ubuntu20.04-x86_64
- fhxmngf ^py-pip@23.1.2%gcc@9.4.0 build_system=generic arch=linux-ubuntu20.04-x86_64
- pzk5kw3 ^py-wheel@0.41.2%gcc@9.4.0 build_system=generic arch=linux-ubuntu20.04-x86_64
- m4wkeuw ^python-venv@1.0%gcc@9.4.0 build_system=generic arch=linux-ubuntu20.04-x86_64
- 67wifqg python@3.11.9%gcc@9.4.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=13fa8bf,b0615b2,ebdca64,f2fd060 arch=linux-ubuntu20.04-x86_64
- 57vkhi5 ^expat@2.6.4%gcc@9.4.0+libbsd build_system=autotools arch=linux-ubuntu20.04-x86_64
- egeheu3 ^libbsd@0.12.2%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- 2dww4nl ^libmd@1.0.4%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- emhwm6p ^gdbm@1.24%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[e] vjdkevb ^gettext@0.19.8.1%gcc@9.4.0+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools patches=9acdb4e arch=linux-ubuntu20.04-x86_64
- pgxgodh ^libffi@3.4.6%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
- 7udccad ^libxcrypt@4.4.35%gcc@9.4.0~obsolete_api build_system=autotools patches=4885da3 arch=linux-ubuntu20.04-x86_64
- qrun7mi ^ncurses@6.5%gcc@9.4.0~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=linux-ubuntu20.04-x86_64
[e] m7umsf6 ^openssl@1.1.1f%gcc@9.4.0~docs+shared build_system=generic certs=mozilla arch=linux-ubuntu20.04-x86_64
- o2j24vc ^readline@8.2%gcc@9.4.0 build_system=autotools patches=bbf97f1 arch=linux-ubuntu20.04-x86_64
- y4evhnj ^sqlite@3.46.0%gcc@9.4.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-ubuntu20.04-x86_64
- zury43m ^util-linux-uuid@2.40.2%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-x86_64