[R] Receive "unable to load shared object RNetCDF.o" during R INSTALL of RNetCDF

David Brown dbrownjr at umn.edu
Mon Sep 5 22:56:21 CEST 2011

On a Red Hat Linux cluster I am seeing the following after multiple
other packages were successfully installed. The error seems to suggest
that RNetCDF.o was not copied to the appropriate lib folder. The admin
user performing the install has the required privileges to perform the
install. Words of wisdom are greatly appreciated:

R CMD INSTALL --configure-args="--with-netcdf-include='/soft/local/netcdf/netcdf-3.6.2/include/'

* installing to library ‘/soft/local/r/R-2.13.1/lib64/R/library’
* installing *source* package ‘RNetCDF’ ...
checking for gcc... gcc -std=gnu99
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking for nc_open in -lnetcdf... yes
checking for utInit in -ludunits2... no
checking for utScan in -ludunits2... yes
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... no
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking netcdf.h usability... yes
checking netcdf.h presence... yes
checking for netcdf.h... yes
checking udunits.h usability... yes
checking udunits.h presence... yes
checking for udunits.h... yes
configure: creating ./config.status
config.status: creating R/load.R
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/soft/local/r/R-2.13.1/lib64/R/include
-I/soft/local/netcdf/netcdf-3.6.2/include/  -I/usr/local/include
-fpic  -g -O2 -c RNetCDF.c -o RNetCDF.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o RNetCDF.so RNetCDF.o
-ludunits2 -lnetcdf -L/soft/local/udunits-2.1.23/lib
-L/soft/local/netcdf/netcdf-3.6.2/libso -lexpat
installing to /soft/local/r/R-2.13.1/lib64/R/library/RNetCDF/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object
  libudunits2.so.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/soft/local/r/R-2.13.1/lib64/R/library/RNetCDF’
[swadm at boar01]/soft/local/temp%

More information about the R-help mailing list