知道R语言的rgeos软件包需要事先安装geos库,因此我在Ubuntu 12.04(32位)计算机上使用了突触安装程序安装了libgeos和libgeos-c1(3.2.2)。
然后,我尝试直接从R控制台安装rgeos,从某种意义上说,它发出的消息是找不到geos-config。输出如下:
> install.packages("rgeos")
Installing package(s) into ‘/home/checo/R/i486-pc-linux-gnu-library/2.15’
(as ‘lib’ is unspecified)
also installing the dependency ‘sp’
probando la URL 'http://cran.rstudio.com/src/contrib/sp_1.0-9.tar.gz'
Content type 'application/x-gzip' length 882102 bytes (861 Kb)
URL abierta
==================================================
downloaded 861 Kb
probando la URL 'http://cran.rstudio.com/src/contrib/rgeos_0.2-19.tar.gz'
Content type 'application/x-gzip' length 221471 bytes (216 Kb)
URL abierta
==================================================
downloaded 216 Kb
* installing *source* package ‘sp’ ...
** package ‘sp’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c R centroid.c -o Rcentroid.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c gcdist.c -o gcdist.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c pip.c -o pip.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c pip2.c -o pip2.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c sp_xports.c -o sp_xports.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c surfaceArea.c -o surfaceArea.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c zerodist.c -o zerodist.o
gcc -std=gnu99 -shared -o sp.so Rcentroid.o gcdist.o init.o pip.o pip2.o sp_xports.o surfaceArea.o zerodist.o -L/usr/lib/R/lib -lR
installing to /home/checo/R/i486-pc-linux-gnu-library/2.15/sp/libs
** R
** data
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
‘intro_sp.Rnw’
‘over.Rnw’
** testing if installed package can be loaded
* DONE (sp)
* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgeos: 0.2-17
checking for /usr/bin/svnversion... no
configure: svn revision: 394
checking geos-config usability...
./configure: line 1385: geos-config: command not found
no
configure: error: geos-config not usable
ERROR: configuration failed for package ‘rgeos’
* removing ‘/home/checo/R/i486-pc-linux-gnu-library/2.15/rgeos’
Warning in install.packages :
installation of package ‘rgeos’ had non-zero exit status
原谅我的无知,但是我不知道这个文件“ geos-config”来自哪里:它是由上面的gcc编译生成的,还是应该在安装libgeos库时预先安装的?
我从另一台机器上获悉,“ geos-config”是可执行文件,应将其安装在/ usr / bin中。
您对我的手术有什么问题有任何想法吗?
谢谢,
-塞尔吉奥
apt-file
在ubuntu存储库中查找文件。例如。apt-file search geos-config
会给您与的完全匹配libgeos-dev
。