为 Linux 安装 R 包时出错
Error installing R package for Linux
我正在尝试在 R 3.3 上安装一个名为 "rgeos" 的包,但是当我键入
install.packages("rgeos")
但是 returns 我出现了以下错误(其他包也有同样的情况,但不是所有的包):
> * 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
有什么线索可以安装这个包吗?
好像运行Linux中的R需要安装一些构建工具。在这种情况下,在终端中:
sudo apt-get install libgeos-dev
然后再次尝试包安装。
我用以下方法解决了它:
cd /opt
git clone https://github.com/libgeos/geos
cd geos
export CC='clang' && export CXX='clang++' && export OBJC='clang'
./autogen.sh
./configure
make
sudo -EH make install
R
install.packages('rgeos')
注意:export clang
对我来说很特别;我只是粘贴我的确切解决方案。
我正在尝试在 R 3.3 上安装一个名为 "rgeos" 的包,但是当我键入
install.packages("rgeos")
但是 returns 我出现了以下错误(其他包也有同样的情况,但不是所有的包):
> * 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
有什么线索可以安装这个包吗?
好像运行Linux中的R需要安装一些构建工具。在这种情况下,在终端中:
sudo apt-get install libgeos-dev
然后再次尝试包安装。
我用以下方法解决了它:
cd /opt
git clone https://github.com/libgeos/geos
cd geos
export CC='clang' && export CXX='clang++' && export OBJC='clang'
./autogen.sh
./configure
make
sudo -EH make install
R
install.packages('rgeos')
注意:export clang
对我来说很特别;我只是粘贴我的确切解决方案。