[R-SIG-Mac] R CMD INSTALL cannot find netcdf library

jiho jo.irisson at gmail.com
Tue Sep 5 10:42:54 CEST 2006


Hi,

I tried to install RNetCDF binary package but when I try to load it  
after installation, it gives this message

	> library("RNetCDF")
	Error in dyn.load(x, as.logical(local), as.logical(now)) :
		unable to load shared library '/Library/Frameworks/R.framework/ 
Versions/2.3/Resources/library/RNetCDF/libs/ppc/RNetCDF.so':
	dlopen(/Library/Frameworks/R.framework/Versions/2.3/Resources/ 
library/RNetCDF/libs/ppc/RNetCDF.so, 6): Symbol not found: _nc_inq_dimid
	  Referenced from: /Library/Frameworks/R.framework/Versions/2.3/ 
Resources/library/RNetCDF/libs/ppc/RNetCDF.so
	  Expected in: flat namespace
	Error in library("RNetCDF") : .First.lib failed for 'RNetCDF'


So I tried to install it from source, through the interface (i.e.  
with default parameters). It issues the command:

	install.packages(c("RNetCDF"),lib="/Library/Frameworks/Resources/ 
library/",contriburl=contrib.url(getOption 
("repos"),"source"),type='source',dependencies=FALSE)

and the compilation stops because it cannot find netcdf libraries.  
These libraries are installed through fink and hence are in /sw/lib/  
and the headers in /sw/include/:

	jiho at ibook:RNetCDF$ ll /sw/lib/libnetcdf*
	lrwxr-xr-x   1 root  admin       29 Jul 18 14:59 /sw/lib/libnetcdf. 
3.5.0.dylib -> /sw/lib/libnetcdf.3.6.1.dylib
	-rwxr-xr-x   1 root  admin  1152056 Jul 18 14:59 /sw/lib/libnetcdf. 
3.6.1.dylib
	lrwxr-xr-x   1 root  admin       29 Jul 18 14:59 /sw/lib/libnetcdf. 
3.dylib -> /sw/lib/libnetcdf.3.6.1.dylib
	-rwxr-xr-x   1 root  admin   779952 Jul 18 14:59 /sw/lib/libnetcdf.a
	lrwxr-xr-x   1 root  admin       25 Jul 18 14:59 /sw/lib/ 
libnetcdf.dylib -> /sw/lib/libnetcdf.3.dylib
	-rw-r--r--   1 root  admin   131532 Jul 18 14:59 /sw/lib/libnetcdf_c+ 
+.3.6.1.dylib
	lrwxr-xr-x   1 root  admin       33 Jul 18 14:59 /sw/lib/libnetcdf_c+ 
+.3.dylib -> /sw/lib/libnetcdf_c++.3.6.1.dylib
	-rwxr-xr-x   1 root  admin   169032 Jul 18 14:59 /sw/lib/libnetcdf_c+ 
+.a
	lrwxr-xr-x   1 root  admin       29 Jul 18 14:59 /sw/lib/libnetcdf_c+ 
+.dylib -> /sw/lib/libnetcdf_c++.3.dylib

	jiho at ibook:RNetCDF$ ll /sw/include/netcdf*
	-rwxr-xr-x   1 root  admin   31574 Jul 18 14:59 /sw/include/netcdf.h
	-rwxr-xr-x   1 root  admin      23 Jul 18 14:59 /sw/include/netcdf.hh
	-rwxr-xr-x   1 root  admin   49501 Jul 18 14:59 /sw/include/netcdf.inc
	-rwxr-xr-x   1 root  admin  166532 Jul 18 14:59 /sw/include/netcdf.mod
	-rwxr-xr-x   1 root  admin   18793 Jul 18 14:59 /sw/include/netcdfcpp.h

But these are non-standard paths. So I looked at ./configure --help  
which gives me the options to set:

	  --with-netcdf-include=INCLUDE_PATH
	                          the location of netcdf header files
	  --with-netcdf-lib=LIB_PATH
	                          the location of netcdf libraries

Therefore I tried the command:

	install.packages(c("RNetCDF"),lib="/Library/Frameworks/Resources/ 
library/",contriburl=contrib.url(getOption 
("repos"),"source"),type='source',dependencies=FALSE,configure.args="--w 
ith-netcdf-include=/sw/include/ --with-netcdf-lib=/sw/lib/")

but to no avail, I still get the same error message:

	checking for main in -lnetcdf...
	The downloaded packages are in
		/private/tmp/RtmpakpDoj/downloaded_packages
	no
	configure: error: netcdf library not found
	ERROR: configuration failed for package 'RNetCDF'
	** Removing '/Library/Frameworks/Resources/library/RNetCDF'
	Warning message:
	installation of package 'RNetCDF' had non-zero exit status in:  
install.packages(c("RNetCDF"), lib = "/Library/Frameworks/Resources/ 
library/",


Does somebody know what I am doing wrong and what could be the  
solution (apart from installing netcdf libraries in classic system  
directories: I prefer them to be managed by Fink)? Thanks in advance.

JiHO
---
http://jo.irisson.free.fr/



More information about the R-SIG-Mac mailing list