GEOS-ESM / GEOSgcm

GEOS Earth System Model GEOSgcm Fixture
Apache License 2.0
35 stars 13 forks source link

Add Special NCCS Build Preset #744

Closed mathomp4 closed 8 months ago

mathomp4 commented 8 months ago

This is an attempt to change the build pattern using CMakePresets.json to work smarter at NCCS. If this works, let say you have a checkout of GEOSgcm in:

/discover/swdev/mathomp4/Models/GEOSgcm-FixPresets

along with the following environment variables (with examples for me):

CMAKE_PRESET_NAME=NCCS
CMAKE_BUILD_LOCATION=/discover/nobackup/projects/gmao/SIteam/mathomp4/cmake-builds
CMAKE_INSTALL_LOCATION=/discover/nobackup/projects/gmao/SIteam/mathomp4/cmake-installs

Then when you do:

cmake --preset Debug && cmake --build --preset Debug -j 10

it will put the build dir in:

/discover/nobackup/projects/gmao/SIteam/mathomp4/cmake-installs/GEOSgcm-FixPresets/build-Debug

and installs to:

/discover/nobackup/projects/gmao/SIteam/mathomp4/cmake-installs/GEOSgcm-FixPresets/install-Debug

The other style is used by setting:

export CMAKE_PRESET_NAME=Default

This triggers the "old" way where builds will be at the root of the build. So if the code is in:

/discover/swdev/mathomp4/Models/GEOSgcm-FixPresets

then you'll get:

/discover/swdev/mathomp4/Models/GEOSgcm-FixPresets/build-Debug
/discover/swdev/mathomp4/Models/GEOSgcm-FixPresets/install-Debug

Note: This takes discipline as it uses the sourceDirName for a build. That is, the name of the directory holding the code, so for /discover/swdev/mathomp4/Models/GEOSgcm-FixPresets, it uses GEOSgcm-FixPresets.