Just as the SMOKE modeling programs are clients of the I/O API library, the Makefile system for SMOKE is a client of the Makefile system for the I/O API; the process of building SMOKE is quite similar to the process for building the I/O API.This document describes how to build SMOKE cleanly and easily (without all the errors and wrong-headedness of a certain Wiki document).
As suggested in the detailed I/O API build instructions:First, acquire netCDF and the libraries it requires -- these are configuration dependent and can be found by the netCDF commands
nc-config --libsFor all except netCDF-Fortran, it is easiest if you install the libraries from your Linux distribution's repositories...
nf-config --flibsThen download and build the I/O API.
It is often very useful to have both the optimized and the debug/traceback/check-everything versions; some large-array problems (e.g., large MOVES inventories) require some programs to be built with the medium Linux2_x86_64 memory model (e.g.,
BIN=Linux2_x86_64gfort10_medium
).Note that you can select multiple binary types
BIN
that you want to build and then customize the make-targetsbins, binrelink
, etc. in the ioapi/Makefile and m3tools/Makefile to build multiple binary types in one step.Note also that for gfortran versions 10 or later, you need to choose the
BIN=*gfort10*
-types; for 2024 or later INTEL OneAPI compilers. you need to chooseBIN=*ifx*
-types.
Then download SMOKE from GitHub:git clone https://github.com/CEMPD/SMOKE.git SMOKE_v5.0and cd to the src sub-directory. Edit Makeinclude for your installation:
- Edit make-variable
BASEDIR
to match the directory path for this src sub-directory
- Un-comment the
IFLAGS
andEFLAGS
for your compiler-set
- If you wish to compile multiple binary types
BIN
, copy the directives for make-targetsbins, binrelink
, etc., from the m3tools/Makefile to the SMOKE src/Makefile accordingly, to build multiple binary types in one step.Then for each of your choices of
BIN
, setenv BIN <your choice> ; make dir; makeUnfortunately, the current SMOKE scripting-system makes it quite difficult to switch from running the optimized (e.g.,
BIN=Linux2_x86_64gfort10
) to debug/check-everything (e.g.,BIN=Linux2_x86_64gfort10dbg
).
Update the I/O API source if desired: git pull -a and then either setenv BIN <your choice> ; make or make bins, as appropriate. Update the SMOKE source if desired: git pull -aThen for each
BIN
setenv BIN <your choice> ; make relink.