Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The cmake command will be printed near the top of the e3sm build log (located in $EXEROOT/e3sm.bldlog.*). If you copy this command (you do need (and probably don't want) to copy the output redirection stuff at the end), you can 'cd $EXEROOT/cmake-bld; paste cmake cmd' and you'll then be configuring E3SM just like case.build would. Be sure not to forget to source $case/.env_mach_specific.sh first so that your environment matches the CIME build environment. Note: the e3sm.bldlog file won't exist until a build is first attemped. It might make sense to make a new tool for providing the cmake command directly.

Invoking ninja (or make) directly

If doing development and fixing compile errors, it would probably be most efficient to run make ninja directly rather than going through case.build. Be sure not to forget to source $case/.env_mach_specific.sh first so that your environment matches the CIME build environment. 'cd $EXEROOT/cmake-bld' and just run 'makeninja' ( you can add -jN of course too). Note: once the build is complete, you'll still need to run case.build in order for CIME bookkeeping to occur; it should only take a few seconds.

...

Be sure not to forget to source $case/.env_mach_specific.sh first so that your environment matches the CIME build environment. 'cd $EXEROOT/cmake-bld && makeninja'. Copy the build line for the broken compilation and paste it into your terminal and make tweaks.

...

Be sure not to forget to source $case/.env_mach_specific.sh first so that your environment matches the CIME build environment. 'cd $EXEROOT/cmake-bld' . Just find and edit the appropriate link.txt file (will typically be  cmake/cpl/CMakeFiles/e3sm.exe.dir/link.txt, edit, and re-run makeninja).

Temporarly tweak CPP defs for a component

...

You'll need to edit either E3SM/components/$component/bld/configure OR E3SM/components/$component/cime_config/buildlib_cmake and make a PR to merge your change.

Permanently change compiler flags for a component

You can use the COMP_NAME and COMP_CLASS selectors in our config_compilers.xml:

Code Block
<FFLAGS>
    <append COMP_NAME="cam"> -qspill=6000 </append>
</FFLAGS>

Permanently change Filepaths for a component

...

You'll need to edit E3SM/components/cmake/build_model.cmake as follows:

Code Block
if (MODELCOMP_ARGNAME STREQUAL "name-of-component")
  e3sm_add_flags("${SOURCE_FILE}" "-flag1 -flag2 ...")
endif()

...

You'll need to edit E3SM/components/cmake/build_model.cmake as follows:

Code Block
if (MODELCOMP_ARGNAME STREQUAL "name-of-component")
  e3sm_remove_flags("${SOURCE_FILE}" "-flag1 -flag2 ...")
endif()

...

This is a fairly common occurrence. We have a number of files in E3SM that would take a very long time to compile with optimizations on. You'll need to edit E3SM/components/cmake/build_model.cmake as follows:

Code Block
if (MODELCOMP_ARGNAME STREQUAL "name-of-component")
  list(APPEND NOOPT_FILES "file1" "file2" ...)
endif()

...

Clean my build

'cd $EXEROOT/cmake-bld; make ninja clean'

Totally clean my build

...

Build only a specific component

'cd $EXEROOT/cmake-bld; make ninja $comp_class' e.g ("atm")

Clean only a specific component

'cd $EXEROOT/cmake-bld/cmake/$comp_class; make ninja clean'