Rgdal包安装:projects.h:没有这样的文件或目录(错误)

时间:2018-04-25 08:42:21

标签: r rgdal

我正在尝试在我的本地服务器上安装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。 / p>

我在这里想念RGDAL PACKAGE?

2 个答案:

答案 0 :(得分:3)

标题projects.h来自PROJ.4。您的系统上的头文件在哪里?您可以通过configure将此位置传递到--with-proj-include=DIR脚本,即

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

projects.h仅检查rgdal Microsoft.Xrm.Client

答案 1 :(得分:0)

在进行多次搜索后,我在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

希望这会有所帮助。