-
Notifications
You must be signed in to change notification settings - Fork 626
Compiling FDS with Third‐Party Libraries
As FDS moves into the realm of high-performance computing, we are more and more jumping onto new systems and need to build the code from scratch and link to the requisite libraries: MPI, Hypre, and Sundials. This wiki outlines our new approach to managing the Hypre and Sundials build and linking process. MPI libraries are typically handled by the local system administrator and loaded via modules. See the documentation for your system.
Pick a local directory where you will clone fds
, hypre
, and sundials
. Optionally, you can name this directory $FIREMODELS
in your startup script (e.g., ~/.bashrc
). For example,
export FIREMODELS=~/firemodels
Next, clone the repos. Here I am using the central repos for each code, but you may use your fork if you wish.
cd $FIREMODELS
git clone [email protected]:firemodels/fds.git
git clone [email protected]:hypre-space/hypre.git
git clone [email protected]:LLNL/sundials.git
Here we will use the Intel MPI Linux target as an example, but all the other targets should compile the same way.
cd fds/Build/impi_intel_linux
./make_fds.sh
Go get a coffee. In five or ten minutes you should be done. Note that the next time you compile FDS only it will be much faster to build since you will already have the libraries compiled.
The FDS Makefile looks for $HYPRE_HOME
and $SUNDIALS_HOME
path variables. If those were already set to an external shared library, then there is no need to clone and build the libraries. However, even if the libraries exist on your system, they may be old versions and you may want to rebuild them yourself.
The FDS make_fds.sh
script first looks to see if the libraries exist in $FIREMODELS/libs
. If a library exists, then the make script assumes you do not need to rebuild it unless you explicitly say so (more on this later). If the library does not exist, then the make script looks for the repository and if it finds it it builds and installs the library into libs
. If the libraries are rebuilt then the make scripts set (or redefine) $HYPRE_HOME
and $SUNDIALS_HOME
accordingly to point to the versions of the libraries in $FIREMODELS/libs
.
Usually, the first time you run the make_fds.sh
script you will be building both Hypre and Sundials and then FDS. The next time you run make_fds.sh
the libs will be found and you skip straight to rebuilding FDS.
If, for whatever reason, you want to rebuild the libraries, just add the flag --clean-hypre
or --clean-sundials
to the make command. For example,
./make_fds.sh --clean-hypre --clean-sundials
Additionally, You can also use the --clean-fds
flag to remove the *.o and *.mod files for the current target. To clean and rebuild all repositories, use the --clean-all
flag.
For Windows users, the steps and flags remain the same, except the executable is make_fds.bat
.
make_fds --clean-hypre --clean-sundials
FDS requires certain versions of the libraries for compatibility. For example, the Sundials interface changed at v7.0.0
so FDS requires v6.7.0
. The make script explicitly does a git checkout v6.7.0
to make sure the right version is compiled. Similarly for Hypre we checkout v2.32.0
.