-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
The problem
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 usex86_64-conda_cos6-linux-gnu-gfortraninstead ofgfortran. Use the-fno-ltooption in the linking step, otherwise the linking step hangs. - OR: install Ubuntu's
gfortran-7withsudo apt install gfortran-7and use that. - OR: use gfortran 9 and statically link libgfortran with the option
-static-libgfortranin the linking step. - OR: use gfortran 9 and temporarily rename conda's
<path to anaconda>/lib/libgfortran.soto 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 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels