2017-04-13 122 views
0

在堆棧中已經有很多這樣的問題了......我發現了很多問題,但它並不能解決我的問題。通過源碼安裝rgdal

這些是我以前試過的東西。去CRAN網站 cran.r-project.org/web/packages/rgdal/index.html

我們看到,爲了搭建這個包,我們需要

  • GDAL> = 1.6。 3,來自trac.osgeo.org/gdal/wiki/DownloadSource的庫和
  • PROJ.4(proj> = 4.4.9)from download.osgeo.org/proj/;

此外,我們需要依賴

  • 取決於:R(≥3.3.0),方法,SP(≥1.1-0)

但這些都已經安裝。

我們已經安裝了該系統的依賴,因爲

[]$ gdal-config --version 
2.1.3 
[]$ proj 
Rel. 4.4.9, 29 Oct 2004 
usage: proj [ -beEfiIlormsStTvVwW [args] ] [ +opts[=arg] ] [ files ] 

然而,當我們試圖通過

install.packages("rgdal_1.2-5.tar.gz",type = "source",repos = NULL, 
configure.args=c('--with-proj-include=/usr/local/include','--with-proj-lib=/usr/local/lib')) 

的configure.args選擇安裝的軟件包是從答案中 rgdal package installation

但是,安裝時仍然出現錯誤...這是日誌的一部分

*** installing help indices 
     converting help for package ‘rgdal’ 
     finding HTML links ... done 
     CRS-class        html 
     GDALDataset-class      html 
     GDALDriver-class      html 
     GDALMajorObject-class     html 
     GDALRasterBand-class     html 
     GDALReadOnlyDataset-class    html 
     GDALReadOnlyDataset-methods    html 
     GDALTransientDataset-class    html 
     GridsDatums        html 
     RGB2PCT         html 
     SGDF2PCT        html 
     SpatialGDAL-class      html 
     closeDataset-methods     html 
     displayDataset       html 
     llgrid         html 
    Rd warning: /tmp/RtmppvlZ6x/R.INSTALL233feb7dc50/rgdal/man/llgrid.Rd:11: missing file link ‘Spatial’ 
    Rd warning: /tmp/RtmppvlZ6x/R.INSTALL233feb7dc50/rgdal/man/llgrid.Rd:16: missing file link ‘gridat’ 
    Rd warning: /tmp/RtmppvlZ6x/R.INSTALL233feb7dc50/rgdal/man/llgrid.Rd:17: missing file link ‘gridat’ 
     make_EPSG        html 
     nor2k         html 
     projInfo        html 
     project         html 
     readGDAL        html 
    Rd warning: /tmp/RtmppvlZ6x/R.INSTALL233feb7dc50/rgdal/man/readGDAL.Rd:136: missing file link ‘flipVertical’ 
     readOGR         html 
     showWKT         html 
     spTransform-methods      html 
     wrappers        html 
     writeOGR        html 
    ** building package indices 
    ** installing vignettes 
    ** testing if installed package can be loaded 
    Error in dyn.load(file, DLLpath = DLLpath, ...) : 
     unable to load shared object '/usr/lib64/R/library/rgdal/libs/rgdal.so': 
     libgdal.so.20: cannot open shared object file: No such file or directory 
    Error: loading failed 
    Execution halted 
    ERROR: loading failed 
    * removing ‘/usr/lib64/R/library/rgdal’ 
    Warning message: 
    In install.packages("rgdal_1.2-5.tar.gz", type = "source", repos = NULL) : 
     installation of package ‘rgdal_1.2-5.tar.gz’ had non-zero exit status 

請注意,在這裏引發的警告是apparantly沒有顯示塞(如在https://groups.google.com/forum/#!topic/batchjobs/TvwTbqrWFyU說的) 如此看來,該系統依賴(GDAL和PROJ)都遇到了......包的依賴關係(方法,sp)也在那裏。但是,安裝無法找到某些文件.. 我知道從stackoverflow和你可以給R的install.packages()命令提供某些參數......就像上面的代碼片段所示..所以它可能是我不是指定足夠的路徑......或者其對老edgenode別的東西

Atlast,GDAL和凸出的位置由

  • @中給定的:在/ usr/local/lib目錄/ libgdal。 so.20
  • 凸出:/usr/local/lib/libproj.so.0 11時26分32秒

你們可以告訴我們該從哪裏出發?

回答

0

我面對同樣的問題,在Ubuntu的另一個線程中,答案是哪個rgdal-config提供了兩個安裝點,這是錯誤的,所以他卸載了一個。在另一個線程上解決方案是安裝libgdal-dev,因爲它們需要從源代碼安裝。

我在Arch Linux上,所以這些都不是我的答案。我發現對於libgdal-dev,AUR軟件包「python-gdal」給了我所需的代碼,但是關鍵的是rgdal的可選依賴項(它對我來說沒有問題)是mariadb 。在錯誤中,你可以看到它與mysql_client18通信失敗。

因此,我安裝了maria db,sudo pacman -S mariadb,我終於可以爲r安裝r-cran-gdal了。r-cran-gdal的PKGBUILD不合格日期在AUR上,但是手動編輯PKGBUILD和makepkg -si終於奏效了。