This is a test version of Biostars. For the public version, visit https://www.biostars.org.
plink2: no file/directory libgfortran, search has found libgfortran

I used plink2 numerous times last month and the months preceding that, however, there has been a month time since then and now when I trry to use plink2 I get this error message:

plink2: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory

however

 find ./ -iname 'libgfortran'
 ./anaconda3/pkgs/libgfortran-ng-7.2.0-hdf63c60_3/share/licenses/libgfortran
./anaconda3/pkgs/libgfortran-ng-7.5.0-hdf63c60_6/share/licenses/libgfortran
./anaconda3/share/licenses/libgfortran
./anaconda3/envs/Conda-Env-R/share/licenses/libgfortran

but

 which libgfortran
    /usr/bin/which: no libgfortran in (/storage/home/jok119/anaconda3/bin:/storage/home/jok119/anaconda3/condabin:/storage/home/jok119/perl5/bin:/storage/home/jok119/anaconda3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin export PATH=usr/bin/perl:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/storage/home/jok119/.local/bin:/storage/home/jok119/bin)

I tried uninstalling and reinstalling plink2 via

conda install plink2

and installing libgfortran

conda install libgfortran

Should be the right one: https://anaconda.org/anaconda/libgfortran/files esp since I have used plink2 before

plink genetics vcf sequencing wes

libgfortran is a library, not an executable, so which libgfortran won't give you anything - it's not in the $PATH.

Try creating a new conda environment and installing plink2 there. From my experience, I'd not recommend installing conda packages in the base environment as managing them becomes a pain sooner or later.

Ugh, yea, I should stop using base, I must have messed something up in the base env cuhz downloading plink in a new env worked. bleh. thanks so much.

1 answer

The program needs libgfortran.so.3 specifically, not libgfortran. Chances are that you updated the library and you don't have the so.3 version any more.

Try these two commands:

locate libgfortran.so.3
locate libgfortran

If you manage to locate libgfortran.so.3, you can make a symbolic link to it inside a known library directory. If you find this library but it ends in a higher number than 3, say libgfortran.so.4, go to that directory and make a symbolic link :

ln -s libgfortran.so.4 libgfortran.so.3

This won't work if you find the library that ends in a smaller number than 3.

thanks so much, really helpful in understanding and will be helpful in the future. I took the easy way out in the end (_r_am solution)

Log in to answer this question.