title | author | date | lang | link-citations | colorlinks | numbersections | toc | geometry | papersize | figPrefixTemplate | tblPrefixTemplate | secPrefixTemplate | eqnPrefixTemplate | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Installation guide |
Guillaume Latu, Thomas Helfer, Raphaël Prat |
30/03/2021 |
en-EN |
true |
true |
true |
true |
|
a4 |
( |
This project uses cmake
as build system.
A simple way to install dependencies is to rely on Spack
packaging
system. Spack
is an open source package manager
that simplifies building, installing, customizing, and sharing HPC
software. It will allow you to install recent versions of compilers
(that handle C++17
, for example gnu compiler suite version 8), and to
get python
, cmake
and other tools that are required for this project
to be installed (see hereafter).
Other ways to install MFEM and MGIS are available in the file
INSTALL_ALTERNATIVES.md
.
This tutorial provides detailed instructions on how to install
MFEM-MGIS-MFront
using Spack
. Follow the steps
carefully to ensure a successful installation.
- Ensure you have
git
installed on your system.
First, clone the Spack repository from GitHub.
git clone https://github.com/spack/spack.git
Note: Install Spack outside the source directory of mfem-mgis
to avoid issues with CMake.
Set up the Spack environment by configuring the SPACK_ROOT
environment
variable and sourcing the setup script.
export SPACK_ROOT=$PWD/spack
source ${SPACK_ROOT}/share/spack/setup-env.sh
Detect the available compilers on your system. Ensure to select a version that provides C, C++, and Fortran compilers.
spack compiler find
If necessary, remove unwanted compilers with the command:
spack compiler remove <compiler_name>
Use Spack to detect already installed libraries and programs to avoid reinstalling them.
spack external find m4 openssl automake ncurses
spack external find autoconf libtool xz gmake cmake
spack external find tar tcl perl curl zlib openblas
Change to the mfem-mgis
directory, add the Spack repository, and install the package.
git clone https://github.com/rprat-pro/spack-repo-mfem-mgis.git
spack repo add spack-repo-mfem-mgi
spack install -j 8 mfem-mgis
Load the installed package.
spack load mfem-mgis
Create a build directory, configure the project with CMake, build it, and install.
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
make -j 4 check
make install
If you already have mfem
, tfel
, and mgis
installed via Spack, follow these steps:
Install the required packages using Spack.
spack install mfem+mpi+suite-sparse
spack install tfel@master:~python~python_bindings
spack install mgis@master:+c~fortran~python
Load the installed packages.
spack load mfem
spack load tfel
spack load mgis
spack load hypre
Set the HYPRE_DIR
environment variable to the installation location of hypre
.
export HYPRE_DIR=`spack location -i hypre`
Create a build directory, configure the project with CMake, and build it.
mkdir build && cd build
cmake ..
make -j 4 check
By following these detailed instructions, you should be able to install
and configure MFEM-MGIS-MFront
using Spack successfully.
Upon executing the make install
command during the installation
process, a simple example is created in your installation directory.
This example can be found in the "install/share/mfem-mgis/examples"
directory. You can copy this example and the associated env.sh
file to
another location. The example can be compiled using either the cmake
or make
build systems.
First, locate your installation directory and copy the example and environment setup file to a new location.
export INSTALLDIR=<your_mfemmgis_install_directory>
cp -r ${INSTALLDIR}/share/mfem-mgis/examples/ex1 .
cp ${INSTALLDIR}/share/mfem-mgis/examples/env.sh ex1/
Navigate to the example directory, source the environment setup file,
create a build directory, and compile the example using cmake
.
cd ex1
source env.sh
mkdir build
cd build
cmake ..
make
make check
After successfully building the example, you can run it using the following command:
./UniaxialTensileTest
You can then modify the source file to design your own case study.
Navigate to the example directory, source the environment setup file, and compile the example using make
.
cd ex1
source env.sh
make
After successfully building the example, you can run it using the following command:
./UniaxialTensileTest
To compile the example and the MFront
behavior in debug mode, use the following command:
make clean
make DEBUG=1
By following these steps, you can successfully create, build, and run a simple example based on mfem-mgis
. Modify the source files as needed to develop and test your own study cases.