2016-08-12 61 views
7

林試圖安裝一個名爲「rgeos」 R上3.3包,但是當我鍵入錯誤安裝[R組件用於Linux

install.packages("rgeos") 

但它返回我下面的錯誤(同樣的情況與其他包,但不所有包):

> * installing *source* package ‘rgeos’ ... 
** package ‘rgeos’ successfully unpacked and MD5 sums checked 
configure: CC: gcc 
configure: CXX: g++ 
configure: rgeos: 0.3-19 
checking for /usr/bin/svnversion... no 
configure: svn revision: 524 
checking for geos-config... no 
no 
configure: error: geos-config not found or not executable. 
ERROR: configuration failed for package ‘rgeos’ 
* removing ‘/home/kdg/R/x86_64-pc-linux-gnu-library/3.3/rgeos’ 
> 
> The downloaded source packages are in 
> ‘/tmp/Rtmpsa5pDo/downloaded_packages’ Warning message: In 
> install.packages("rgeos") : installation of package ‘rgeos’ had 
> non-zero exit status 

任何線索如何CON安裝此軟件包?

+0

您是否安裝了任何geos庫?在我的系統上,我有_geos_和_geos-devel_ – jgadoury

+1

謝謝@ user20650它的工作! – Tangent3

回答

12

看來,在Linux中運行R需要安裝一些構建工具。在這種情況下,在終端中:

sudo apt-get install libgeos-dev 

然後嘗試重新安裝軟件包。

hints from here

0

我用下面的解決了這個問題:

cd /opt 
git clone https://github.com/ 
cd geos 
export CC='clang' && export CXX='clang++' && export OBJC='clang' 
./autogen.sh 
./configure 
make 
sudo -EH make install 
R 
install.packages('rgeos') 

NB:export clang是特別給我;我只是在粘貼我的確切解決方案。