[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 
version:

belinda:~ marc$ port installed

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

2- in my .profile, I introduce this line:
export LD_LIBRARY_PATH=/opt/local:$LD_LIBRARY_PATH

And it seems to work correctly:

belinda:~ marc$ echo $LD_LIBRARY_PATH
/opt/local:


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

R CMD INSTALL 
--configure-args="--with-netcdf-include='/opt/local/include' 
--with-netcdf-lib='/opt/local/lib' 
--with-udunits-include='/opt/local/include' 
--with-udunits-lib='/opt/local/lib' --with-hdf5-lib='/opt/local/lib'" 
/Users/marc/Desktop/RNetCDF_1.7-3.tar.gz

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

Marc






List of all output from the R CMD INSTALL:

* installing to library 
‘/Library/Frameworks/R.framework/Versions/3.2/Resources/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 
-DPACKAGE_NAME=\"RNetCDF\" -DPACKAGE_TARNAME=\"rnetcdf\" 
-DPACKAGE_VERSION=\"1.7-3\" -DPACKAGE_STRING=\"RNetCDF\ 1.7-3\" 
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_LIBM=1 -DHAVE_LIBDL=1 
-DHAVE_LIBZ=1 -DHAVE_LIBCURL=1 -DHAVE_LIBEXPAT=1 -DHAVE_LIBHDF5=1 
-DHAVE_LIBHDF5_HL=1 -DHAVE_LIBUDUNITS2=1 -DHAVE_LIBNETCDF=1 
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 
-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 
invocation)
make: *** [RNetCDF.so] Error 1
ERROR: compilation failed for package ‘RNetCDF’
* removing 
‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/RNetCDF’
* restoring previous 
‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/RNetCDF’



More information about the R-SIG-Mac mailing list