Unidata / netcdf-fortran

Official GitHub repository for netCDF-Fortran libraries, which depend on the netCDF C library. Install the netCDF C library first.
Other
244 stars 98 forks source link

Clarify message when failing with 'requires v4.7.4' error. #431

Closed WardF closed 9 months ago

WardF commented 9 months ago

There may be an elegant solution, but for now we will just provide instructions alongside the error. When cmake invokes CHECK_LIBRARY_EXISTS() against a static library (such as libnetcdf.a), the dependencies must be specified manually, since there is no way to infer these dependencies with static libraries; this can be handled programmatically in the CMakeLists.txt file, where we check for nc-config and, if present, use the output of nc-config --libs, but for now we will just present this information when encountering this error.

The fix is to set LDFLAGS to the output from nc-config --libs.