Skip to content

Compiling FDS with HYPRE

Randy McDermott edited this page Oct 17, 2024 · 11 revisions

The steps to include the HYPRE library of linear solvers from Lawrence Livermore National Labs in your FDS build are:

  1. Clone the hypre repo
  2. Build and install hypre
  3. Modify your startup script

Step 1: Clone the HYPRE repo

The hypre repo can be obtained here. Clone (or first fort, then clone) this repo to your local system.

Step 2: Build and install hypre

Change directories to the $HYPRE_repo/src/ directory and create a file called confmake.sh, then give this file executable permissions. Note: If you have built hypre previously, it is a good idea to make distclean before rerunning your confmake.sh.

cd <hypre>/src/
touch confmake.sh
chmod +x confmake.sh

Edit this file with the following depending on your build:

For Intel...

Make sure you have OneAPI installed on your system (see Compiling FDS with Intel oneAPI).

./configure CC=mpiicx FC=mpiifort CFLAGS="-O3 -fno-unsafe-math-optimizations -fp-model=precise" FFLAGS="-O3 -fno-unsafe-math-optimizations -fp-model=precise" \
            --prefix=/path/to/hypre/intel/install
make install

For GNU...

Make sure you have gcc and openmpi installed on your system.

./configure CC=mpicc FC=mpifort CFLAGS="-O3" FFLAGS="-O3" \
            --prefix=/path/to/hypre/gnu/install
make install

Next, run make clean and then confmake.sh.

make distclean
./confmake.sh

Make the test cases and run.

make test
cd test/
./ij

If all goes well, you should have an installation of hypre in, for example, /path/to/hypre/gnu/install.

Step 3: Modify your startup script

Add the following to your ~/.bashrc (Linux). This example uses the GNU build, modify as needed for Intel.

#HYPRE:
export HYPRE_HOME=/path/to/hypre/gnu/install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HYPRE_HOME/lib

Then restart your terminal for the changes to take effect.

With $HYPRE_HOME defined, the FDS makefile will link the hypre. This then allows the 'ULMAT HYPRE' solver to be used as the pressure solver. For example, in your input file you would do,

&PRES SOLVER='ULMAT HYPRE'/
Clone this wiki locally