2014-02-06 88 views
3

在我的Linux集羣上,我遇到了重編譯R包需要重新編譯 並刪除了libRcpp.so的最新版本。最終目標是 以運行R包DEseq2。我們在/opt/bin目錄中安裝了g ++的新版本 ,在/opt/lib64中有新庫。我已經 也創造.R/Makevars具有這些指令:R重編譯包失敗,因爲失敗

CXX=/opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 

-Wl,-llibstdc++ CC=/opt/bin/c++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++ 
SHLIB_OPENMP_CXXFLAGS= -fopenmp 

「的Makevars失敗的各種版本,這只是我的最新嘗試 克服它沒有找到的libstdC++,當它連接 犰狳裝載機問題正如你所看到的,它是在尋找/usr/lib64代替 /opt/lib64。這是因爲如果我的-Wl指令被忽略。我 運行R作爲sudo的。

也是我的.bashrc有:

LD_LIBRARY_PATH=/opt/lib64:/opt/lib64/R/library/Rcpp/libs:$LD_LIBRARY_PATH:~/lib:~/perl/lib:~/lib/bamtools 

LD_RUN_PATH=/opt/lib64:$LD_RUN_PATH:~/lib 

export LD_LIBRARY_PATH 
export LD_RUN_PATH 

這裏是我所得到的,當我嘗試R中編譯新的軟件包需要重新編譯 :


install.packages(onCRAN, lib=lib, repos=rep) 
    trying URL 'http://cran.rstudio.com/src/contrib/RcppArmadillo_0.4.000.2.tar.gz' 
    Content type 'application/x-gzip' length 892941 bytes (872 Kb) 
    opened URL 
    ================================================== 
    downloaded 872 Kb 

    * installing *source* package âRcppArmadilloâ ... 
    ** package âRcppArmadilloâ successfully unpacked and MD5 sums checked 
    * checking LAPACK_LIBS divide-and-conquer complex SVD unavailable via R-supplied LAPACK 
    * divide-and-conquer algorithm for complex SVD will be redirected to default 
    ** libs 
    /opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++ -I/opt/lib64/R/include -DNDEBUG -I/usr/local/include -I"/opt/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c RcppArmadillo.cpp -o RcppArmadillo.o 
    /opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++ -I/opt/lib64/R/include -DNDEBUG -I/usr/local/include -I"/opt/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o 
    /opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++ -I/opt/lib64/R/include -DNDEBUG -I/usr/local/include -I"/opt/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c fastLm.cpp -o fastLm.o 
    Error in dyn.load(file, DLLpath = DLLpath, ...) : 
     unable to load shared object '/opt/lib64/R/library/Rcpp/libs/Rcpp.so': 
     /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/lib64/R/library/Rcpp/libs/Rcpp.so) 
    Calls: ::: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> 
    Execution halted 
    /opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++ -shared -L/usr/local/lib64 -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -L/opt/lib64/R/lib -lRlapack 
-L/opt/lib64/R/lib -lRblas -lgfortran -lm 
    Error in dyn.load(file, DLLpath = DLLpath, ...) : 
     unable to load shared object '/opt/lib64/R/library/Rcpp/libs/Rcpp.so': 
     /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by  /opt/lib64/R/library/Rcpp/libs/Rcpp.so)` 
    Calls: ::: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> 
    Execution halted 
    /usr/bin/ld: cannot find -llibstdc++ 
    collect2: error: ld returned 1 exit status 
    make: *** [RcppArmadillo.so] Error 1 
    ERROR: compilation failed for package âRcppArmadilloâ 
    * removing â/opt/lib64/RcppArmadilloâ 

下載的源碼包在

/tmp/RtmpZty35f/downloaded_packages 

警告消息:

In install.packages(onCRAN, lib = lib, repos = rep) : 
    installation of package RcppArmadillo had non-zero exit code 

回答

0

兩個快速評論:

  1. CXX=/opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64中的CXX定義是一點點,啊哈,不尋常,因爲它混合連接說明書(用於ld二進制)。我會再試一次。

  2. 編譯RcppArmadillo的錯誤沒有多大意義,它應該嘗試加載libRcpp.so。並'GLIBCXX_3.4.9' not found建議您可能有一個路徑設置。

我想嘗試一個更簡單的設置,少了許多,然後從內到外的工作:重建/重新RCPP,然後RcppArmadillo等。它適用於許多使用更多標準設置的人。