Could NOT find NetCDF_Fortran

ntandon

Neil Tandon
Member
I am attempting to build a case, and I'm getting the error below when building pio. I don't understand why I'm getting this error, because I have declared NetCDF_Fortran, NetCDF_Fortran_LIBRARY and NetCDF_Fortran_INCLUDE_DIR in config_machines.xml. Any ideas? I have attached my config files as well as the full pio.bldlog.

-- Could NOT find NetCDF_Fortran (missing: NetCDF_Fortran_LIBRARY NetCDF_Fortran
_INCLUDE_DIR)
 

Attachments

jedwards

CSEG and Liaisons
Staff member
Since the netcdf fortran and c libraries on your system are located in the same directory you should only need to specify
NETCDF_PATH
check the directory $NETCDF_PATH/lib and make sure that it contains libnetcdff.a and/or libnetcdff.so (note the 2 f's in the name)
 

ntandon

Neil Tandon
Member
Right, which is why I added module load netcdf-fortran-mpi and the NetCDF_Fortran, NetCDF_Fortran_LIBRARY, NetCDF_Fortran_INCLUDE_DIR environment variables to my config_machines.xml. Is that not sufficient? Should I be loading both netcdf-fortran-mpi and netcdf-mpi or just netcdf-fortran-mpi?
 

jedwards

CSEG and Liaisons
Staff member
Oh sorry - I misread your config_machines.xml file - the variable NetCDF_Fortran_LIBRARY should point to the library file to use and not just the directory.
 

ntandon

Neil Tandon
Member
Ok, I replaced that line with the following...

<env name="NetCDF_Fortran_LIBRARY">/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/MPI/intel2018.3/impi2018.3/netcdf-fortran-mpi/4.4.4/lib/libnetcdff.so</env>

...but I am still getting the same error.

-- Could NOT find NetCDF_Fortran (missing: NetCDF_Fortran_LIBRARY NetCDF_Fortran
_INCLUDE_DIR)
 

jedwards

CSEG and Liaisons
Staff member
Try NETCDF_FORTRAN_PATH=/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/MPI/intel2018.3/impi2018.3/netcdf-fortran-mpi/4.4.4
 

ntandon

Neil Tandon
Member
That worked! I also had to set NETCDF_C_PATH=/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/MPI/intel2018.3/impi2018.3/netcdf-mpi/4.4.1.1
 
Back
Top