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?
Install RNetCDF_1.7-3.tar.gz
2 messages · Marc Girondot
7 days later
I answer myself to my question just in case someone will search for the same problem; he/she will find the solution ! The problem is seen only if MacPorts is used. If the library in installed in other way, it works. The complete solution has been posted here: http://max2.ese.u-psud.fr/epc/conservation/Girondot/Publications/Blog_r/Entrees/2014/4/7_rgdal_and_other_packages_with_R_3.1.html Sincerely, Marc Le 12/06/2015 15:56, Marc Girondot a ?crit :
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
__________________________________________________________ Marc Girondot, Pr Laboratoire Ecologie, Syst?matique et Evolution Equipe de Conservation des Populations et des Communaut?s CNRS, AgroParisTech et Universit? Paris-Sud 11 , UMR 8079 B?timent 362 91405 Orsay Cedex, France Tel: 33 1 (0)1.69.15.72.30 Fax: 33 1 (0)1.69.15.73.53 e-mail: marc.girondot at u-psud.fr Web: http://www.ese.u-psud.fr/epc/conservation/Marc.html Skype: girondot