gher-uliege / DIVA

DIVA (Data-Interpolating Variational Analysis) is a software tool dedicated to the spatial interpolation of in situ data in oceanography.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing netcdf.inc

Alexander-Barth opened this issue · comments

From a git clone, I run:

cd DIVA3D/src/Fortran
make

which failed with:

gfortran   extract.f -o /home/ulg/gher/abarth/src/DIVA/DIVA3D/src/Fortran/../../bin/extract.a -L/usr/local/lib -lnetcdff -L/usr/local/lib -lnetcdf -lnetcdf -I/usr/local/include
extract.f:285: Error: Can't open included file 'netcdf.inc'
make[1]: *** [/home/ulg/gher/abarth/src/DIVA/DIVA3D/src/Fortran/../../bin/extract.a] Error 1
make[1]: Leaving directory `/home/users/a/b/abarth/src/DIVA/DIVA3D/src/Fortran/Extensions'
make: *** [extensions] Error 2

nf-config is in my path. Can DIVA detect automatically the location of my NetCDF library?
This is the output of nf-config --all

$ nf-config --all

This netCDF-Fortran 4.4.4 has been built with the following features: 

  --cc        -> gcc
  --cflags    ->  -I/home/easybuild/.local/easybuild/software/netCDF-Fortran/4.4.4-foss-2016b/include -I/home/easybuild/.local/easybuild/software/OpenBLAS/0.2.18-GCC-5.4.0-2.26-LAPACK-3.6.1/include -I/home/easybuild/.local/easybuild/software/ScaLAPACK/2.0.2-gompi-2016b-OpenBLAS-0.2.18-LAPACK-3.6.1/include -I/home/easybuild/.local/easybuild/software/FFTW/3.3.4-gompi-2016b/include -I/home/easybuild/.local/easybuild/software/netCDF/4.4.1-foss-2016b/include -DgFortran

  --fc        -> gfortran
  --fflags    -> -I/home/easybuild/.local/easybuild/software/netCDF-Fortran/4.4.4-foss-2016b/include
  --flibs     -> -L/home/easybuild/.local/easybuild/software/netCDF-Fortran/4.4.4-foss-2016b/lib -lnetcdff -L/home/easybuild/.local/easybuild/software/GCCcore/5.4.0/lib64 -L/home/easybuild/.local/easybuild/software/GCCcore/5.4.0/lib -L/home/easybuild/.local/easybuild/software/OpenBLAS/0.2.18-GCC-5.4.0-2.26-LAPACK-3.6.1/lib -L/home/easybuild/.local/easybuild/software/ScaLAPACK/2.0.2-gompi-2016b-OpenBLAS-0.2.18-LAPACK-3.6.1/lib -L/home/easybuild/.local/easybuild/software/FFTW/3.3.4-gompi-2016b/lib -L/home/easybuild/.local/easybuild/software/netCDF/4.4.1-foss-2016b/lib64 -lnetcdf -lnetcdf -lm -lpthread
  --has-f90   -> no
  --has-f03   -> yes

  --has-nc2   -> yes
  --has-nc4   -> yes

  --prefix    -> /home/easybuild/.local/easybuild/software/netCDF-Fortran/4.4.4-foss-2016b
  --includedir-> /home/easybuild/.local/easybuild/software/netCDF-Fortran/4.4.4-foss-2016b/include
  --version   -> netCDF-Fortran 4.4.4

Yes you're right we should catch the ncinc and nclib from nf-config, in fact it is implemented this way in the other compilation script, divacompileall.

I suspect that we won't be able to compile extract.f using the netcdf.inc found by nf-config, because extract.f is a very old piece of code using the netCDF from 1995. I guess this is why we were keeping a file netcdf.inc in the version control system.
On the other hand, this script is not used anymore (as several others), so it might be the right time to do some cleanup.

@Alexander-Barth : I made the changes in Makefile, could you try it?