Installation fails: /usr/bin/ld: cannot find -lgfortran

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)

Installation fails: /usr/bin/ld: cannot find -lgfortran

Postby Klausb » Sat Oct 07, 2017 5:31 pm

Hello,

I have been trying to install magma on Ubuntu 16.04 with cuda-9.0, gcc/g++ 6.3 and gfortran

The problem is, the installation fails due to: /usr/bin/ld: cannot find -lgfortran

-lgfortran usually refers to the shared library libgfortran.so which is not in /usr/bin, there's the gfortran binary

libgfortran.so is a link in /usr/lib/gcc/x86_64-linux-gnu/5

libgfortran.so.3 is a link in /usr/lib/x86_64-linux-gnu

libgfortran.so.3.0.0 is the actual shared library in /usr/lib/x86_64-linux-gnu

I added -L$/usr/lib/gcc/x86_64-linux-gnu/5 in make.inc

Code: Select all
LIBDIR    = -L$(CUDADIR)/lib64 \
            -L$(MKLROOT)/lib/intel64 \
            -L$/usr/lib/x86_64-linux-gnu


AND even copied libgfortran.so.3.0.0 to /usr/bin

But nothing had an effect.

error...

Code: Select all
magmablas/dsyrk_vbatched.o magmablas/cherk_vbatched.o magmablas/csyr2k_vbatched.o magmablas/csyrk_vbatched.o magmablas/strmm_vbatched.o magmablas/dtrmm_vbatched.o magmablas/ctrmm_vbatched.o magmablas/strsm_vbatched.o magmablas/dtrsm_vbatched.o magmablas/ctrsm_vbatched.o magmablas/spotf2_kernels_var.o magmablas/dpotf2_kernels_var.o magmablas/cpotf2_kernels_var.o \
   -L./lib -L/usr/local/cuda-9.0/lib64 -L/opt/intel/mkl/lib/intel64 -Lusr/lib/x86_64-linux-gnu -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lstdc++ -lm -lgfortran -lcublas -lcusparse -lcudart -lcudadevrt
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
Makefile:605: die Regel für Ziel „lib/libmagma.so“ scheiterte
make: *** [lib/libmagma.so] Fehler 1



How should I add the library path for libgfortran.so to make.inc so the compiler finds it during compilation?

Klaus
Klausb
 
Posts: 18
Joined: Thu Oct 05, 2017 3:04 pm

Solved: Installation fails: /usr/bin/ld: cannot find -lgfort

Postby Klausb » Sun Oct 08, 2017 6:22 am

just for the record, the problem was caused by a mismatch of gcc/g++ <> gfortran compiler versions, updating gfortran is the fix
Klausb
 
Posts: 18
Joined: Thu Oct 05, 2017 3:04 pm


Return to User discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron