title | author | date | lang | link-citations | colorlinks | numbersections | toc | geometry | papersize | figPrefixTemplate | tblPrefixTemplate | secPrefixTemplate | eqnPrefixTemplate | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Installation guide |
Guillaume Latu, Thomas Helfer |
30/03/2021 |
en-EN |
true |
true |
true |
true |
|
a4 |
( |
If you want to install and fine-tune MFEM separately, you can follow the steps outlined below. This alternative method uses Spack to manage dependencies and build MFEM with specific configurations.
- Ensure you have
git
installed on your system.
Clone the Spack repository from GitHub.
git clone https://github.com/spack/spack.git
Set the SPACK_ROOT
environment variable and source the setup script.
export SPACK_ROOT=$PWD/spack
source ${SPACK_ROOT}/share/spack/setup-env.sh
Detect the available compilers on your system.
spack compiler find
Install the required packages using Spack.
spack install hypre metis mgis@master cmake
Load the installed packages.
spack load hypre metis mgis@master cmake
Clone the MFEM repository from GitHub. Alternatively, you can download a tarball from MFEM's download page.
git clone https://github.com/mfem/mfem.git
Navigate to the mfem
directory, create a build directory, and configure the build with CMake.
cd mfem
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=$PWD/mfem -DCMAKE_CXX_COMPILER=g++
Build and install MFEM.
make -j 4 install
Run the checks to verify the installation.
make check
Set the MFEM_DIR
environment variable to the location of the installed MFEM.
export MFEM_DIR=$PWD/mfem/lib/cmake/mfem
By following these steps, you can install and fine-tune MFEM using Spack and CMake. This method allows for more control over the configuration and installation of MFEM.
This guide provides a step-by-step approach to installing MFEM-MGIS with explicit dependencies using CMake and Spack. The process involves setting relevant variables and compiling the project with specific configurations.
CMAKE_BUILD_TYPE
: Type of build (e.g., Release, Debug).CMAKE_INSTALL_PREFIX
: Directory where the project will be installed.MFEM_DIR
: Directory whereMFEMConfig.cmake
is installed. This file is generated when MFEM is compiled and installed using CMake.MFrontGenericInterface_DIR
: Directory whereMFrontGenericInterfaceConfig.cmake
is installed.
First, install mgis
using Spack.
spack install mgis@master
Follow the procedure mentioned earlier to clone, build, and install MFEM. Ensure you have the MFEMConfig.cmake
file available.
git clone https://github.com/mfem/mfem.git
cd mfem
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=$PWD/mfem -DCMAKE_CXX_COMPILER=g++
make -j 4 install
make check
export MFEM_DIR=$PWD/mfem/lib/cmake/mfem
Clone the repository that contains MFEM-MGIS if not already done.
git clone <repository_url> mfem-mgis
cd mfem-mgis
Configure the project using CMake, specifying the required directories for MFEM and MGIS. Then, build and install the project.
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_INSTALL_PREFIX=$PWD/../install \
-DMFrontGenericInterface_DIR=$(spack location -i mgis@master)/share/mgis/cmake \
-DMFEM_DIR=$MFEM_DIR
make -j 4 install
make check
cmake .. -DCMAKE_BUILD_TYPE=Release ...
: Configures the build in Release mode with GCC as the compiler. The installation prefix is set to../install
.-DMFrontGenericInterface_DIR=$(spack location -i mgis@master)/share/mgis/cmake
: Specifies the directory for theMFrontGenericInterface
configuration.make -j 4 install
: Compiles and installs the project using 4 parallel jobs.make check
: Runs the built-in checks to verify the installation.
By following these steps, you can explicitly manage dependencies and install MFEM-MGIS with a clear and configurable setup using Spack and CMake.
To utilize the parallel features of MFEM and MFEM-MGIS, specific settings must be enabled during the compilation process. This guide outlines the steps required to configure and build these libraries with parallel support.
Ensure you have installed the necessary dependencies (hypre
, metis
, mgis
, cmake
) and have Spack set up.
-
Navigate to the Build Directory
cd mfem/build
-
Clean the Build Directory
make clean rm CMakeCache.txt
-
Configure MFEM with MPI and METIS
Use CMake to configure the build with MPI and METIS support. Additionally, you can enable SuiteSparse and MUMPS for extra linear solvers.
cmake .. -DMFEM_USE_MPI=ON \ -DMFEM_USE_METIS_5=ON \ -DCMAKE_INSTALL_PREFIX=$PWD/mfem \ -DCMAKE_CXX_COMPILER=g++ \ -DMFEM_USE_SUITESPARSE=ON \ # Optional -DMFEM_USE_MUMPS=ON # Optional
-
Build and Install MFEM
make -j 4 install
-
Run Checks
make check
-
Set the MFEM_DIR Environment Variable
export MFEM_DIR=$PWD/mfem/lib/cmake/mfem
-
Navigate to the Build Directory
cd mfem-mgis/build
-
Clean the Build Directory
make clean rm CMakeCache.txt
-
Configure MFEM-MGIS with CMake
Use CMake to configure the build, specifying the compilers and installation directories.
cmake .. -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_INSTALL_PREFIX=$PWD/../install \ -DMFrontGenericInterface_DIR=$(spack location -i mgis@master)/share/mgis/cmake \ -DMFEM_DIR=$MFEM_DIR
-
Build and Install MFEM-MGIS
make -j 4 install
-
Run Checks
make check
-DMFEM_USE_MPI=ON
: Enables MPI support for parallel computing.-DMFEM_USE_METIS_5=ON
: Enables METIS support for mesh partitioning.-DMFEM_USE_SUITESPARSE=ON
: Enables SuiteSparse support for additional linear solvers (optional).-DMFEM_USE_MUMPS=ON
: Enables MUMPS support for additional linear solvers (optional).