[R-SIG-Mac] Install RNetCDF_1.7-3.tar.gz

Marc Girondot marc_grt at yahoo.fr
Fri Jun 12 15:56:50 CEST 2015

Dear list members,

RNetCDF_1.7-3 binaries are not available for OS X Mavericks, so I try 
install it from sources.

1- Using MacPorts, I installed netcdf, hdf5, udunits and udunits2 
libraries. It seems that they are correctly installed with the lastest 

belinda:~ marc$ port installed

hdf5 @1.8.15-patch1_0+cxx (active)
netcdf @ (active)
udunits @1.12.11_2 (active)
udunits2 @2.1.24_0 (active)

2- in my .profile, I introduce this line:

And it seems to work correctly:

belinda:~ marc$ echo $LD_LIBRARY_PATH

3- Then I load RNetCDF_1.7-3.tar.gz in the desktop and I run this command:

--with-udunits-lib='/opt/local/lib' --with-hdf5-lib='/opt/local/lib'" 

4- But I obtain this error (the list of all outputs is shown below. Here 
I show only the error:

clang -dynamiclib -Wl,-headerpad_max_install_names -undefined 
dynamic_lookup -single_module -multiply_defined suppress 
-L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o 
RNetCDF.so RNetCDF.o -lnetcdf -ludunits2 -lhdf5_hl -lhdf5 -lexpat -lcurl 
-lz -ldl -lm -F/Library/Frameworks/R.framework/.. -framework R 
-Wl,-framework -Wl,CoreFoundation
ld: library not found for -lnetcdf

Does someone have an idea of the mistake(s) I did ?

Thanks a lot


List of all output from the R CMD INSTALL:

* installing to library 
* installing *source* package ‘RNetCDF’ ...
** package ‘RNetCDF’ correctement décompressé et sommes MD5 vérifiées
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for cos in -lm... yes
checking for dlopen in -ldl... yes
checking for deflate in -lz... yes
checking for curl_easy_init in -lcurl... yes
checking for XML_Parse in -lexpat... yes
checking for H5open in -lhdf5... yes
checking for H5DSset_scale in -lhdf5_hl... yes
checking for utScan in -ludunits2... yes
checking for nc_open in -lnetcdf... yes
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
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 udunits2/udunits.h usability... yes
checking udunits2/udunits.h presence... yes
checking for udunits2/udunits.h... yes
configure: creating ./config.status
config.status: creating R/load.R
config.status: creating src/Makevars
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG 
-DHAVE_NETCDF_H=1 -DHAVE_UDUNITS2_UDUNITS_H=1 -I/opt/local/include 
-I/opt/local/include  -I/usr/local/include 
-I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall 
-mtune=core2 -g -O2  -c RNetCDF.c -o RNetCDF.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined 
dynamic_lookup -single_module -multiply_defined suppress 
-L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o 
RNetCDF.so RNetCDF.o -lnetcdf -ludunits2 -lhdf5_hl -lhdf5 -lexpat -lcurl 
-lz -ldl -lm -F/Library/Frameworks/R.framework/.. -framework R 
-Wl,-framework -Wl,CoreFoundation
ld: library not found for -lnetcdf
clang: error: linker command failed with exit code 1 (use -v to see 
make: *** [RNetCDF.so] Error 1
ERROR: compilation failed for package ‘RNetCDF’
* removing 
* restoring previous 

More information about the R-SIG-Mac mailing list