如何使用 --enable-R-shlib 配置 R-3.1.2 [英] How to configure R-3.1.2 with --enable-R-shlib

查看:26
本文介绍了如何使用 --enable-R-shlib 配置 R-3.1.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用命令在 Ubuntu 上安装了 R-3.1.2

I had installed R-3.1.2 on Ubuntu using the commands

wget http://cran.r-project.org/src/base/R-3/R-3.1.2.tar.gz
tar xvfz R-3.1.2.tar.gz
cd R-3.1.2
./configure
make
sudo make install

当我尝试启动 RStudio 时出现错误

When I tried to launch RStudio I got the error

未找到 R 共享库 (/usr/local/lib/R/lib/libR.so).如果这是 R 的自定义构建,是否使用 --enable-R-shlib 选项构建?

R shared library (/usr/local/lib/R/lib/libR.so) not found. If this is a custom build of R, was it built with the --enable-R-shlib option?

所以我回去尝试重新配置

So I went back and tried to reconfigure with

./configure --enable-R-shlib=yes
make

但是我得到了错误

collect2: error: ld returned 1 exit status
make[3]: *** [libR.so] Error 1
make[3]: Leaving directory `/usr/local/lib/R-3.1.2/src/main'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/usr/local/lib/R-3.1.2/src/main'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/usr/local/lib/R-3.1.2/src'
make: *** [R] Error 1

在搜索堆栈溢出时,我在这里找到了答案:如何配置 R-3.0.1 --启用-R-shlib这表明问题在于我试图在我之前编译的目录中编译而没有--enable-R-shlib"选项

When searching stack overflow, I found an answer here: How to configure R-3.0.1 with --enable-R-shlib that suggested that the problem was that I was trying to compile in a directory that I had previously compiled without the "--enable-R-shlib" option

我尝试使用命令来解决问题

I tried to fix the problem by using the commands

make uninstall

许多无需为`卸载'做任何事情"都没有给出任何错误.声明,但它确实成功卸载了 R

which gives no errors by many "Nothing to be done for `uninstall'." statements, but it did successfully uninstall R

./configure --enable-R-shlib=yes

给出错误

config.status: error: cannot find input file: `src/library/base/DESCRIPTION.in'

然后

make

它给出了与我之前尝试制作时相同的错误.

which gives the same error as when I tried to make before.

你能帮我看看我哪里出错了吗?

Can you help me see where I have gone wrong?

推荐答案

make uninstall 只是撤消了 make install 步骤,一般是将文件从编译目录复制到dir(s) 在适当的系统上,并将二进制文件放在 /usr/bin 中,以便它们在路径上.如果您想清理之前编译的目录,请使用 make clean (或 make distclean,我忘记了现在就 R 而言有什么区别但约定是它应该将构建目录返回到预配置、预构建状态.).

make uninstall only undoes the make install step, which generally copies the files from the compilation dir to dir(s) on the system as appropriate, and puts binaries in say /usr/bin so they are on the path. If you wanted to clean up the dir where you did a previous compile, use make clean (or make distclean, I forget what the difference is now as far as R is concerned but convention is that it should return the build dir to pre-configure, pre-build state.).

一般来说,您也不希望在包含 R 源代码的目录中构建(./configure 建议您正在这样做).

You also, in general, don't want to be building in the dir which contains the R sources (which ./configure suggests you are doing).

这篇关于如何使用 --enable-R-shlib 配置 R-3.1.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆