Can't find gfortran 4.8 to build package

前端 未结 4 1941
后悔当初
后悔当初 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:50

    I found a solution here: https://support.rstudio.com/hc/communities/public/questions/201688563-Problem-with-Mac-Yosemite-Beta-and-RStudio-not-finding-TeX-distribution

    It turns out that Adam Maxwell noted that Yosemite beta has a significant bug in passing environment variables to subprocesses.

    After installing gfortran as in OS X package installation depends on gfortran-4.8 .

    This works: create an alias in your .bash_profile

    alias fixrs="launchctl setenv PATH /usr/texbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
    

    Then close and open the terminal.

    And execute the fixrs command in the terminal before launching RStudio.

    Then I could build igraph successfully.

    0 讨论(0)
  • 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")

    0 讨论(0)
  • 2021-02-14 07:58

    I was getting the same error when installing the igraph package in R on Manjaro Linux.

    It was due to the absence of a Fortran compiler (gfortran I think). I found out that gfortran package is named as gcc-fortran in Manjaro repo and many other (GNU) Linux repos. So, I just installed gcc-fortran package and then restarted RStudio and igraph package installed without any issues.

    0 讨论(0)
  • 2021-02-14 08:04

    I had your same problem (in OS X Yosemite), and (unfortunately) painstakingly recreated your symlink "partial solution". Finally, I was able to solve the issue by forgetting about linking or aliasing and just downgrading to gfortran-4.8.

    I had installed the newer version with brew, so for me this entailed uninstalling

    brew uninstall gcc
    

    and then following the instructions here to install 4.8.2, i.e.

    curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
    sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /
    

    It still threw up some warnings but at least I got a successful installation of deldir, which I needed to run pgirmess.

    0 讨论(0)
提交回复
热议问题