Closed dmey closed 5 years ago
For reference VTK has updated their FindNetCDF.cmake
script but also removed the Fortran interface -- see https://github.com/Kitware/VTK/blob/master/CMake/FindNetCDF.cmake
Looks like our FindNetCDF script would support this case using -DNETCDF_F77_ROOT=/external/netcdf/4.4.4-fortran -DNETCDF_F90_ROOT=/external/netcdf/4.4.4-fortran
. Can you try that?
That seems to have, partially, worked -- see below. The PATH to the include dirs is correct however it picks up the libraries from a different path. I checked and external
appears before anything else in the PATH.
NETCDF_F90_INCLUDE_DIR:PATH=/external/netcdf/4.4.4-fortran/include
NETCDF_F90_LIBRARY:FILEPATH=/lib64/libnetcdff.so
NETCDF_INCLUDE_DIR:PATH=/external/netcdf/4.4.1-c/include
NETCDF_LIBRARY:FILEPATH=/lib64/libnetcdf.so
Ideally though, the PATH to netcdff should really be found from the config as per nc-config... The new script in VTK seems to always work in the systems tested without the need of specifying the PATH to anything so if we can easily get the information from nc-config after if find netcdf-c that may be a less brittle alternative than currently done...
I pushed a fix, you can use -DNETCDF_DIR=... -DNETCDF_FORTRAN_DIR=..
to specify the folders separately. Needs some documentation.
@letmaik docs updated in 8c6386d. Feel free to merge in directly if OK, else please comment and will make changes.
In Linux, when using Environment Modules, CMake cannot find the NetCDF Fortran interface when NetCDF-Fortran has been installed under a different path to NetCDF-C.
For example, with the following configuration:
The configuration fails with the following error: