Versions Compared

Key

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

...

List of files that influence the build, both in our repo and in the case directory.

  • E3SM/cime/_config/e3sm/machines/config_machines.xml: Contains list of valid compilers (COMPILERS) and environment setup (modules, environment_variables).
  • E3SM/cime/_config/e3sm/machines/config_compilers.xml: Contains specifications (flags, link flags, exe names) for compilers (gcc, pgi) as well as machine-specific modifications for those compilers.
  • E3SM/cime/_config/e3sm/machines/Depends.$compiler.$machine.cmake: Contains machine/compiler-specific flag changes for specific E3SM component files
  • E3SM/cime_config/machines/Depends.$compiler.$machine: Contains machine/compiler-specific flag changes for shared-lib files, this system still uses Makefile syntax
  • E3SM/components/CMakeLists.txt: The root CMakeLists.txt file for E3SM, mostly just iterates over components and calls functions
  • E3SM/components/cmake/cmake_util.cmake: Contains some generally useful functions for cmake
  • E3SM/components/cmake/build_mpas_model.cmake: Implements the handoff between E3SM's CMake system to MPAS's Cmake system
  • E3SM/components/cmake/common_setup.cmake: Cmake setup common to all core components, this is only invoked ones (AFTER mpas is configured)

  • E3SM/components/cmake/build_model.cmake: Implements how an individual core component gets configures (involves reading the Filepath and CCSM_cppdefs, globbing files, etc)
  • E3SM/components/cmake/*/CMakeLists.txt: Very thin CMakeLists.txt files for each component type, this is just to ensure each component get it's own build area
  • E3SM/components/*/bld/configure: Perl configure script for component, should produce Filepath and CCSM_cppdefs files
  • E3SM/components/*/cime_config/buildnml: The buildnml script for component, controls what flags get passed to $component/bld/configure
  • E3SM/components/*/cime_config/buildlib: The legacy buildlib driver for the classic deprecated Makefile-based build system
  • E3SM/components/*/cime_config/buildlib_cmake: A insertion point for last-minute, component-specific changes before cmake is called. For example, mosart uses this file, not bld/configure, to generate Filepath and CCSM_cppdefs
  • E3SM/components/mpas-source/src/CMakeLists.txt: The root CMakeLists.txt for MPAS
  • E3SM/components/mpas-source/src/cmake_utils.cmake: Contains some generally useful functions for configuring MPAS
  • E3SM/components/mpas-source/src/build_core.cmake: A generic implementation for building MPAS cores
  • E3SM/components/mpas-source/src/core_landice/landice.cmake: The CMake definition of the landice core
  • E3SM/components/mpas-source/src/core_ocean/ocean.cmake: The CMake definition of the ocean core
  • E3SM/components/mpas-source/src/core_seaice/seaice.cmake: The CMake definition of the seaice core
  • $case/Buildconf/*conf: The various build conf dirs for all active components, the Filepath and CCSM_cppdefs files for each component live here
  • $EXEROOT/cmake-bld: The root cmake build/binary directory 

...

Just edit the $case/Buildconf/${component}conf/CCSMCIME_cppdefs file and re-run either case.build or the appropriate cmake command

...

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

Permanently change compile flags for a specific file for only specific compilers/machines for E3SM component source files

The three actions above can also be made to E3SM/cime/config/e3sm/machines/Depends.$compiler.$machine.cmake in order to only impact that compiler/machine.

Use the classic build system

If you suspect something in CMake or the changes made to support CMake are causing a problem, you can always go back to using the classic build system by running './case.build --use-old'Note, there can be some confusion here because the Depends.* filename can have a compiler name, a machine name, or both. All matching Depends.* files will be loaded for a build. The order in which these Depends files are processed is: Depends.$compiler, Depends.$machine, Depends.$compiler.$machine. 

Permanent change compiler flags for sharedlib source files

Our sharedlib builds still use the class Makefile-based system to drive the builds for most of our sharedlibs. If machine/compiler-specific flag tweaks are needed, you can use the same Depends.* system described immediately above, except be sure to omit the .cmake suffix for the filename and use Makefile syntax.

Clean my build

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

...