Skip to content

Commit

Permalink
Updates for Spack Support, Round 2
Browse files Browse the repository at this point in the history
Due to insufficient grepping on my part, some remnants of the
"non-canonical" CMake still remain. Apparently these were not necessary
changes for Spack, but they are changes that unify the CMake style of
GEOS to be more like "correct" CMake.

In this go-around, it is mainly finding `INC_ESMF` which I apparently
forgot to grep for last time (I was focused on NetCDF), and some
non-canonical OpenMP calls.

See GEOS-ESM/GEOSgcm#387 for the meta-issue.
  • Loading branch information
mathomp4 committed Mar 21, 2022
1 parent 3d9ee60 commit 77e3bcb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
7 changes: 3 additions & 4 deletions CARMAchem_GridComp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ foreach (dir ${src_directories})
list (APPEND srcs ${tmpsrcs})
endforeach()

set (dependencies Chem_Shared Chem_Base GMAO_mpeu)
set (dependencies Chem_Shared Chem_Base GMAO_mpeu esmf)
esma_add_library (${this} SRCS ${srcs} DEPENDENCIES ${dependencies})
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/CARMA/source/base>)
target_include_directories (${this} PUBLIC ${INC_ESMF})

new_esma_generate_automatic_code (
${this} CARMAchem_Registry.rc
Expand All @@ -31,7 +30,7 @@ set (resource_files
CARMAchem_Registry.rc
)

install(
FILES ${resource_files}
install(
FILES ${resource_files}
DESTINATION etc
)
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- More updates to CMake for spack

## [1.9.1] - 2022-03-18

### Changed
Expand Down
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ set (alldirs
StratChem_GridComp
GMIchem_GridComp
CARMAchem_GridComp
GEOSCHEMchem_GridComp
GEOSCHEMchem_GridComp
MATRIXchem_GridComp
MAMchem_GridComp
MAMchem_GridComp
GAAS_GridComp
H2O_GridComp
TR_GridComp
TR_GridComp
GEOSachem_GridComp
DNA_GridComp
HEMCO_GridComp
Expand All @@ -28,8 +28,7 @@ set (srcs
esma_add_library (${this}
SRCS ${srcs}
SUBCOMPONENTS ${alldirs}
DEPENDENCIES MAPL Chem_Shared Chem_Base GOCART_GridComp GOCART2G_GridComp
INCLUDES ${INC_ESMF})
DEPENDENCIES MAPL Chem_Shared Chem_Base GOCART_GridComp GOCART2G_GridComp esmf)

install(
FILES GEOS_ChemGridComp.rc ChemEnv_ExtData.rc ChemEnv.rc
Expand Down
7 changes: 3 additions & 4 deletions GMIchem_GridComp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ if (CMAKE_Fortran_COMPILER_ID MATCHES Intel)
endif ()
endif ()
if (CMAKE_BUILD_TYPE MATCHES Release)
set_source_files_properties( GMI_GridComp/GmiChem_GridCompMod.F90
set_source_files_properties( GMI_GridComp/GmiChem_GridCompMod.F90
PROPERTIES COMPILE_FLAGS "-O2 ${common_Fortran_flags} ${GEOS_Fortran_Release_FPE_Flags} ${ALIGNCOM}")
set_source_files_properties( GMI_GridComp/GmiChem_GridCompClassMod.F90
PROPERTIES COMPILE_FLAGS "-O1 ${common_Fortran_flags} ${GEOS_Fortran_Release_FPE_Flags} ${ALIGNCOM}")
endif ()



esma_add_library (${this} SRCS ${srcs} DEPENDENCIES Chem_Shared GEOS_Shared)
esma_add_library (${this} SRCS ${srcs} DEPENDENCIES Chem_Shared GEOS_Shared esmf)

target_include_directories (${this}
PUBLIC
Expand All @@ -83,7 +83,6 @@ target_include_directories (${this}
)

target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/GMI_GridComp>)
target_include_directories (${this} PUBLIC ${INC_ESMF})



Expand Down Expand Up @@ -142,7 +141,7 @@ add_dependencies (${this} phony_gmi)
# OUTPUT something
# COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gmi_acg.pl -v
# MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/gmi_acg.pl
# DEPENDS
# DEPENDS
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
# COMMENT "2nd stage generation of automatic code in GMI"
# )
Expand Down
5 changes: 2 additions & 3 deletions MATRIXchem_GridComp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ set (srcs
MATRIXchem_GridCompMod.F90
)

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES Chem_Shared MAPL)
target_include_directories (${this} PUBLIC ${INC_ESMF}) # ${esma_include}/MAPL_Base)
esma_add_library (${this} SRCS ${srcs} DEPENDENCIES Chem_Shared MAPL esmf)
if (EXTENDED_SOURCE)
set_target_properties (${this} PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE})
endif ()
Expand All @@ -36,4 +35,4 @@ file (GLOB resource_files CONFIGURE_DEPENDS "*.rc")
install(
FILES ${resource_files}
DESTINATION etc
)
)
7 changes: 3 additions & 4 deletions TR_GridComp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ set (srcs
TR_GridCompMod.F90
)

esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES MAPL GMAO_mpeu Chem_Shared GEOS_Shared
INCLUDES ${INC_ESMF})
esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES MAPL GMAO_mpeu Chem_Shared GEOS_Shared esmf)

#esma_generate_gocart_code (${this} -F)

Expand Down

0 comments on commit 77e3bcb

Please sign in to comment.