[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #JAF-118152]: error in the path of netcdf in compiling



Hi Sara,

> I try to find the path where my netcdf is installed but I can't find it.

The default location for netCDF installation is /usr/local/lib for the
libraries. /usr/local/bin for the utility programs, /usr/local/include
for the header files, and /usr/local/share for the doumentation.

> my linux fedora 14 is installed on a VMplayer on windows 8.
> and I downloaded netcdf 4.1.1.
> 
> find netcdf
> No such file or directory
> which netcdf
> /usr/no netcdf in 
> (/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/fedora/bin)
> 
> locte netcdf
> bash: locte: command not found...
> 
> whereis netcdf
> netcdf:
> 
> 

It doesn't install a directory or file named "netcdf". Instead a number
of files are installed for libraries, utility programs, header files,
etc.  For example:

/usr/local:
  total used in directory 24 available 125909712
  drwxr-xr-x 98 russ ustaff 4096 Feb 26 10:56 ../
  drwxr-xr-x  2 russ ustaff 4096 Nov 29  2010 bin/
  drwxr-xr-x  2 russ ustaff 4096 Nov 29  2010 include/
  drwxr-xr-x  3 russ ustaff 4096 Nov 29  2010 lib/
  drwxr-xr-x  5 russ ustaff 4096 Jul 13  2010 share/
  drwxr-xr-x  6 russ ustaff 4096 Jul 13  2010 ./

/usr/local/lib:
  total used in directory 6928 available 125909712
  drwxr-xr-x 2 russ ustaff    4096 Nov 29  2010 pkgconfig/
  drwxr-xr-x 3 russ ustaff    4096 Nov 29  2010 ./
  -rw-r--r-- 1 root root   1110144 Nov 29  2010 libnetcdf_c++.a
  -rwxr-xr-x 1 root root      1129 Nov 29  2010 libnetcdf_c++.la*
  -rw-r--r-- 1 root root   5957490 Nov 29  2010 libnetcdf.a
  -rwxr-xr-x 1 root root      1075 Nov 29  2010 libnetcdf.la*
  drwxr-xr-x 6 russ ustaff    4096 Jul 13  2010 ../

/usr/local/bin:
  total used in directory 11304 available 125909712
  drwxr-xr-x 2 russ ustaff    4096 Nov 29  2010 ./
  -rwxr-xr-x 1 root root      4138 Nov 29  2010 nc-config*
  -rwxr-xr-x 1 root root   2706061 Nov 29  2010 nccopy*
  -rwxr-xr-x 1 root root   2867271 Nov 29  2010 ncdump*
  -rwxr-xr-x 1 root root   3191470 Nov 29  2010 ncgen*
  -rwxr-xr-x 1 root root   2783769 Nov 29  2010 ncgen3*
  drwxr-xr-x 6 russ ustaff    4096 Jul 13  2010 ../

/usr/local/include:
  total used in directory 468 available 125909712
  drwxr-xr-x 2 russ ustaff   4096 Nov 29  2010 ./
  -rw-r--r-- 1 root root    10123 Nov 29  2010 ncvalues.h
  -rw-r--r-- 1 root root       23 Nov 29  2010 netcdf.hh
  -rw-r--r-- 1 root root    18918 Nov 29  2010 netcdfcpp.h
  -rw-r--r-- 1 root root    56774 Nov 29  2010 netcdf.h
  -rw-r--r-- 1 root root    59387 Nov 29  2010 netcdf.inc
  -rw-r--r-- 1 root root   308224 Nov 29  2010 netcdf.mod
  -rw-r--r-- 1 root root     2408 Nov 29  2010 typesizes.mod
  drwxr-xr-x 6 russ ustaff   4096 Jul 13  2010 ../

> but when I type:
> which ncdump
> /usr/bin/ncdump

That indicates the installation prefix for you is /usr instead 
of /usr/local.

> I need to enter the correct path in gfortran part to compile a testcase and I 
> think as the path is not correct, this error comes up:
> 
> make linux-gfort
> make coherens "FC=gfortran" "FCOPTS= -O3" "FCDEFS=" "FCDEBUG=" \
> "CPP=" "CPPF=cpp" "CPPOPTS=-traditional-cpp" "CPPDEFS=-DALLOC -DCDF"
> make[1]: Entering directory `/home/fedora/models/work'
> gfortran -I/usr/local/bin/include -O3 -c cf90_routines.f90 -o cf90_routines.o
> COHERENS/code/source/cf90_routines.F90:37.13:
> 
> USE netcdf
> 1
> Fatal Error: Can't open module file 'netcdf.mod' for reading at (1): No such 
> file or directory
> make[1]: *** [cf90_routines.o] Error 1
> make[1]: Leaving directory `/home/fedora/models/work'
> make: *** [linux-gfort] Error 2
> 
> could you please let me know what causes this error?and how to fix it?

Instead of "-I/usr/local/bin/include", use "-I/usr/include" in the
above gfortran command line, and similarly for other cases.

You might also try the "nf-config" command that is supposed to
make this simpler:

  gfortran cf90_routines.f90 -o cf90 `nf-config --fflags --flibs`

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: JAF-118152
Department: Support netCDF
Priority: Normal
Status: Closed