【R语言之Linux环境安装】

[root@hadoop0 ~]# cd /opt/

[root@hadoop0 opt]# df -h

Filesystem                    Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup-lv_root   18G  9.8G  6.7G  60% /

tmpfs                         250M   72K  250M   1% /dev/shm

/dev/sda1                     485M   33M  427M   8% /boot

[root@hadoop0 opt]# wget http://mirror.bjtu.edu.cn/cran/src/base/R-3/R-3.0.1.tar.gz

--1999-08-04 18:11:14--  http://mirror.bjtu.edu.cn/cran/src/base/R-3/R-3.0.1.tar.gz

Resolving mirror.bjtu.edu.cn... 202.112.154.58, 2001:da8:205::58

Connecting to mirror.bjtu.edu.cn|202.112.154.58|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 25508280 (24M) [application/octet-stream]

Saving to: R-3.0.1.tar.gz?

100%[============================>] 25,508,280   311K/s   in 2m 10s  

1999-08-04 18:13:24 (192 KB/s) - R--3.0.1.tar.gz saved [25508280/25508280]

[root@hadoop0 opt]# ls

apache-flume-1.6.0-bin  

apache-storm-0.9.6.tar.gz  

elasticsearch-2.3.3    

 jdk1.7.0_79    

R-3.0.1.tar.gz      rh                

spark-1.3.1-bin-hadoop2.6      

sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz

apache-flume-1.6.0-bin.tar.gz    bigdata                    

elasticsearch-2.3.3.zip  

kafka_2.11-0.9.0.1.tgz  

redis-3.2.0        

scala-2.10.5      

spark-1.3.1-bin-hadoop2.6.tgz  

zookeeper-3.4.6.tar.gz

apache-flume-1.6.0-bin.tar.gz.1  data                      

hadoop-2.7.2.tar.gz      ORCLfmap                

redis-3.2.0.tar.gz  scala-2.10.5.tgz  

sqoop-1.4.6

[root@hadoop0 opt]# 

[root@hadoop0 opt]# tar -zxvf R-3.0.1.tar.gz 

R-3.0.1/VERSION-NICK

tar: R-3.0.1/VERSION-NICK: time stamp 2013-05-06 20:02:06 is 434079738.717527534 s in the future

tar: R-3.0.1: time stamp 2013-05-16 15:11:20 is 434926292.717415555 s in the future

[root@hadoop0 opt]# ls

apache-flume-1.6.0-bin          

apache-storm-0.9.6.tar.gz  

elasticsearch-2.3.3    

 jdk1.7.0_79            

R-3.0.1        

redis-3.2.0.tar.gz  

scala-2.10.5.tgz              

sqoop-1.4.6

apache-flume-1.6.0-bin.tar.gz    

bigdata                    

elasticsearch-2.3.3.zip  

kafka_2.11-0.9.0.1.tgz  R-3.0.1.tar.gz  rh                  

spark-1.3.1-bin-hadoop2.6      

sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz

apache-flume-1.6.0-bin.tar.gz.1  data                      

hadoop-2.7.2.tar.gz      ORCLfmap                

redis-3.2.0     scala-2.10.5        

spark-1.3.1-bin-hadoop2.6.tgz  

zookeeper-3.4.6.tar.gz

[root@hadoop0 opt]# cd R-3.0.1

[root@hadoop0 R-3.0.1]# ./configure 

checking for fl32... no

checking for af77... no

checking for fc... no

configure: error: No F77 compiler found

[root@hadoop0 R-3.0.1]#  yum install gcc-gfortran

[root@hadoop0 R-3.0.1]# ./configure 

checking X11/Intrinsic.h usability... no

checking X11/Intrinsic.h presence... no

checking for X11/Intrinsic.h... no

configure: error: --with-x=yes (default) and X11 headers/libs are not available

[root@hadoop0 R-3.0.1]# yum install libXt-devel

[root@hadoop0 R-3.0.1]# ./configure 

config.status: creating src/include/config.h

config.status: executing libtool commands

config.status: executing stamp-h commands

R is now configured for i686-pc-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

  Fortran 90/95 compiler:    gfortran -g -O2

  Obj-C compiler:             

  Interfaces supported:      X11

  External libraries:        readline

  Additional capabilities:   NLS

  Options enabled:           shared BLAS, R profiling

  Recommended packages:      yes

configure: WARNING: you cannot build info or HTML versions of the R manuals

configure: WARNING: you cannot build PDF versions of the R manuals

configure: WARNING: you cannot build PDF versions of vignettes and help pages

[root@hadoop0 R-3.0.1]#  make

trying to compile and link a JNI progam 

detected JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux

detected JNI linker flags : -L$(JAVA_HOME)/jre/lib/i386/client -ljvm

make[2]: Entering directory `/tmp/RJRECONF.FOhjZn'

gcc -std=gnu99 -I/opt/R-3.0.1/include -DNDEBUG -I/opt/jdk1.7.0_79/include -I/opt/jdk1.7.0_79/include/linux -I/usr/local/include    -fpic  -g -O2  -c conftest.c -o conftest.o

gcc -std=gnu99 -shared -L/usr/local/lib -o conftest.so conftest.o -L/opt/jdk1.7.0_79/jre/lib/i386/client -ljvm -L/opt/R-3.0.1/lib -lR

make[2]: Leaving directory `/tmp/RJRECONF.FOhjZn'

Java library path: $(JAVA_HOME)/jre/lib/i386/client

JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux

JNI linker flags : -L$(JAVA_HOME)/jre/lib/i386/client -ljvm

Updating Java configuration in /opt/R-3.0.1

Done.

make[1]: Leaving directory `/opt/R-3.0.1'

[root@hadoop0 R-3.0.1]# make install 

[root@hadoop0 R-3.0.1]

配置环境变量

JAVA_HOME=/opt/jdk1.7.0_79

STORM_HOME=/opt/bigdata/stomr096

HIVE_HOME=/opt/bigdata/hive2.0

HADOOP_HOME=/opt/bigdata/hadoop272

HBASE_HOME=/opt/bigdata/hbase-1.1.5

R_HOME=/usr/R-3.0.1/lib/R/bin

PATH=$PATH:$JAVA_HOME/bin:$STORM_HOME/bin:$HIVE_HOME/bin:$HADOOP_HOME/bin:$HBASE_HOME/bin:$R_HOME

export JAVA_HOME STORM_HOME HIVE_HOME HADOOP_HOME HBASE_HOME

export PATH

/.bash_profile" 30L, 744C written

[root@hadoop0 R-3.0.1]# source ~/.bash_profile 

[root@hadoop0 R-3.0.1]# R

R version 3.0.1 (2013-05-16) -- "Good Sport"

Copyright (C) 2013 The R Foundation for Statistical Computing

Platform: i686-pc-linux-gnu (32-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.



 

错误解决方案:

1)make: Warning: File `/usr/src/linux-2.6.35.7-nanosg20/arch/arm/Makefile' has modification time 3.4e+08 s in the f

修改系统时间与server同步:date -s '13:49:00 2014-01-18' 

2)./configure 报错
   configure: error: No F77 compiler found 
   解决方法:
   yum install gcc-gfortran

3)./configure 报错
  configure: error: --with-readline=yes (default) and headers/libs are not available
   解决方法:
  yum install  readline-devel
 
4)./configure 报错
  configure: error: --with-x=yes (default) and X11 headers/libs are not available 
  解决方法:
   yum install libXt-devel

5)./configure 报错 
  configure: error: C++ preprocessor "/lib/cpp" fails sanity check
  解决方法:
 yum install gcc-c++  glibc-headers
 

猜你喜欢

转载自gaojingsong.iteye.com/blog/2323844