-
Notifications
You must be signed in to change notification settings - Fork 630
FDS Compilation
This page describes how to compile FDS, which is written in Fortran (2018 standard). We use the latest version of the Intel oneAPI Base and HPC Toolkits, which include the Fortran compiler and MPI libraries. We also test our compilation with the Gnu Fortran compiler. If you find an up-to-date Fortran compiler that does not work, let us know.
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. More often for computing clusters, MPI libraries are typically handled by the local system administrator and loaded via modules. See the documentation for your system.
Before compiling FDS, ensure that you have installed the necessary compilers and MPI libraries. To compile FDS, a Fortran compiler is sufficient. However, building Hypre and Sundials requires both C and C++ compilers. Refer to these links for detailed instructions on setting up your environment.
- Setting up Windows environment
- Setting up macOS environment
- Setting up Linux environment
- Setting up environment in Supercomputing Clusters
It is recommended to get an account on GitHub and fork the firemodels/fds
Repository. See the Git Notes Getting Started wiki for more details.
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. If you don't have a GitHub account, you can use HTTPS protocol to clone these repositories.
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
.
If you get stuck, take a look at the make_fds
script to better understand what is actually happening. Chances are that there a different path name or compiler version number installed on your machine. Look at the makefile
and ensure that everything associated with your build target is defined.