wiki:install-R
Last modified 9 years ago Last modified on 05/05/08 16:12:10

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.gz R-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