r
  • netcdf
  • 2013-05-10 14 views 6 likes 
    6

    मैं आदेशRNetCDF साझा नहीं खोल सकता वस्तु फ़ाइल

    install.packages('RNetCDF',lib='/home/my_computer/RSCRIPTS/R_LIB/',configure.args="--with-netcdf-include='/home/my_computer/bin/libs4cdo-0.0.10/netcdf-4.2/include/' --with-netcdf-lib='/home/my_computer/local/bin' --with-hdf5-lib='/home/my_computer/local/lib/' --with-udunits-include='/usr/local/lib/' --with-udunits-lib='/usr/local/lib/'",repos='http://star-www.st-andrews.ac.uk/cran/') 
    

    साथ अपने लैपटॉप (Ubuntu 12.04) पर RNetCDF पैकेज स्थापित करने के लिए कोशिश कर रहा हूँ, लेकिन पैकेज स्थापित नहीं होंगे। जब मैं

    sudo R CMD INSTALL --libary='/home/my_computer/RSCRIPTS/R_LIB/' --configure-args="--with-netcdf-include='/home/my_computer/bin/libs4cdo-0.0.10/netcdf-4.2/include/' --with-netcdf-lib='/home/my_computer/local/lib/' --with-hdf5-lib='/home/my_computer/local/lib/' --with-udunits-include=/usr/local/lib/ --with-udunits-lib=/usr/local/lib/" /home/my_computer/Downloads/RNetCDF_1.6.1-2.tar.gz 
    

    के साथ प्रयास त्रुटि संदेश के साथ

    Error in dyn.load(file, DLLpath = DLLpath, ...) : 
    unable to load shared object '/usr/local/lib/R/site-library/RNetCDF/libs/RNetCDF.so': 
        libnetcdf.so.7: cannot open shared object file: No such file or directory 
    

    libnetcdf.so.7 बदल दिया जाता है

    trying URL 'http://star-www.st-andrews.ac.uk/cran/src/contrib/RNetCDF_1.6.1-2.tar.gz' 
    Content type 'application/x-gzip' length 70301 bytes (68 Kb) 
    opened URL 
    ================================================== 
    downloaded 68 Kb 
    
    * installing *source* package ‘RNetCDF’ ... 
    ** package ‘RNetCDF’ successfully unpacked and MD5 sums checked 
    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... 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 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/usr/share/R/include -I/usr/local/lib/ -I/home/bauduinm/bin/libs4cdo-0.0.10/netcdf-4.2/include/  -fpic -O3 -pipe -g -c RNetCDF.c -o RNetCDF.o 
    gcc -std=gnu99 -shared -o RNetCDF.so RNetCDF.o -ludunits2 -lnetcdf -L/home/my_computer/local/lib/ -L/usr/local/lib/ -L/home/my_computer/local/bin -lexpat -L/usr/lib/R/lib -lR 
    installing to /home/my_computer/RSCRIPTS/R_LIB/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 '/home/my_computer/RSCRIPTS/R_LIB/RNetCDF /libs/RNetCDF.so': 
    libexpat.so.0: cannot open shared object file: No such file or directory 
    Error: loading failed 
    Execution halted 
    ERROR: loading failed 
    * removing ‘/home/my_computer/RSCRIPTS/R_LIB/RNetCDF’ 
    
    The downloaded packages are in 
    ‘/tmp/Rtmpl5MniY/downloaded_packages’ 
    Warning message: 
    In install.packages("RNetCDF", lib = "/home/my_computer/RSCRIPTS/R_LIB/", : 
        installation of package ‘RNetCDF’ had non-zero exit status 
    

    /home/my_computer/local/lib/ में निश्चित रूप से है जो भी मेरी LD_LIBRARY_PATH है: नीचे दिए गए संदेश देखें । माना जाता है कि libexpat.so.0, जो पहले त्रुटि संदेश (install.packages के साथ) में से एक है, इंटेल संबंधित फ़ोल्डरों में स्थित है जो ऐसा नहीं लगता कि उनके पास netcdf पुस्तकालयों के साथ कुछ भी नहीं है।

    क्या कोई मुझे प्रबुद्ध कर सकता है?

    धन्यवाद।

    संपादित करें: ठीक है, मुझे कभी पता नहीं चलेगा कि क्या हुआ क्योंकि जब मैंने 3 दिनों बाद ठीक उसी install.packages कमांड लाइन के साथ कोशिश की तो पैकेज बिना किसी समस्या के स्थापित किया गया ... तो मेरी एकमात्र सलाह है जिसके पास हो सकता है एक ही समस्या आर से लॉग आउट करना और फिर से शुरू करना है, बस सत्र में कुछ पिछली गलतियों लॉग में बने रहे।

    +1

    आपके पहले प्रयास में, जब यह लाइब्रेरी लोड करने में विफल रहता है, तो क्या वास्तव में इस पथ में एक जगह है: '/ home/my_computer/RSCRIPTS/R_LIB/RNetCDF/libs/RNetCDF.so', या यह एक स्वरूपण है जब आप इसे एसओ में चिपकाते हैं तो समस्या? – nograpes

    +0

    इसके अलावा, 'libexpat.so.0' को जोड़ने के बारे में [इस पोस्ट] को पढ़ें (http://ubuntuforums.org/showthread.php?t=1034715)। यदि आपके पास एक नया संस्करण स्थापित है, तो आप पैकेज को सही स्थान पर इंगित करने के लिए एक लिंक का उपयोग करना चाह सकते हैं (जैसा कि पोस्ट में दिखाया गया है), जो मुझे संदेह है कि आप ऐसा करते हैं। – nograpes

    +0

    '@ nograpes' आपकी टिप्पणियों के लिए धन्यवाद। इसने मुझे अंतरिक्ष मुद्दे (जो एसओ मुद्दे में स्वरूपण था) को देखने के लिए मजबूर किया, कमांड लाइन को फिर से चलाया और महसूस किया कि मैं आज बिना किसी समस्या के पैकेज स्थापित कर सकता हूं। – SnowFrog

    उत्तर

    3

    --no-test-loadR CMD INSTALL जोड़ने का प्रयास करें, यह इंस्टॉल के दौरान त्रुटि से बच जाएगा।

    फिर जांचें कि क्या आप सामान्य आर सत्र में पैकेज लोड कर सकते हैं (library(RNetCDF) के साथ)। इस त्रुटि 'साझा वस्तु लोड करने में असमर्थ' की वजह से विफल रहता है:

    1. जांच करता है, तो आर के साथ Sys.getenv("LD_LIBRARY_PATH")
    2. ldd /usr/local/lib/R/site-library/RNetCDF/libs/RNetCDF.so के उत्पादन में देखते हैं और देखते हैं कि क्या libnetcdf.so.7 हल हो गई है अपने $ LD_LIBRARY_PATH का उपयोग करता है रास्ता है कि आर के LD_LIBRARY_PATH में

    BTW शामिल किया गया है, मैं कोई समस्या नहीं libnetcdf कि उबंटू के साथ आता है का उपयोग कर RNetCDF स्थापित करने के लिए किया था (apt-मिल स्थापित libnetcdf-देव [संस्करण 4.1.1]); जब तक आपको निश्चित रूप से libnetcdf के संस्करण 4.2 की आवश्यकता नहीं है, तो आप इसे आजमा सकते हैं।

    संबंधित मुद्दे

     संबंधित मुद्दे