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

一、源码安装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:: 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::::scanForRScript(const std:
:vector, std::allocator >, std::allocator, std::allocator > > >&, 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的环境变量

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(R)