Issue installing igraph in Ubuntu 20.04

Hello, everyone

I have been trying to install the igraph library in Ubuntu 20.04 but I get this error:

gfortran -fno-optimize-sibling-calls -fvisibility=hidden -fpic  -g -O2  -c vendor/arpack/dgetv0.f -o vendor/arpack/dgetv0.o
Inconsistency detected by ld.so: dl-call-libc-early-init.c: 37: _dl_call_libc_early_init: Assertion `sym != NULL' failed!
make: *** [/opt/R/4.2.2/lib/R/etc/Makeconf:192: vendor/arpack/dgetv0.o] Error 127
ERROR: compilation failed for package ‘igraph’

I think it’s an issue with the fortran compiler because I got the same error with other libraries such as mclust:

gfortran -fno-optimize-sibling-calls  -fpic  -g -O2  -c dmvnorm.f -o dmvnorm.o
Inconsistency detected by ld.so: dl-call-libc-early-init.c: 37: _dl_call_libc_early_init: Assertion `sym != NULL' failed!
make: *** [/opt/R/4.2.2/lib/R/etc/Makeconf:192: dmvnorm.o] Error 127
ERROR: compilation failed for package ‘mclust’

I have gfortran installed on my machine and also all the dependencies: (gfortran --version)

GNU Fortran (Homebrew GCC 12.2.0) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

My gcc version is: (gcc --version)

gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Mi session info is:

R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.6 LTS

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

locale:
 [1] LC_CTYPE=es_MX.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=es_MX.UTF-8        LC_COLLATE=es_MX.UTF-8    
 [5] LC_MONETARY=es_MX.UTF-8    LC_MESSAGES=es_MX.UTF-8   
 [7] LC_PAPER=es_MX.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=es_MX.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_4.2.2 tools_4.2.2  

Thank you in advance for your help!

I tried also to install the igraph library directly from GitHub using devtools package devtools::install_github("igraph/rigraph") but also it didn’t work. I saw this messages I think they could be related to the error:

checking whether the compiler supports GNU Fortran... no
checking whether gfortran accepts -g... no

It was pointed out on StackOverflow that this happens due to a mismatching gfortran and gcc:

The solution is to use gcc and gfortran from the same GCC distribution. In other words, install both from Ubuntu’s default repositories.

It’s good to note that this problem is not really related to igraph. Compiling and running any Fortran program with this setup would fail.

1 Like