first of all I've read this topic but I can't compile my code. Compiling Fortran netCDF programs on Ubuntu
I am on UBUNTU 14.04 and compiling a fortran program that uses NetCDF. I have compilation error like this:
terrain.f:(.text+0x17efd): undefined reference to 'ncopn_'
terrain.f:(.text+0x18111): undefined reference to 'ncopn_'
terrain.f:(.text+0x187cc): undefined reference to 'ncclos_'
terrain.f:(.text+0x187ea): undefined reference to 'ncclos_'
Definitely it says I have not netcdf fortran librarries. But I installed zlib, HDF5, netcdf C and netcdf Fortran according these web pages with disable shared and disable dap options.
http://www.unidata.ucar.edu/software/netcdf/docs/build_default.html http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-install.html
this is result of nc-config --libs command:
-L/usr/local/lib -L/usr/local -lnetcdf -lhdf5_hl -lhdf5 -ldl -lm -lz
this is result of nf-config --flibs command:
-L/usr/local/lib -lnetcdff -L/usr/local/lib -lnetcdf -lnetcdf -lhdf5_hl -lhdf5 -lz
i build my project with this command:
gfortran terrain.f -I/usr/local/include -L/usr/local/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz -lm -ldl
what's wrong with this?
Edit: I use --disable-netcdf-4 option in configuring netcdf C and netcdf fortran and I can compile my code. So it's a problem with HDF5.