4

I am trying to install the package caret in R for sometime now, and I am getting this error message:

*installing *source* package ‘minqa’ ...
** package ‘minqa’ successfully unpacked and MD5 sums checked
** libs
gfortran   -fpic  -g -O2  -c altmov.f -o altmov.o
make: gfortran: Command not found
make: *** [altmov.o] Error 127
/usr/lib64/R/etc/Makeconf:155: recipe for target 'altmov.o' failed
ERROR: compilation failed for package ‘minqa’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/minqa’
Warning in install.packages :
  installation of package ‘minqa’ had non-zero exit status
* installing *source* package ‘SparseM’ ...
** package ‘SparseM’ successfully unpacked and MD5 sums checked
** libs
gfortran   -fpic  -g -O2  -c bckslv.f -o bckslv.o
make: gfortran: Command not found
/usr/lib64/R/etc/Makeconf:155: recipe for target 'bckslv.o' failed
make: *** [bckslv.o] Error 127
ERROR: compilation failed for package ‘SparseM’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/SparseM’
Warning in install.packages :
  installation of package ‘SparseM’ had non-zero exit status
ERROR: dependency ‘minqa’ is not available for package ‘lme4’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/lme4’
Warning in install.packages :
  installation of package ‘lme4’ had non-zero exit status
ERROR: dependency ‘SparseM’ is not available for package ‘quantreg’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/quantreg’
Warning in install.packages :
  installation of package ‘quantreg’ had non-zero exit status
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/pbkrtest’
Warning in install.packages :
  installation of package ‘pbkrtest’ had non-zero exit status
ERROR: dependencies ‘pbkrtest’, ‘quantreg’ are not available for package ‘car’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/car’
Warning in install.packages :
  installation of package ‘car’ had non-zero exit status
ERROR: dependency ‘car’ is not available for package ‘caret’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/caret’
Warning in install.packages :
  installation of package ‘caret’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpVBZAgE/downloaded_packages’

Now according to some of the post, I tried to install minqa,SparseM, lme4,car ... separately. Its not installing properly. The main problem that I suspect is the absence of gfortran library in my archlinux. I tried to find the package gfortran in arch repository using pacman. It is not present there, so in the end I am just stuck. Does anybody has a solution or faced this problem before. Thanks.

milos.ai
  • 3,882
  • 7
  • 31
  • 33
motiur
  • 1,640
  • 9
  • 33
  • 61
  • 1
    You need to install a fortran compiler: `make: gfortran: Command not found`. I am not sure what it is called in Arch linux, but you might find it associated with the gcc suite: gcc-fortran or something like that. – lmo May 20 '16 at 19:04
  • For Ubuntu Users out there, This can be installed via [https://askubuntu.com/questions/358907/how-do-i-install-gfortran](https://askubuntu.com/questions/358907/how-do-i-install-gfortran) – Gaurav Mar 31 '21 at 05:48

1 Answers1

6

I had a similar problem. For anyone else with this problem this is the package you need to install. It is gcc-fortran 6.2.1-1

To install it:

sudo pacman -S gcc-fortran

https://www.archlinux.org/packages/core/x86_64/gcc-fortran/

G_T
  • 1,555
  • 1
  • 18
  • 34