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

本文详细介绍了如何在本地机器上安装R-2.6.2版本,面对安装过程中遇到的“找不到F77编译器”的错误时,通过修改配置文件并应用补丁来解决问题,并最终完成R的正确链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
    

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值