Skip to content

Example Compilation

Dale edited this page Mar 4, 2022 · 1 revision

The general process for compiling is given below. With the exception of step 1, this is independent of the system you are compiling on. You may also wish to change the number of processors used to compile using the -j flag in steps 5/6 depending on your system.

  1. Load Modules. These include the compiler, netcdf and hdf modules.

  2. Define install directories of FABM (>= FABMv1.0) and XIOS (>= XIOSv2.5):

    export FABM_HOME=<path/to/fabm>
    export XIOS_HOME=<path/to/xios>
    NEMO_HOME=<path/to/nemo>
    
  3. Declare configuration options:

    ARCH="name of system architecture"
    CFG="name of configuration to be created"
    REF="name of reference configuration"
    
  4. Initialise compile directory with a dry-run compile. This step allows you to check that you are creating what you expect, and to make changes to the cpp file and MY_SRC directory if different from the reference configuration

    cd $NEMO_HOME
    printf 'y\nn\nn\ny\nn\nn\nn\nn\n' |./makenemo -n $CFG -r $REF -m $ARCH -j 0
    
  5. Perform a clean compile to remove any old build files:

    ./makenemo -n $CFG -r $REF -m $ARCH -j 4 clean
    
  6. Full compilation:

    ./makenemo -n $CFG -r $REF -m $ARCH -j 4