Skip to content

Commit

Permalink
Merge PR #82 (Build KPP-Standalone only upon request)
Browse files Browse the repository at this point in the history
This merge brings PR #82 (Do not build KPP-Standalone executable unless
specifically requested at compile time, by @yantosca) into the GEOS-Chem
"no-diff-to-benchmark" development stream.

This PR adds updates to the CMake files so that the KPP-Standalone will
only be built if the user configures with -DKPPSA=y.

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Feb 6, 2025
2 parents ef2e2ff + 11e7d2e commit f2fd5b3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] - TBD
### Changed
- Bumped `jinja2` to version 3.1.5 in `docs/requirements.txt` to fix a security issue
- Changed the build sequence so that the KPP-Standalone is only built when configuring with `-DKPPSA=y`

## [14.5.1] - 2025-01-10
### Added
Expand Down
10 changes: 9 additions & 1 deletion CMakeScripts/GC-ConfigureClassic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ function(configureGCClassic)
)
gc_pretty_print(VARIABLE HCOSA IS_BOOLEAN)

#-------------------------------------------------------------------------
# Build the KPP-Standalone?
#-------------------------------------------------------------------------
set(KPPSA OFF CACHE BOOL
"Switch to build the KPP-Standalone Box Model"
)
gc_pretty_print(VARIABLE KPPSA IS_BOOLEAN)

#-------------------------------------------------------------------------
# Build Luo et al wetdep scheme?
# (Currently a research option... turn OFF by default)
Expand Down Expand Up @@ -208,7 +216,7 @@ function(configureGCClassic)
INTERFACE FASTJX
)
endif()

#-------------------------------------------------------------------------
# Export the following variables to GEOS-Chem directory's scope
#-------------------------------------------------------------------------
Expand Down
44 changes: 24 additions & 20 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ set_target_properties(${EXE_FILE_NAME}
)

#-----------------------------------------------------------------------------
# If GEOS-Chem Classic has been configured with -DKPPSA=y, then:
#
# Define the KPP standalone executable:
# 1. Specify a cache variable with the default target name
# 2. Specify the location of the main program
Expand All @@ -51,26 +53,28 @@ set_target_properties(${EXE_FILE_NAME}
# This should now fix the issue reported by @msulprizio in:
# https://github.com/geoschem/GCClassic/issues/78
#-----------------------------------------------------------------------------
set(KPPSA_FILE_NAME kpp_standalone CACHE STRING
"Default name for the KPP standalone executable file")
mark_as_advanced(KPPSA_FILE_NAME)
add_executable(${KPPSA_FILE_NAME}
GEOS-Chem/KPP/standalone/kpp_standalone.F90
)
if("${MECH}" STREQUAL fullchem OR "${MECH}" STREQUAL custom)
target_link_libraries(${KPPSA_FILE_NAME}
PUBLIC
KPPStandalone
)
set_target_properties(${KPPSA_FILE_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
else()
set_target_properties(${KPPSA_FILE_NAME}
PROPERTIES
EXCLUDE_FROM_ALL TRUE
)
if (${KPPSA})
set(KPPSA_FILE_NAME kpp_standalone CACHE STRING
"Default name for the KPP standalone executable file")
mark_as_advanced(KPPSA_FILE_NAME)
add_executable(${KPPSA_FILE_NAME}
GEOS-Chem/KPP/standalone/kpp_standalone.F90
)
if("${MECH}" STREQUAL fullchem OR "${MECH}" STREQUAL custom)
target_link_libraries(${KPPSA_FILE_NAME}
PUBLIC
KPPStandalone
)
set_target_properties(${KPPSA_FILE_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
else()
set_target_properties(${KPPSA_FILE_NAME}
PROPERTIES
EXCLUDE_FROM_ALL TRUE
)
endif()
endif()

#-----------------------------------------------------------------------------
Expand Down

0 comments on commit f2fd5b3

Please sign in to comment.