关闭

linux下R安装会遇到问题以及解决方法

标签: linuxfortrancompilergcccommandpatch
3299人阅读 评论(0) 收藏 举报
分类:

How to install R on a local machine, the problems faced and troubleshooting

  1. Download the tarball of R-2.6.2 from  http://www.icewalkers.com/Linux/Software/530020/R.html onto your local machine, for eg: ~/dist/R-2.6.2.tar.gzR-2.6.2 is the version currently in use by SSG
  1. unpack it with
       ~src>tar xvfz ~/dist/R-2.6.2.tar.gz
    
  2. cd to R-2.6.2
  3. Read the INSTALL text file, the first instruction is to do
       ./configure
    
  4. Will get an error for the above command
       configure: error: No F77 compiler found 
    
  5. R requires Fortran compiler. Our desktop machines do have a Fortran compiler (gcc42-fortran). If your desktop machine does not have it, go to Yast and search for Fortran. Select gcc42-fortran and install
  6. So we need to change the search variable in R-2.6.2/.configure file to accept the fortran compiler we have. Apply the patch below in order to do this
  7. ~/src/R-2.6.2>patch --ignore-whitespace --backup ./configure << EOF
    6180c6180
    <            F95_compilers="f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran ftn g95"
    ---
    >            F95_compilers="f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran gcc42-fortran ftn g95"
    6192c6192
    <         3.*) GCC_Fortran_compiler=g77 ;;
    ---
    >         3.*) GCC_Fortran_compiler=gcc42-fortran ;;
    EOF
    
  8. configure with readline=no like this
       ~/src/R-2.6.2> ./configure --with-readline=no 
    
  9. Issue the following command make
  10. link the bin/R so that R can be invoked from anywhere
        ~/src/R-2.6.2> ln bin/R R
    

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:383080次
    • 积分:2505
    • 等级:
    • 排名:第14736名
    • 原创:9篇
    • 转载:31篇
    • 译文:2篇
    • 评论:66条
    文章分类
    最新评论