Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure check for NC4 chunking consts #536

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

jayeshkrishna
Copy link
Contributor

Adding a configure check (and appropriate warning messages) for NetCDF4
chunking constants.

Fixes #523

Not all versions of NetCDF library with NetCDF4 support define
the NetCDF4 chunking constants. So adding a configure check (and
appropriate warning messages) for these constants.
@jayeshkrishna jayeshkrishna added Next Release Enhancements slated for the upcoming (next) release bugfix labels Sep 7, 2023
@jayeshkrishna jayeshkrishna requested a review from dqwu September 7, 2023 17:28
@jayeshkrishna jayeshkrishna self-assigned this Sep 7, 2023
@dqwu
Copy link
Contributor

dqwu commented Sep 7, 2023

@jayeshkrishna
This PR works on Chrysalis, but the following CMake warning message is not found in bld/spio.bldlog.xxxx.gz:
message(WARNING "NetCDF4 is available but NetCDF4 chunking constants are not defined (limits chunking support)")

@jayeshkrishna
Copy link
Contributor Author

Are you suppressing warnings by any chance (-Wno-dev or something similar)?

@dqwu
Copy link
Contributor

dqwu commented Sep 8, 2023

Are you suppressing warnings by any chance (-Wno-dev or something similar)?

-Wno-dev is added by CIME in Tools/Makefile:

CMAKE_OPTS += -Wno-dev -D CMAKE_Fortran_FLAGS:STRING="$(FFLAGS) $(EXTRA_PIO_FPPDEFS) $(INCLDIR)" \
	      -D CMAKE_C_FLAGS:STRING="$(CFLAGS) $(EXTRA_PIO_CPPDEFS) $(INCLDIR)" \
	      -D CMAKE_CXX_FLAGS:STRING="$(CXXFLAGS) $(EXTRA_PIO_CPPDEFS) $(INCLDIR)" \
	      -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
	      -D GPTL_PATH:STRING=$(INSTALL_SHAREDPATH) \
	      -D PIO_ENABLE_TESTS:BOOL=OFF \
	      -D PIO_USE_MALLOC:BOOL=ON \
	      -D USER_CMAKE_MODULE_PATH:LIST="$(CIMEROOT)/CIME/non_py/src/CMake;$(EXTERN_PATH)/parallelio/cmake"

@dqwu
Copy link
Contributor

dqwu commented Sep 8, 2023

@jayeshkrishna

Even without the "-Wno-dev" flag, the CMake configuration output is different on GCE and Chrysalis.

GCE:

-- Found NetCDF_Fortran: /nfs/gce/projects/climate/software/linux-ubuntu20.04-x86_64/netcdf/4.8.0c-4.3.1cxx-4.5.3f-parallel/mpich-4.0/gcc-11.1.0/lib/libnetcdff.a  
...
-- NetCDF Fortran library dependencies: ****
-- Checking Whether the NetCDF4 chunking constants are available
-- Checking Whether the NetCDF4 chunking constants are available - yes
-- Disabling support for PnetCDF

Chrysalis

-- Found NetCDF_Fortran: /gpfs/fs1/soft/chrysalis/spack/opt/spack/linux-centos8-x86_64/intel-20.0.4/netcdf-fortran-4.4.4-tplolxh/lib/libnetcdff.so  
-- NetCDF Fortran library dependencies: ****
-- Disabling support for PnetCDF

That is, the expected messages "Checking Whether the NetCDF4 chunking constants ..." are not shown on Chrysalis.

@jayeshkrishna
Copy link
Contributor Author

jayeshkrishna commented Sep 11, 2023

The current configure checks only enable NetCDF4 if NetCDF4 parallel I/O is available. Since chrysalis does not support parallel I/O for NetCDF (netcdf_par.h is missing in the Fortran include dir) the chunking const check is not run too. This check (for checking NetCDF parallel I/O support) needs to be fixed in future.
So the difference in behavior between the machines is not due to changes in this PR.

Copy link
Contributor

@dqwu dqwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does not need to change for now.

jayeshkrishna added a commit that referenced this pull request Sep 11, 2023
…536)

Adding a configure check (and appropriate warning messages) for NetCDF4
chunking constants.

Fixes #523

* jayeshkrishna/cmake_check_nc4_consts:
  Configure check for NC4 chunking consts
@jayeshkrishna jayeshkrishna merged commit 8f86efb into master Sep 12, 2023
@dqwu dqwu deleted the jayeshkrishna/cmake_check_nc4_consts branch September 12, 2023 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Next Release Enhancements slated for the upcoming (next) release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NF_COMPACT not defined by netcdf-fortran 4.4.5 on Summit
2 participants