case.buildΒΆ is a script in CIMEROOT/scripts/Tools.

$ ./ --help
usage: [-h] [-d] [-v] [-s] [--ninja] [--separate-builds]
                  [--sharedlib-only | -m | -b {cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare,mct,pio,gptl} [{cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare,mct,pio,gptl} ...]
                  | --skip-provenance-check | --clean-all | --clean
                  [{cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare,mct,pio,gptl} ...]
                  | --clean-depends
                  [{cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare} ...]]

Builds the case.

case.setup must be run before this. In addition, any changes to env_build.xml
must be made before running this.

This must be run before running case.submit.

There are two usage modes; both modes accept the --caseroot option, but
other options are specific to one mode or the other:

1) To build the model:

   Typical usage is simply:

   This can be used for the initial build as well as for incrementally
   rebuilding after changing some source files.

   Optionally, you can specify one of the following options, although this is
   not common:
      --build ...

   In addition, if you'd like to skip saving build provenance (typically because
   there was some error in doing so), you can add:

2) To clean part or all of the build:

   To clean the whole build; this should be done after modifying either
   env_build.xml or Macros.make:
      ./ --clean-all

   To clean select portions of the build, for example, after adding new source
   files for one component:
      ./ --clean ...
      ./ --clean-depends ...

positional arguments:
  caseroot              Case directory to build.
                        Default is current directory.

  -h, --help            show this help message and exit
  -d, --debug           Print debug information (very verbose) to file /home/titters/devel/E3SM/cime/master/scripts/Tools/
  -v, --verbose         Add additional context (time and file) to log messages
  -s, --silent          Print only warnings and error messages
  --ninja               Use ninja backed for CMake (instead of gmake). The ninja backend is better at scanning fortran dependencies but seems to be less reliable across different platforms and compilers.
  --separate-builds     Build each component one at a time, separately, with output going to separate logs
  --dry-run             Just print the cmake and ninja commands.
  --sharedlib-only      Only build shared libraries.
  -m, --model-only      Assume shared libraries are already built.
  -b {cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare,mct,pio,gptl} [{cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare,mct,pio,gptl} ...], --build {cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare,mct,pio,gptl} [{cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare,mct,pio,gptl} ...]
                        Libraries to build.
                        Will cause namelist generation to be skipped.
                        Do not check and save build provenance
  --clean-all           Clean all objects (including sharedlib objects that may be
                        used by other builds).
  --clean [{cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare,mct,pio,gptl} ...]
                        Clean objects associated with specific libraries.
                        With no arguments, clean all objects other than sharedlib objects.
  --clean-depends [{cpl,atm,lnd,ice,ocn,rof,glc,wav,esp,iac,csmshare} ...]
                        Clean Depends and Srcfiles only.
                        This allows you to rebuild after adding new
                        files in the source tree or in SourceMods.