You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Ubuntu's gfortran 9 together with Anaconda can lead to the following error:
./a.out: error while loading shared libraries: libgfortran.so.4: cannot open shared object file: No such file or directory
This is because gfortran 9 wrongly links with the libgfortran installed in the conda environment, which is libgfortran.so.4 instead of libgfortran.so.5 that is used by gfortran 9.
Possible solutions
Use Anaconda's gfortran (version 7): install with conda install gfortran_linux-64. Anaconda's compiler tools use some non-standard names for the compiler executables: you have to use x86_64-conda_cos6-linux-gnu-gfortran instead of gfortran. Use the -fno-lto option in the linking step, otherwise the linking step hangs.
OR: install Ubuntu's gfortran-7 with sudo apt install gfortran-7 and use that.
OR: use gfortran 9 and statically link libgfortran with the option -static-libgfortran in the linking step.
Probably not a good idea: Installing gfortran-7 or libgfortran4 and using gfortran 9 also seems to solve the problem for simple examples. However then the older libgfortran.so.4 is used instead of libgfortran.so.5
The text was updated successfully, but these errors were encountered:
The problem
Using Ubuntu's gfortran 9 together with Anaconda can lead to the following error:
This is because gfortran 9 wrongly links with the libgfortran installed in the conda environment, which is
libgfortran.so.4
instead oflibgfortran.so.5
that is used by gfortran 9.Possible solutions
conda install gfortran_linux-64
. Anaconda's compiler tools use some non-standard names for the compiler executables: you have to usex86_64-conda_cos6-linux-gnu-gfortran
instead ofgfortran
. Use the-fno-lto
option in the linking step, otherwise the linking step hangs.gfortran-7
withsudo apt install gfortran-7
and use that.-static-libgfortran
in the linking step.<path to anaconda>/lib/libgfortran.so
to something else (similar to suggestion in igraph failing to compile due to missing libgfortran.so.4 (Arch based Linux) igraph/rigraph#275 (comment))Probably not a good idea: Installing
gfortran-7
orlibgfortran4
and using gfortran 9 also seems to solve the problem for simple examples. However then the olderlibgfortran.so.4
is used instead oflibgfortran.so.5
The text was updated successfully, but these errors were encountered: