在Ubuntu上编译安装R
2013年02月17日 4 Comments
R is a free software environment for statistical computing and graphic.
在Ubuntu上编译安装时有几个小问题,记录在此备查:
1.需要fortran compiler
下载完源码,解压后直接执行
./configure –prefix=/xxx –enable-R-shlib
报错:configure: error: No F77 compiler found
这是因为Ubuntu现在默认没有fortran编译器,需要手工装一个,比如gfortran:
sudo apt-get install gfortran
当然,编译还需要gcc等工具
sudo apt-get install build-essential
2.需要readline
如果系统中没有readline,继续configure还是报错:
configure: error: –with-readline=yes (default) and headers/libs are not available
两个选择,要么使用–with-readline=no去掉对readline的依赖,要么装一个:
sudo apt-get install readline-devel
3. 需要X11的headers/libs
继续configure,继续报错:
configure: error: –with-x=yes (default) and X11 headers/libs are no t available
好吧,缺的东西还真不少,还是两个选择,要么–with-x=no,要么把缺失的依赖补上:
sudo apt-get install libxt-dev
搞定, ./configure && make && make install,收工
$ ./R
R version 2.15.2 (2012-10-26) — “Trick or Treat”
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-linux-gnu (64-bit)R是自由软件,不带任何担保。
在某些条件下你可以将其自由散布。
用’license()’或’licence()’来看散布的详细条件。R是个合作计划,有许多人为之做出了贡献.
用’contributors()’来看合作者的详细情况
用’citation()’会告诉你如何在出版物中正确地引用R或R程序包。用’demo()’来看一些示范程序,用’help()’来阅读在线帮助文件,或
用’help.start()’通过HTML浏览器来看帮助文件。
用’q()’退出R.
偷懒的话,也可以直接安装编译好的包了,版本可能不是最新而已:
sudo apt-get install r-base
参考:http://rwiki.sciviews.org/doku.php?id=getting-started:installation:debian
又研究R语言了啊
有点复杂啊
不错 留个脚印 收藏了
问下这书勘误表在那能看到?