【问题标题】:Rgdal package install: projects.h: No such file or directory (error)Rgdal 包安装:projects.h:没有这样的文件或目录(错误)
【发布时间】:2018-04-25 08:42:20
【问题描述】:

我正在尝试在我的本地服务器上安装Rgdal 软件包(未连接到互联网)。当我运行install.packages("rgdal_1.2-15.tar.gz","/usr/lib64/R/library/",repos=NULL) 时出现错误inverser.c:4:22: error: projects.h: No such file or directory

这是安装过程的输出:

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: rgdal: 1.2-15
checking for /usr/bin/svnversion... no
configure: svn revision: 691
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.8.1
checking GDAL version >= 1.6.3... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/share/gdal/pcs.csv readable... yes
configure: -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC  -I/usr/include/gdal
checking proj_api.h presence and usability... yes
checking PROJ.4 version: ... 4.8.0
checking PROJ.4: epsg found and readable... yes
checking PROJ.4: conus found and readable... yes
configure: Package CPP flags:  -I/usr/include/gdal
configure: Package LIBS:  -lgdal -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/usr/lib64/R/library/sp/include"   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c OGR_write.cpp -o OGR_write.o
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/usr/lib64/R/library/sp/include"   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c gdal-bindings.cpp -o gdal-bindings.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/usr/lib64/R/library/sp/include"   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC   -c init.c -o init.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/usr/lib64/R/library/sp/include"   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC   -c inverser.c -o inverser.o
inverser.c:4:22: error: projects.h: No such file or directory
inverser.c:6: error: expected ‘)’ before ‘*’ token
make: *** [inverser.o] Error 1
ERROR: compilation failed for package ‘rgdal’
* removing ‘/usr/lib64/R/library/rgdal’
Warning message:
In install.packages("/data/ZUY10/Repo/R/rgdal_1.2-15.tar.gz", "/usr/lib64/R/library/",  :
  installation of package ‘/data/ZUY10/Repo/R/rgdal_1.2-15.tar.gz’ had non-zero exit status

在这一步之前我做了什么:

由于我的服务器是本地服务器,我必须在本地服务器中手动安装所有包“依赖项”,所以我手动安装了大约 30 个包,其中 PROJ.4 和 Gdal 是主要的,如您所见 here

安装 RGDAL PACKAGE 时我错过了什么?

【问题讨论】:

    标签: r rgdal


    【解决方案1】:

    标头 projects.h 来自 PROJ.4。该头文件位于您的系统上的什么位置?您可以通过--with-proj-include=DIR 将此位置传递给configure 脚本,即

    install.packages("rgdal_1.2-15.tar.gz",
                     "/usr/lib64/R/library/",
                     repos=NULL,
                     configure.args="--with-proj-include=DIR")
    

    检查projects.h 已被添加到rgdalrecently

    【讨论】:

    【解决方案2】:

    在进行多次搜索时,我在RHEL7.7 上也遇到了上述问题。我解决了如下:

    #cd /opt
    
    #wget http://download.osgeo.org/gdal/2.0.1/gdal-2.0.1.tar.gz
    
    #./configure
    
    #make
    
    #make install
    
    #echo "/usr/local/lib" >> /etc/ld.so.conf.d/libgdal-x86_64.conf
    
    #ldconfig
    
    #yum install  proj.x86_64 proj-devel.x86_64 proj-epsg.x86_64 proj-nad.x86_64
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-10
      • 1970-01-01
      • 2019-02-20
      • 2016-02-10
      • 2019-10-07
      • 2017-01-02
      • 1970-01-01
      相关资源
      最近更新 更多