1

When I try to install igraph via R-Studio using the command install.package("igraph"). At the end of the install I get this message:

 gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H   /r-base-3.6.3=. -fstack-protector-strong  -c AMD/Source/amd.f -o AMD/Source/amd.o
  /bin/bash: gfortran: command not found
  /usr/lib/R/etc/Makeconf:191: recipe for target 'AMD/Source/amd.o' failed
  make: *** [AMD/Source/amd.o] Error 127
 ERROR: compilation failed for package ‘igraph’
* removing ‘/home/luis/R/x86_64-pc-linux-gnu-library/3.6/igraph’
Warning in install.packages :
 installation of package ‘igraph’ had non-zero exit status

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


SessionInfo()
   R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3   
Phil
  • 7,287
  • 3
  • 36
  • 66
Lou_A
  • 249
  • 1
  • 11
  • Is gfortran installed? type in the terminal `gfortran --version` – user20650 Apr 28 '20 at 23:24
  • 1
    *"gfortran: command not found"* indicates that you do not have a compiler. I don't know which linux you have, but you'll need to go one to one of [CRAN's mirrors](https://cran.r-project.org/mirrors.html), click *"Download R for Linux"*, choose your specific distro, and follow those directions. – r2evans Apr 28 '20 at 23:24
  • Could you please show the results of `sessionInfo()` in your question. – G5W Apr 28 '20 at 23:25
  • I just posted the sessionInfo() information at the end of the original post. Thank you. – Lou_A Apr 28 '20 at 23:31
  • I just checked. I don't seem to have gfortran. – Lou_A Apr 28 '20 at 23:33
  • okay then install it . Try `sudo apt-get install gfortran` then restart R and try to install igraph again – user20650 Apr 28 '20 at 23:34
  • You might consider `apt-get install r-base-dev`, which includes several dependencies for compiling R packages/dependencies (including `gfortran`). While I believe it's really just a meta-package for compilers and such, it might be preemptive to get other stuff, too. – r2evans Apr 28 '20 at 23:42
  • I'll try that. I installed gfortran, but now igraph is asking for two other dependencies llapack and lblas – Lou_A Apr 28 '20 at 23:44
  • okay; looks like something is messed up. follow r2's advice. relevant https://stackoverflow.com/questions/6302209/building-r-package-and-error-ld-cannot-find-lgfortran – user20650 Apr 28 '20 at 23:45
  • I tried reinstalling R, but it recognized that I have the latest version. I'm going to try to uninstall it and reinstall R. – Lou_A Apr 29 '20 at 00:58

1 Answers1

1

igraph has a very nice Troubleshooting guide that can probably help.

With a similar error, what worked for me was, in a Terminal:

sudo apt install build-essential gfortran
Gorka
  • 3,555
  • 1
  • 31
  • 37