Configure error in rgdal “gdal-config”

瘦欲@ 提交于 2020-06-27 17:10:26

问题


I am currently running some species distribution modelling and richness mapping in R on a linux cluster. In order to run my analyses I need to install rgdal so that the raster function in my modelling package works correctly. I have installed proj4 and gdal already. However when I attempt to install rgdal I get an error message:

checking for gdal-config... no
no

configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package 'rgdal'

This is the command I used to install rgdal package:

install.packages("rgdal", configure.args=c("--with-proj-include=/home/nikhail1/bin/proj-4.9.2/bin", "--with-proj-lib=/home/nikhail1/bin/proj-4.9,2/lib"))

However despite the gdal-config error, gdal seems to be installed onto my local system (the binary and library folders are present in the address to which I installed them). I also did not see any error messages during the gdal installation process. Why is this error occurring? How do I get R to recognize that this dependency is installed, or indeed if there is a problem how do I identify it? Most of the solutions I have found online are specific to Debian and Ubuntu systems which I am not using. I do not have authority to use sudo apt-get or yum commands. Are there any dependencies of gdal I am missing, as I have only installed proj 4.9.2?

I am new to the linux system, and the rgdal and gdal packages.

Thank you very much for you assistance

Kind Regards,

Nikhail


回答1:


Installing RGDAL in R on Linux

Run this command in R:

# install package from CRAN
# but specify the library director
# the download method
# and the configuration arguments
# to allow for source installs
install.packages( pkgs = "rgdal"
                    , lib = "./R_Packages"
                    , method = "curl"
                    , configure.args = c(
                                   "--with-gdal-config=/Library/Frameworks/GDAL.framework/Programs/gdal-config"
                                   , "--with-proj-include=/p/home/bin/proj4/include"
                                   , "--with-proj-lib=/p/home/bin/proj4/lib"
                                     ) 
      )

Answer comes from cross-referencing Errors installing rgdal on LINUX system? and Trouble installing rgdal.




回答2:


So i have finally solved the issue by adding the directory of the gdal-config file in the install.packages command.

Thank you very much for your assistance, Nikhail



来源:https://stackoverflow.com/questions/48668535/configure-error-in-rgdal-gdal-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!