[R] install Netcdf library (linux)

Massimo Di Stefano distem at rpi.edu
Fri Mar 8 00:43:45 CET 2013


Hi All,

i'm on a debian linux 64bit,
i'm tying to install the netcdf intraface, i tried both ncdf and ncdf4

but  trying to build i received the error :

(i have necdf installed on my machine and it is able to fiund it .. no missed .h)

epy at epinux:~$ sudo R CMD INSTALL --configure-args="-with-netcdf_incdir=/usr/include -with-netcdf_libdir=/usr/lib" ncdf4_1.8.tar.gz 
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘ncdf4’ ...
checking for nc-config... yes
Using nc-config: nc-config
Output of nc-config --all:

This netCDF 4.2.1.1 has been built with the following features: 

  --cc        -> gcc
  --cflags    ->  -I/usr/local/include -I/usr/local/include
  --libs      -> -L/usr/local/lib -lnetcdf

  --has-c++   -> no
  --cxx       -> 
  --has-c++4  -> no
  --cxx4      -> 

  --fc        -> 
  --fflags    -> 
  --flibs     -> 
  --has-f90   -> no

  --has-dap   -> yes
  --has-nc2   -> yes
  --has-nc4   -> yes
  --has-hdf5  -> yes
  --has-hdf4  -> no
  --has-pnetcdf-> no
  --has-szlib -> 

  --prefix    -> /usr/local
  --includedir-> /usr/local/include
  --version   -> netCDF 4.2.1.1

---
netcdf.m4: about to set rpath, here is source string: >-L/usr/local/lib -lnetcdf<
netcdf.m4: final rpath:   -Wl,-rpath,/usr/local/lib
Netcdf library version: netCDF 4.2.1.1
Netcdf library has version 4 interface present: yes
Netcdf library was compiled with C compiler: gcc
configure: creating ./config.status
config.status: creating R/load.R
config.status: creating src/Makevars
 
**********************  Results of ncdf4 package configure *******************
 
netCDF v4 CPP flags 	= -I/usr/local/include -I/usr/local/include
netCDF v4 LD flags  	=   -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lnetcdf
netCDF v4 runtime path 	=   -Wl,-rpath,/usr/local/lib
 
******************************************************************************

** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/local/include -I/usr/local/include     -fpic  -O2 -pipe -g  -c ncdf.c -o ncdf.o
ncdf.c: In function ‘R_nc4_nctype_to_Rtypecode’:
ncdf.c:40:18: error: ‘NC_INT’ undeclared (first use in this function)
ncdf.c:40:18: note: each undeclared identifier is reported only once for each function it appears in
ncdf.c:49:18: error: ‘NC_UBYTE’ undeclared (first use in this function)
ncdf.c:51:18: error: ‘NC_USHORT’ undeclared (first use in this function)
ncdf.c:53:18: error: ‘NC_UINT’ undeclared (first use in this function)
ncdf.c:55:18: error: ‘NC_INT64’ undeclared (first use in this function)
ncdf.c:57:18: error: ‘NC_UINT64’ undeclared (first use in this function)
ncdf.c: In function ‘R_nc4_varsize’:
ncdf.c:69:28: error: ‘NC_MAX_DIMS’ undeclared (first use in this function)
ncdf.c:75:2: warning: implicit declaration of function ‘nc_inq_varndims’ [-Wimplicit-function-declaration]
ncdf.c:78:4: warning: implicit declaration of function ‘nc_strerror’ [-Wimplicit-function-declaration]
ncdf.c:84:2: warning: implicit declaration of function ‘nc_inq_vardimid’ [-Wimplicit-function-declaration]
ncdf.c:94:3: warning: implicit declaration of function ‘nc_inq_dimlen’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_varunlim’:
ncdf.c:112:2: warning: implicit declaration of function ‘nc_inq_unlimdim’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_var’:
ncdf.c:152:2: warning: implicit declaration of function ‘nc_inq_var’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_vartype’:
ncdf.c:168:2: warning: implicit declaration of function ‘nc_inq_vartype’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_varname’:
ncdf.c:181:2: warning: implicit declaration of function ‘nc_inq_varname’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_get_vara_double’:
ncdf.c:214:2: warning: implicit declaration of function ‘nc_get_vara_double’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_get_vara_int’:
ncdf.c:257:2: warning: implicit declaration of function ‘nc_get_vara_int’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_get_vara_text’:
ncdf.c:313:2: warning: implicit declaration of function ‘nc_get_vara_text’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_dimid’:
ncdf.c:345:2: warning: implicit declaration of function ‘nc_inq_dimid’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_varid’:
ncdf.c:355:2: warning: implicit declaration of function ‘nc_inq_varid’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_dimids’:
ncdf.c:377:9: warning: implicit declaration of function ‘nc_inq_dimids’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_dim’:
ncdf.c:387:12: error: ‘NC_MAX_NAME’ undeclared (first use in this function)
ncdf.c:391:2: warning: implicit declaration of function ‘nc_inq_dim’ [-Wimplicit-function-declaration]
ncdf.c:408:2: warning: implicit declaration of function ‘nc_inq_unlimdims’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq’:
ncdf.c:451:2: warning: implicit declaration of function ‘nc_inq’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_open’:
ncdf.c:475:2: warning: implicit declaration of function ‘nc_open’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_create’:
ncdf.c:499:15: error: ‘NC_SHARE’ undeclared (first use in this function)
ncdf.c:501:15: error: ‘NC_64BIT_OFFSET’ undeclared (first use in this function)
ncdf.c:503:15: error: ‘NC_NETCDF4’ undeclared (first use in this function)
ncdf.c:505:2: warning: implicit declaration of function ‘nc_create’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_ttc_to_nctype’:
ncdf.c:518:11: error: ‘NC_INT’ undeclared (first use in this function)
ncdf.c: In function ‘R_nc4_put_att_logical’:
ncdf.c:554:4: warning: implicit declaration of function ‘nc_put_att_float’ [-Wimplicit-function-declaration]
ncdf.c:564:4: warning: implicit declaration of function ‘nc_put_att_double’ [-Wimplicit-function-declaration]
ncdf.c:579:3: warning: implicit declaration of function ‘nc_put_att_int’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_put_att_text’:
ncdf.c:633:2: warning: implicit declaration of function ‘nc_put_att_text’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_get_att_int’:
ncdf.c:645:2: warning: implicit declaration of function ‘nc_get_att_int’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_get_att_double’:
ncdf.c:653:2: warning: implicit declaration of function ‘nc_get_att_double’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_att’:
ncdf.c:669:2: warning: implicit declaration of function ‘nc_inq_att’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_get_att_text’:
ncdf.c:698:2: warning: implicit declaration of function ‘nc_get_att_text’ [-Wimplicit-function-declaration]
ncdf.c:705:2: warning: implicit declaration of function ‘nc_inq_attlen’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_put_vara_double’:
ncdf.c:753:2: warning: implicit declaration of function ‘nc_put_vara_double’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_put_vara_int’:
ncdf.c:780:2: warning: implicit declaration of function ‘nc_put_vara_int’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_put_var_int’:
ncdf.c:789:2: warning: implicit declaration of function ‘nc_put_var_int’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_put_var_double’:
ncdf.c:798:2: warning: implicit declaration of function ‘nc_put_var_double’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_put_vara_text’:
ncdf.c:835:3: warning: implicit declaration of function ‘nc_put_vara_text’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_def_var_byte’:
ncdf.c:947:2: warning: implicit declaration of function ‘nc_def_var’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_def_var_int’:
ncdf.c:964:3: error: ‘NC_INT’ undeclared (first use in this function)
ncdf.c: In function ‘R_nc4_def_dim’:
ncdf.c:1043:2: warning: implicit declaration of function ‘nc_def_dim’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_redef’:
ncdf.c:1054:2: warning: implicit declaration of function ‘nc_redef’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_rename_var’:
ncdf.c:1063:2: warning: implicit declaration of function ‘nc_rename_var’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_attname’:
ncdf.c:1072:2: warning: implicit declaration of function ‘nc_inq_attname’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_def_var_chunking’:
ncdf.c:1102:16: error: ‘NC_CONTIGUOUS’ undeclared (first use in this function)
ncdf.c:1104:16: error: ‘NC_CHUNKED’ undeclared (first use in this function)
ncdf.c:1116:2: warning: implicit declaration of function ‘nc_def_var_chunking’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_var_chunking’:
ncdf.c:1139:2: warning: implicit declaration of function ‘nc_inq_var_chunking’ [-Wimplicit-function-declaration]
ncdf.c:1145:20: error: ‘NC_CONTIGUOUS’ undeclared (first use in this function)
ncdf.c:1147:25: error: ‘NC_CHUNKED’ undeclared (first use in this function)
ncdf.c: In function ‘R_nc4_inq_var_deflate’:
ncdf.c:1173:2: warning: implicit declaration of function ‘nc_inq_var_deflate’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_def_var_deflate’:
ncdf.c:1212:2: warning: implicit declaration of function ‘nc_def_var_deflate’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_ngroups’:
ncdf.c:1227:2: warning: implicit declaration of function ‘nc_inq_grps’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_grpname’:
ncdf.c:1307:2: warning: implicit declaration of function ‘nc_inq_grpname_len’ [-Wimplicit-function-declaration]
ncdf.c:1317:2: warning: implicit declaration of function ‘nc_inq_grpname’ [-Wimplicit-function-declaration]
ncdf.c: In function ‘R_nc4_inq_format’:
ncdf.c:1364:2: warning: implicit declaration of function ‘nc_inq_format’ [-Wimplicit-function-declaration]
ncdf.c:1374:8: error: ‘NC_FORMAT_CLASSIC’ undeclared (first use in this function)
ncdf.c:1378:8: error: ‘NC_FORMAT_64BIT’ undeclared (first use in this function)
ncdf.c:1382:8: error: ‘NC_FORMAT_NETCDF4’ undeclared (first use in this function)
ncdf.c:1386:8: error: ‘NC_FORMAT_NETCDF4_CLASSIC’ undeclared (first use in this function)
make: *** [ncdf.o] Error 1
ERROR: compilation failed for package ‘ncdf4’
* removing ‘/usr/local/lib/R/site-library/ncdf4’



Thanks for any help!

Massimo.


More information about the R-help mailing list