[R开发工具]-- linux下源码安装R-3.1.2.tar.gz和RStudio开发工具

本文详细介绍了如何在Linux环境下通过源码安装R语言及其配套的集成开发环境RStudio。包括下载安装包、配置编译环境、解决常见错误及验证安装是否成功等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、源码安装R语言(在linux下安装比较慢,一般需要30分钟左右)

 

1、下载R 安装包

 

  R-3.1.2.tar.gz  http://cran.rstudio.com/src/base/R-3/R-3.1.2.tar.gz

 

 

2、解压

 

   tar xvf R-3.1.2.tar.gz

 

 

3、检查编译环境是否正常
   #cd R-3.1.2

 

   #./configure  --enable-R-shlib  --prefix=/usr/R-3.1.2      ////注意:这里是指定安装目录,默认目录是/usr下

 

 

注意一:
如果安装成功会有如下显示
R is now configured for x86_64-unknown-linux-gnu

  Source directory:          .
  Installation directory:    /usr/R-3.1.2


  C compiler:                gcc -std=gnu99  -g -O2
  Fortran 77 compiler:       gfortran  -g -O2


  C++ compiler:              g++  -g -O2
  C++ 11 compiler:           g++  -std=c++0x -g -O2
  Fortran 90/95 compiler:    gfortran -g -O2
  Obj-C compiler:     


  Interfaces supported:      X11
  External libraries:        readline
  Additional capabilities:   NLS
  Options enabled:           shared R library, shared BLAS, R profiling


  Capabilities skipped:      PNG, JPEG, TIFF, cairo, ICU
  Options not enabled:       memory profiling


  Recommended packages:      yes


注意二:
 1)./configure 报错
   configure: error: No F77 compiler found 
   解决方法:
   安装gcc环境
   #yum install gcc-gfortran -y


 2)./configure 报错
  configure: error: --with-readline=yes (default) and headers/libs are not available
   解决方法:
  安装rpm环境包
  #yum install  readline-devel -y
 
  3)./configure 报错
  configure: error: --with-x=yes (default) and X11 headers/libs are not available 
  解决方法:
   #yum install libXt-devel -y


  4)./configure 报错 
   configure: error: C++ preprocessor "/lib/cpp" fails sanity check
   解决方法:
   安装编译环境包
   #yum install gcc-c++  glibc-headers -y
 
4、当前解压目录下编译、安装(网速不好则时间等待比较长,20分钟左右):
   #make && make install


5、离开解压目录,进入安装成功目录,进行检查是否成功
 [root@node1 bin]# pwd
    /usr/R-3.1.2/bin
 [root@node1 bin]# ./R
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)


R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.


  Natural language support but running in an English locale


R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.


Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> print("Hello world")

 

[1] "Hello world"

 

 

二、源码安装RStudio

1、创建一个文件夹,获取RStudio的rpm包
#wget http://download2.rstudio.org/rstudio-server-0.98.1091-x86_64.rpm
#yum install openssl099e -y

2、安装

#yum install --nogpgcheck rstudio-server-0.98.1091-x86_64.rpm -y
 

3、启动rstudio-server start


4、执行rstudio-server verify-installation
报错:
[root@node1 rstudio]# rstudio-server verify-installation
28 Jul 2016 05:04:13 [rserver] ERROR Unable to find an installation of R on the system (which R didn't return valid output); LOGGED FROM: rstudio::core::FilePath rstudio::core::r_util::<unnam
ed>::systemDefaultRScript(std::string*) /root/rstudio/src/cpp/core/r_util/REnvironmentPosix.cpp:22528 Jul 2016 05:04:13 [rserver] ERROR Unable to locate R binary by scanning standard locations; LOGGED FROM: rstudio::core::FilePath rstudio::core::r_util::<unnamed>::scanForRScript(const std:
:vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::string*) /root/rstudio/src/cpp/core/r_util/REnvironmentPosix.cpp:69Unable to find an installation of R on the system (which R didn't return valid output); Unable to locate R binary by scanning standard locations
原因:没有配置R的环境变量

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

oo寻梦in记

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值