Skip to content

Warning

This is as a Lab Notebook which describes how to solve a specific problem at a specific time. Please keep this in mind as you read and use the content. Please pay close attention to the date, version information and other details.

Installing MFEM on the HPCC

Our research group is developing a new MFEM module as part of an NSF CISS award. Since we need to mess around with the installation it doesn't make sense to install globally. The following are instructions I used to install MFEM in a folder in my home directory. The videos at the end of this post walk through my process to figure out what needed to be done.

I'm not sure many people will need these specific instructions but I also recorded some over-the-shoulder videos of the process. My hope is that some people may learn something watching these (very long) videos.

See https://mfem.org/building/ for the official detailed installation instructions.

  • Dirk

The first thing you need to do is create a n empty working directory and cd into that empty directory

Load the needed modules

1
2
3
4
5
6
7
module swap GCCcore GCCcore/11.2.0
module load mesa
module load SDL2
module load glew
module load freetype
module load fontconfig
module load CMake

or, better yet, create a script to load modules

1
2
3
4
5
6
7
8
9
cat << EOF > setup.sh
module swap GCCcore GCCcore/11.2.0
module load mesa
module load SDL2
module load glew
module load freetype
module load fontconfig
module load CMake
EOF

Run the script using the following command:

1
source ./setup.sh

Download the needed software

1
2
3
4
5
6
7
8
9
wget https://github.com/mfem/tpls/raw/gh-pages/metis-4.0.3.tar.gz

wget https://bit.ly/mfem-4-5-2 
mv mfem-4-5.2 mfem-4-5-2.tgz

wget https://bit.ly/glvis-4-2
mv glvis-4-2 glvis-4-2.tgz

wget https://github.com/hypre-space/hypre/archive/refs/tags/v2.29.0.tar.gz

Untar folders

1
2
3
4
tar -xzvf glvis-4-2.tgz
tar -xzvf hypre-v2.29.0.tar.gz
tar -xzvf metis-4.0.3.tar.gz
tar -xavf mfem-4-5-2.tgz

Build hypre

1
2
3
4
5
cd hypre-2.29.0/src/
./configure --disable-fortran
make -j
cd ../..
ln -s hypre-2.29.0 hypre

Build metis

1
2
3
4
cd metis-4.0.3
make OPTFLAGS=-Wno-error=implicit-function-declaration
cd ..
ln -s metis-4.0.3 metis-4.0

build mfem

1
2
3
4
5
cd mfem-4.5.2
make parallel -j
cd examples
make -j
cd ../..

download glm

1
git clone https://github.com/g-truc/glm.git

build glvis

1
2
cd glvis-4.2
make MFEM_DIR=../mfem-4.5.2 -j

Test everything

Step 1: Start ondemand desktop and open a terminal.
Step 2: Run the above module commands or type source ./setup.sh Step 3: cd to glvis-4.2 directory and run ./glivs
Step 4: Open a second terminal
Step 5: Run the above module commands or type source ./setup.sh
Step 6: cd to mfem-4.5.2/examples and run one of the examples

Videos

The following videos were recorded when figuring out how to install FEM. These are not edited and demonstrate the debugging process. Consider watching at double speed as not to be board.