2. Build the Executables

2. Build the Executables
schramm Wed, 08/11/2021 - 16:34

Estimated time: 20-25 minutes

Instructions for loading the proper modules and/or setting the correct environment variables can be found in the env/ directory in files named build_<platform>_<compiler>.env. The commands in these files can be directly copy-pasted to the command line or the file can be sourced.

Note:  If you are using a bash Unix environment, you can source the build_<platform>_<compiler>.env file as follows:
source env/build_cheyenne_intel.env
Note: If you are using a csh/tcsh Unix environment, you will need to make a copy of the build_<platform>_<compiler>.env file, and change export  to setenv as shown below:
cd env
cp build_cheyenne_intel.env build_cheyenne_intel_tcsh.env

Make the following changes to build_cheyenne_intel_tcsh.env.  Change

export CMAKE_C_COMPILER=mpicc
export CMAKE_CXX_COMPILER=mpicxx
export CMAKE_Fortran_COMPILER=mpif90
export CMAKE_Platform=cheyenne.intel

to

setenv CMAKE_C_COMPILER mpicc
setenv CMAKE_CXX_COMPILERmpicxx
setenv CMAKE_Fortran_COMPILER mpif90
setenv CMAKE_Platform cheyenne.intel

The modified script can then be sourced as follows:

cd ..
source ./env/build_cheyenne_intel_tcsh.env

to set the build environment.

Build the executables as follows (for both bash and csh/tcsh users):

mkdir build
cd build

Run cmake to set up the Makefile, then run make:

cmake .. -DCMAKE_INSTALL_PREFIX=..
make -j 4  >& build.out &

Output from the build will be in the $SR_WX_APP_TOP_DIR/build/build.out file. When the build completes, you should see the forecast model executable NEMS.exe and eleven pre- and post-processing executables in the $SR_WX_APP_TOP_DIR/bin directory.