Difference between revisions of "How to compile WRF-SFIRE"
m (Afarguell moved page How to compile WRF-Fire to How to compile WRF-SFIRE) |
|||
(One intermediate revision by the same user not shown) | |||
Line 12: | Line 12: | ||
configuration files in order to build the software successfully. We will outline here general tips for configuration and compilation of WRF-SFIRE as well as specific fixes for various platforms. | configuration files in order to build the software successfully. We will outline here general tips for configuration and compilation of WRF-SFIRE as well as specific fixes for various platforms. | ||
− | =Prerequisites= | + | ==Prerequisites== |
Prerequisite libraries must be compiled using the same combination of C and fortran 90 compilers that you | Prerequisite libraries must be compiled using the same combination of C and fortran 90 compilers that you | ||
Line 39: | Line 39: | ||
− | = | + | ==Step by step directions== |
+ | |||
+ | * [[How to get WRF-SFIRE|Get WRF-SFIRE]] from the repository or a mirror. | ||
+ | * '''cd WRF-SFIRE''' | ||
+ | * '''./clean -a''' to delete the remains of any previous build and ensure start from a known state | ||
+ | * '''./configure''', choose nesting 1=basic. | ||
+ | * '''./compile em_fire >& compile_em_fire.log''' | ||
+ | * Search for '''Err''' in '''compile_em_fire.log'''. If not found, all is well. | ||
+ | ** If you see error like '''mpif90: -f90=something option not recognized''', run '''./clean -a'''; rerun '''./configure''', edit the file '''configure.wrf''' and change the line '''DM_FC = mpif90 -f90=$(SFC)''' to read just '''DM_FC = mpif90''' Unfortunately, some versions of MPI crash with the '''-f90''' flag, and some crash without. You will need to repeat this every time after you run '''./configure'''. | ||
+ | * '''./compile em_real >& compile_em_real.log''' | ||
+ | * Search for '''Err''' in '''compile_em_real.log'''. If not found, all is well. | ||
+ | ** If you see error like '''mpif90: -f90=something option not recognized''', run '''./clean -a'''; rerun '''./configure''', edit the file '''configure.wrf''' and change the line '''DM_FC = mpif90 -f90=$(SFC)''' to read just '''DM_FC = mpif90''' Unfortunately, some versions of MPI crash with the '''-f90''' flag, and some crash without. You will need to repeat this every time after you run '''./configure'''. |
Latest revision as of 15:44, 2 July 2020
Compiling the WRF-SFIRE software is generally supported on most any *NIX based operating system including Mac OSX. The source code is a mix of C and fortran 90 along with a series of preprocessing directives (utilizing cpp, m4, and other custom scripts). The code is known to compile with a wide variety of compilers including ifort, pgf90, gfortran, g95, and xlf90. In addition, the WRF software infrastructure supports parallel execution using a combination of MPI and OpenMP. The WRF-SFIRE software distribution uses the same build system as released with WRF, for which detailed information can be found in the WRF User's Guide.
While various compiler and platform combinations are known to work, often one must tweak the configuration files in order to build the software successfully. We will outline here general tips for configuration and compilation of WRF-SFIRE as well as specific fixes for various platforms.
Prerequisites
Prerequisite libraries must be compiled using the same combination of C and fortran 90 compilers that you plan to build WRF-SFIRE with. Failure to do so will likely result in linking errors, or worse, random bugs at run time. All libraries (required and optional) use a standard GNU autotools configuration script. The build process for each is as follows:
- Choose a prefix directory where you want to install (i.e. PREFIX=/opt).
- Set environment variables dictating your choice of compilers (CC,CXX,FC,F77,F90).
- See specific help for each software package by running ./configure --help.
- Run the configure script with the argument --prefix=$PREFIX indicating the installation location.
- make
- make install
For example, if you are installing a gcc/g95 build into /opt/gcc-g95, you would issue the following series of commands.
CC=gcc CXX=g++ FC=g95 F77=g95 F90=g95 ./configure --prefix=/opt/gcc-g95
make
make install
Note, depending on your choice of prefix, you may need to be root to run the final command.
Required:
- NetCDF
- After installation set the environment variable NETCDF to the prefix directory. For example in bash, export NETCDF=$PREFIX.
Optional:
- MPICH
- Make sure the directory, $PREFIX/bin, is in your search path. For example in bash, export PATH="$PATH:$PREFIX/bin".
Step by step directions
- Get WRF-SFIRE from the repository or a mirror.
- cd WRF-SFIRE
- ./clean -a to delete the remains of any previous build and ensure start from a known state
- ./configure, choose nesting 1=basic.
- ./compile em_fire >& compile_em_fire.log
- Search for Err in compile_em_fire.log. If not found, all is well.
- If you see error like mpif90: -f90=something option not recognized, run ./clean -a; rerun ./configure, edit the file configure.wrf and change the line DM_FC = mpif90 -f90=$(SFC) to read just DM_FC = mpif90 Unfortunately, some versions of MPI crash with the -f90 flag, and some crash without. You will need to repeat this every time after you run ./configure.
- ./compile em_real >& compile_em_real.log
- Search for Err in compile_em_real.log. If not found, all is well.
- If you see error like mpif90: -f90=something option not recognized, run ./clean -a; rerun ./configure, edit the file configure.wrf and change the line DM_FC = mpif90 -f90=$(SFC) to read just DM_FC = mpif90 Unfortunately, some versions of MPI crash with the -f90 flag, and some crash without. You will need to repeat this every time after you run ./configure.