From 1b788c9b79e76b1c7605bd7c77ebbc65a704adb0 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 27 Aug 2020 06:17:59 -0600 Subject: [PATCH] more fixing for flib and clib, now fixing _PNETCDF --- CMakeLists.txt | 7 +++++++ cmake_config.h.in | 3 ++- src/clib/CMakeLists.txt | 4 ++-- src/flib/CMakeLists.txt | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7227f87edc6..11cdcf8a540 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,11 @@ else() find_package (PnetCDF COMPONENTS C) endif() +# Did we find pnetCDF? If so, set _PNETCDF in config.h. +if (PnetCDF_C_FOUND) + set(_PNETCDF 1) +endif () + #============================================================================== # INCLUDE SOURCE DIRECTORIES #============================================================================== @@ -311,6 +316,8 @@ CHECK_C_SOURCE_COMPILES(" choke me #endif int main() {return 0;}" HAVE_NETCDF_PAR) + +# Set this synonym for HAVE_NETCDF_PAR. It is defined in config.h. if (HAVE_NETCDF_PAR) set(_NETCDF4 1) endif () diff --git a/cmake_config.h.in b/cmake_config.h.in index 399e1fe81d6..7561db067df 100644 --- a/cmake_config.h.in +++ b/cmake_config.h.in @@ -36,7 +36,8 @@ /* Does netCDF support parallel I/O for netCDF/HDF5 files? */ #cmakedefine HAVE_NETCDF_PAR -/* Does PIO support netCDF/HDF5 files? */ +/* Does PIO support netCDF/HDF5 files? (Will be same as + * HAVE_NETCDF_PAR). */ #cmakedefine _NETCDF4 /* Does netCDF and HDF5 support parallel I/O filters? */ diff --git a/src/clib/CMakeLists.txt b/src/clib/CMakeLists.txt index d8dc3f63a00..35b4d8c5bb4 100644 --- a/src/clib/CMakeLists.txt +++ b/src/clib/CMakeLists.txt @@ -118,8 +118,8 @@ endif () if (PnetCDF_C_FOUND) target_include_directories (pioc PUBLIC ${PnetCDF_C_INCLUDE_DIRS}) - target_compile_definitions (pioc - PUBLIC _PNETCDF) + # target_compile_definitions (pioc + # PUBLIC _PNETCDF) target_link_libraries (pioc PUBLIC ${PnetCDF_C_LIBRARIES}) diff --git a/src/flib/CMakeLists.txt b/src/flib/CMakeLists.txt index d2b535abda4..0c7333aea19 100644 --- a/src/flib/CMakeLists.txt +++ b/src/flib/CMakeLists.txt @@ -233,8 +233,8 @@ endif () if (PnetCDF_Fortran_FOUND) target_include_directories (piof PUBLIC ${PnetCDF_Fortran_INCLUDE_DIRS}) - target_compile_definitions (piof - PUBLIC _PNETCDF) + # target_compile_definitions (piof + # PUBLIC _PNETCDF) target_link_libraries (piof PUBLIC ${PnetCDF_Fortran_LIBRARIES})