-
Notifications
You must be signed in to change notification settings - Fork 2
Description
When following the installation procedure during the ../configure step I received the error
configure: error: No NETCDF_C_DIR environment variable.
Checking the configure script, this environment variable is used to set the default location for the netcdf C library and another similar variable is used to set the default location for the netcdf fortran library.
Neither are set. I was able to work around the configure error for the C directory by adding
--with-netcdf-c=`nc-config --libs | cut -d " " -f 1 | cut -c3-`
to my configure command. Perhaps there is a better way?
This then resulted in a similar error, but for the NETCDF_FORTRAN_DIR environment variable.
It turns out that netcdf fortran was not installed as part of the requirements. It used to be that the fortran and C libraries were packaged together, but that is no longer the case (see https://docs.unidata.ucar.edu/netcdf-c/current/building_netcdf_fortran.html). I installed the fortran package with
conda install netcdf-fortran
The equivalent configure argument to get the netcdf-fortran is
--with-netcdf-fortran=`nf-config --flibs | cut -d " " -f 1 | cut -c3-`
however this gave me the following error when running the configure script
checking for function nf90_open... no
checking for function nf90_open in -lnetcdff... no
checking whether we can compile a NetCDF Fortran program... no
calling
readelf -s /path/to/conda/env/lib/libnetcdff.so | grep open
showed that there was no function with the nf90_ prefix, only nf_ prefix, which is the fortran 77 function
The link above indicates that the package can be built with or without f90 support, so perhaps this version is built without. Maybe I need to build fortran netcdf myself or maybe there is some other package