Skip to content

Commit

Permalink
more fixing for flib and clib, now fixing _PNETCDF
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Aug 27, 2020
1 parent e6960d9 commit 1b788c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
#==============================================================================
Expand Down Expand Up @@ -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 ()
Expand Down
3 changes: 2 additions & 1 deletion cmake_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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? */
Expand Down
4 changes: 2 additions & 2 deletions src/clib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
4 changes: 2 additions & 2 deletions src/flib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down

0 comments on commit 1b788c9

Please sign in to comment.