使用--enable-R-shlib安装R 3.5.0 [英] Installing R 3.5.0 with --enable-R-shlib

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

问题描述

我正在尝试在Linux Mint下使用标志--enable-R-shlib从源代码安装R 3.5.0.在没有标志的情况下进行配置和安装可以正常工作,但是RStudio要求设置标志.但是,运行时

I am trying to install R 3.5.0 from source with the flag --enable-R-shlib under Linux Mint. Configuring and installing it without the flag works fine, but RStudio requires the flag to be set. However, when running

./configure --enable-R-shlib
make

我得到了错误

/usr/bin/ld: CommandLineArgs.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
CommandLineArgs.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:177: recipe for target 'libR.so' failed
make[3]: *** [libR.so] Error 1
make[3]: Leaving directory '/home/hps/Downloads/R-3.5.0/src/main'
Makefile:135: recipe for target 'R' failed
make[2]: *** [R] Error 2
make[2]: Leaving directory '/home/hps/Downloads/R-3.5.0/src/main'
Makefile:28: recipe for target 'R' failed
make[1]: *** [R] Error 1
make[1]: Leaving directory '/home/hps/Downloads/R-3.5.0/src'
Makefile:60: recipe for target 'R' failed
make: *** [R] Error 1

我按照[1]的建议尝试按照错误消息中的说明设置-fPIC标志.

I tried setting the -fPIC flag as mentioned in the error message following the advice from [1]

CC="gcc -fPIC" ./configure --enable-R-shlib

无济于事,我仍然收到相同的错误消息.

to no avail, I still get the same error message.

[1] 通过makefile传递gcc标志

推荐答案

在为Ubuntu添加了这些PPAs之后,我能够将Linux Mint 17.3 Rosa的R更新为3.5.0.

After adding these PPAs for Ubuntu, I was able to update R to 3.5.0 for my Linux Mint 17.3 Rosa.

sudo add-apt-repository ppa:marutter/rrutter3.5
sudo add-apt-repository ppa:marutter/c2d4u
sudo apt-get update

参考: https://cran.r-project.org/bin/linux /ubuntu/

要从源代码进行编译,请遵循建议此处

To compile from source, follow the suggestion here

sudo apt-get update
sudo apt-get build-dep r-base
wget https://cran.r-project.org/src/base/R-3/R-3.5.0.tar.gz
tar -xvf R-3.5.0.tar.gz
cd R-3.5.0
./configure --enable-R-shlib
make

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

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