Skip to content

Commit

Permalink
Merge branch 'develop' into release/MAPL-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Oct 17, 2024
2 parents 3f86072 + 0d6ce1a commit 3f16559
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Update ESMF version for Baselibs to match that of Spack for consistency

### Fixed

- Fixed issue of some Baselibs builds appearing to support zstandard. This is not possible due to Baselibs building HDF5 and netCDF as static libraries

### Removed

### Deprecated
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ else ()
# This is an ESMF version test when using Baselibs which doesn't use the
# same find_package internally in ESMA_cmake as used above (with a version
# number) so this lets us at least trap use of old Baselibs here.
if (ESMF_VERSION VERSION_LESS 8.6.0)
message(FATAL_ERROR "ESMF must be at least 8.6.0")
if (ESMF_VERSION VERSION_LESS 8.6.1)
message(FATAL_ERROR "ESMF must be at least 8.6.1")
endif ()
endif ()

Expand Down
54 changes: 32 additions & 22 deletions pfio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,26 @@ set (srcs
StringVectorUtil.F90
)

if (BUILD_WITH_PFLOGGER)
find_package (PFLOGGER REQUIRED)
endif ()

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.profiler NetCDF::NetCDF_Fortran NetCDF::NetCDF_C TYPE SHARED)

target_link_libraries (${this} PUBLIC GFTL::gftl-v2 GFTL_SHARED::gftl-shared-v2 GFTL_SHARED::gftl-shared PFLOGGER::pflogger PRIVATE MPI::MPI_Fortran OpenMP::OpenMP_Fortran)
target_include_directories (${this} PUBLIC
$<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)

set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})
# Kludge for OSX security and DYLD_LIBRARY_PATH ...
foreach(dir ${OSX_EXTRA_LIBRARY_PATH})
target_link_libraries(${this} PRIVATE "-Xlinker -rpath -Xlinker ${dir}")
endforeach()

if (SUPPORT_FOR_MPI_ALLOC_MEM_CPTR)
target_compile_definitions(${this} PRIVATE SUPPORT_FOR_MPI_ALLOC_MEM_CPTR)
endif ()

###############################################################
# Check to see if quantize capability is present in netcdf-c. #
###############################################################
Expand All @@ -109,7 +129,7 @@ check_c_source_compiles("
NETCDF_HAS_QUANTIZE)
if (NETCDF_HAS_QUANTIZE)
message(STATUS "netCDF has quantize capability")
add_definitions(-DNF_HAS_QUANTIZE)
target_compile_definitions(${this} PRIVATE NF_HAS_QUANTIZE)
else ()
message(STATUS "netCDF does not have quantize capability")
endif ()
Expand All @@ -128,33 +148,23 @@ check_c_source_compiles("
}
"
NETCDF_HAS_ZSTD)

# NOTE: Even if the check above succeeds, zstandard is *not*
# possible with Baselibs (builds HDF5, netCDF as static)
# so we want to check for Baselibs first.

if (Baselibs_FOUND)
message(STATUS "Baselibs found, zstandard capability not possible")
set(NETCDF_HAS_ZSTD FALSE CACHE BOOL "netCDF has zstandard capability" FORCE)
endif ()

if (NETCDF_HAS_ZSTD)
message(STATUS "netCDF has zstandard capability")
add_definitions(-DNF_HAS_ZSTD)
target_compile_definitions(${this} PRIVATE NF_HAS_ZSTD)
else ()
message(STATUS "netCDF does not have zstandard capability")
endif ()

if (BUILD_WITH_PFLOGGER)
find_package (PFLOGGER REQUIRED)
endif ()

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.profiler NetCDF::NetCDF_Fortran NetCDF::NetCDF_C TYPE SHARED)

target_link_libraries (${this} PUBLIC GFTL::gftl-v2 GFTL_SHARED::gftl-shared-v2 GFTL_SHARED::gftl-shared PFLOGGER::pflogger PRIVATE MPI::MPI_Fortran OpenMP::OpenMP_Fortran)
target_include_directories (${this} PUBLIC
$<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)

set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})
# Kludge for OSX security and DYLD_LIBRARY_PATH ...
foreach(dir ${OSX_EXTRA_LIBRARY_PATH})
target_link_libraries(${this} PRIVATE "-Xlinker -rpath -Xlinker ${dir}")
endforeach()

if (SUPPORT_FOR_MPI_ALLOC_MEM_CPTR)
target_compile_definitions(${this} PRIVATE SUPPORT_FOR_MPI_ALLOC_MEM_CPTR)
endif ()

ecbuild_add_executable (
TARGET pfio_open_close.x
SOURCES pfio_open_close.F90
Expand Down

0 comments on commit 3f16559

Please sign in to comment.