Can't find gfortran 4.8 to build package

前端 未结 4 1939
后悔当初
后悔当初 2021-02-14 07:31

I\'m trying to install the deldir package in R via install.packages(\"deldir\",type = \'source\') but am getting the following error message (this is O

4条回答
  •  误落风尘
    2021-02-14 07:56

    I was using a linux machine and RStudio server. I had a similar problem. I knew already that gfortran was on the machine thanks to the system administrator.

    To solve, in the shell, I typed which gfortran, which gave me a path.

    Then, following this SO posting, I entered the following in the shell to create a new Makevars file

    # create a file called ~/.R/Makevars:

    mkdir -p ~/.R touch ~/.R/Makevars

    Then, in that new file, I wrote the following

    F77 = /usr/local/bin/gfortran #this was the path that I got from typing which gfortran in the shell

    FC = $F77

    FLIBS = -L/usr/local/bin/gfortran

    From there, I was able to install the package that wasn't compiling properly (in my case vegan instead of igraph using install.packages("vegan")

提交回复
热议问题