centos 6.5下安装R 3.2.0

步骤:

先卸载

sudo make uninstall

删除文件夹

rm -rf 文件夹

在编译R之前,需要通过yum安装以下几个程序:

#yum install gcc-gfortran         

#yum install gcc gcc-c++        

#yum install readline-devel       

#yum install libXt-devel   

#yum install libpng libpng-devel libtiff libtiff-devel libjpeg-turbo libjpeg-turbo-devel


1,下载R-3.2.0.tar.gz
http://cran.r-project.org/src/base/R-3/R-3.2.0.tar.gz

2,解压
$ tar -zxvf R-3.0.1.tar.gz
$ cd R-3.0.1

3,编译(确保系统中安装了编译需要的包,如果没有安装,会报错。)

$ ./configure --enable-R-shlib --with-libpng --with-jpeglib --with-libtiff --with-x

--enable-R-shlib:这个选项,不用则RStudio-server安装会有问题

--with-libpng --with-jpeglib --with-libtiff:这几个不装,则图形显示会有问题


编译信息如下:

R is now configured for x86_64-unknown-linux-gnu

  Source directory:          .
  Installation directory:    /usr/local

  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

[root@hadoop1-mysql R-3.2.0]# cd /usr/local
[root@hadoop1-mysql local]# ls
bin  etc  games  include  lib  lib64  libexec  perl  sbin  share  src


4,安装

$ make 这步出错(a)

这步其实完成了安装,可执行程序R在/home/R/R-3.2.0/bin下,此时 /usr/local/bin下还没有可执行的R

$ make install

这步执行后, /usr/local/bin下有了可执行的R


5,登录R
$ exit
$ R


出错(a)的情况及解决办法:
报错终止:“句法分析器30856行里不能有多字节字符”

解决办法:在环境变量里增加东东,操作如下:

$  vi /etc/profile

在文件末尾加上如下两行代码

    export LANG=zh_CN.UTF-8

    export LANGUAGE=zh_CN.UTF-8

要是刚才的修改马上生效,需要执行以下代码

$ source /etc/profile


以下还没验证

R-3.2.0 on CentOS 7

April 28, 2015

certainly for R-3.2.0 the -lz flag is needed for the compilers e.g.

./configure  –with-x –with-lapack –enable-R-shlib –without-system-bzlib CFLAGS=”-lz” FFLAGS=”-lz”

also you should have these

yum install java-1.7.0-openjdk-devel texlive-* ncompress readline-devel libX11-devel libXt-devel texinfo libjpeg-devel cairo-devel tk-devel tcl-devel libtiff-devel libicu-dev blas

 

so configure gives

 

R is now configured for x86_64-unknown-linux-gnu

Source directory: .
Installation directory: /maths/R

C compiler: gcc -std=gnu99 -lz
Fortran 77 compiler: gfortran -lz

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

Interfaces supported: X11, tcltk
External libraries: readline, zlib
Additional capabilities: PNG, JPEG, TIFF, NLS, cairo, ICU
Options enabled: shared R library, shared BLAS, R profiling

Capabilities skipped:
Options not enabled: memory profiling

Recommended packages: yes

configure: WARNING: neither inconsolata.sty nor zi4.sty found: PDF vignettes and package manuals will not be rendered optimally



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值