This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

MFEM

MFEM Installation and Tutorials

    MFEM is a free, lightweight, scalable C++ library for finite element methods.

    MFEM Installation

    MFEM installation information can be found here. Follow the appropriate installation instructions according to your necessity.

    More detailed guide can be found in this README file. This might be needed to build MFEM with custom options for example linking with other libraries.

    Installation using cmake on SCOREC machines

    1. Clone the mfem repository
    git clone https://github.com/mfem/mfem.git
    

    or get the tarball from here.

    1. Load the necessary modules
    module unuse /opt/scorec/spack/tmod/tinux—rhet7—x86_64/Core
    module use /opt/scorec/spack/v0181_1/lmod/linux—rhe17—x86_64/Core
    module use /opt/scorec/modules
    module load gcc/11.2.0 mpich/4.0.2
    module load cmake/3.20
    
    1. Install hypre and metis using these instructions from MFEM website. They showed the installation process for metis-4.0 but I used metis-5.1.0 and it worked fine.

    2. Create a configuration file with the following content

    cmake -S mfem-4.6 -B mfem-build \
      -DMETIS_DIR=metis-5.1.0 \
      -DMFEM_USE_MPI=ON \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DCMAKE_INSTALL_PREFIX=/lore/<your_username>/mFEM/install/mfem-mpi
    

    change <your_username> to your username. It’s preferable to use the /lore directory for installation. Read more about storage management on SCOREC machines in the FAQ section.