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

Include version check for NetCDF Fortran library #607

Open
dqwu opened this issue Aug 6, 2024 · 1 comment
Open

Include version check for NetCDF Fortran library #607

dqwu opened this issue Aug 6, 2024 · 1 comment
Assignees
Labels

Comments

@dqwu
Copy link
Contributor

dqwu commented Aug 6, 2024

This requirement has been discussed in E3SM-Project/E3SM#6525.

NetCDF Fortran 4.5.0 or higher is required to support the CDF-5
format and its additional external data types: NC_UBYTE, NC_USHORT,
NC_UINT, NC_INT64, and NC_UINT64.

We should also ensure that the following CMake check works:

#===== NetCDF-Fortran =====
if (WITH_NETCDF)
  find_package (NetCDF ${NETCDF_FORTRAN_MIN_VER_REQD} COMPONENTS Fortran)
  if (NetCDF_Fortran_FOUND)
    message(STATUS "NetCDF Fortran library dependencies: ${NetCDF_Fortran_LIBRARIES}")
...

I set NETCDF_FORTRAN_MIN_VER_REQD to 4.8.0 for testing (4.6.0 is
installed). The CMake configuration did not fail as expected:

-- Found NetCDF:  (Required is at least version "4.8.0") found components: Fortran 
-- NetCDF Fortran library dependencies: /home/wuda/3rdparty/netcdf/lib/libnetcdff.so
@dqwu
Copy link
Contributor Author

dqwu commented Aug 6, 2024

@jayeshkrishna
NetCDF-C and PnetCDF have a similar issue. The CMake configuration does not fail as expected.
NetCDF-C

-- Could NOT find NetCDF: Found unsuitable version "4.8.0./*!<", but required is at least "4.9.0" (found /home/wuda/3rdparty/netcdf/lib/libnetcdf.so)
-- Found NetCDF:  (Required is at least version "4.9.0") found components: C 

PnetCDF

-- Could NOT find PnetCDF: Found unsuitable version "1.12.3", but required is at least "1.13.0" (found /home/wuda/3rdparty/pnetcdf/lib/libpnetcdf.a)
-- Found PnetCDF:  (Required is at least version "1.13.0") found components: C 

Maybe we should make CMake configuration abort for all possible failed XXXX_MIN_VER_REQD checks:

# Min versions of libraries required
set (MPE_MIN_VER_REQD "2.4.8")
set (NETCDF_C_MIN_VER_REQD "4.4.0")
set (NETCDF_FORTRAN_MIN_VER_REQD "4.5.0")
set (PNETCDF_MIN_VER_REQD "1.8.1")
set (ADIOS_MIN_VER_REQD "2.9.0")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants