How to compile CFAST on Mac OS X and Linux
The Consolidated Model of Fire and Smoke Transport (CFAST) model is a two-zone fire model developed by NIST. From the NIST website, you can download the Windows version of CFAST, which includes a graphical user interface frontend (CEdit) for the creation and execution of CFAST cases. However, there are no downloadable CFAST binaries or user interfaces for the Mac and Linux platforms; you must compile CFAST yourself.
This guide will help you compile the CFAST executable on Mac OS X and Linux. This is useful for running CFAST cases on Mac or Linux machines, which is especially useful for scripting CFAST runs for optimization problems or running CFAST on a large number of cases in batch mode.
You will need the Intel Fortran compilers (ifort) and a copy of the CFAST source code from the CFAST Google Code site. You can try to use other free compilers, but I find that the Intel compilers are the most compatible and produce the most optimized (fastest) binaries. Note: there are heavily discounted Intel compilers for students.
To download the CFAST source code, the easiest way is to install subversion on your Mac or Linux machine and issue the following command:
svn co http://cfast.googlecode.com/svn/trunk/ cfast
Once you have the CFAST source code on your machine, you can perform the following steps to compile the CFAST executable.
1. In the cfast/CFAST/ directory, edit the makefile_linux file and make the following changes:
- Replace ‘radation’ with ‘radiation’; this is a typo
- Add ‘cyl_conduct.o’, ‘datamodules.o’, and ‘ssHeaders.f’ to the obj_serial section
- Add the following lines to the Object Dependencies section:
- cyl_conduct.o : cyl_conduct.f
- datamodules.o : datamodules.f90
- ssHeaders.o : ssHeaders.f
- Add ‘cyl_conduct.f’, ‘datamodules.f90′, and ‘ssHeaders.f’ to the cfast.o line
Note: The corrected makefile can also be downloaded from here.
2. Copy datamodules.f90 from the cfast/CFAST/Include/ directory to the cfast/CFAST/Source/ directory
3. Change to the cfast/CFAST/Source/ directory
4. Run the command ‘ifort -c datamodules.f90′ to compile the datamodules and iofiles modules
5. Finally, run the command ‘make -f ../makefile_linux intel_osx_64’ to build CFAST
5b. If you are running Linux, the command is ‘make -f ../makefile_linux intel_linux’
Using these steps, I was able to build CFAST on an Intel Macbook Pro running 10.6 (Snow Leopard) as well as a Linux machine running CentOS release 5.6 with the 64-bit Intel Fortran Compiler version 12.0.4.184.
With your new CFAST executable file (cfast_osx_intel_64), you can run a CFAST case using the following syntax:
./cfast_osx_intel_64 casename


