Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/bin/ld: cannot find -llapack

Tags:

linux

I am seeking help for installation in ubuntu 14.04. I am installing a package in my pc. They have their makefiles. I have to run make.

When I did I found error like.....

gfortran -O2 -fopenmp -msse2 -o nmbnd.run p_nmbnd.o i_main.o m_getwsr.o ../IOLIB/*.o ../ATOM/*.o ../BNDASA/*.o ../EXTENS/*.o ../FINDES/*.o ../LATTICE/*.o ../SAMPLE/*.o ../TETRA/*.o ../IOCTRL/*.o ../LMIO/*.o ../MAINA/*.o ../NMTO/*.o ../SYM/*.o ../TBSTR/*.o ../CHAPOT/*.o  -L/usr/share/doc/liblapack -llapack -L/usr/share/doc/libblas -lblas  /usr/bin/ld: cannot find -llapack /usr/bin/ld: cannot find -lblas collect2: error: ld returned 1 exit status make[2]: *** [nmbnd.run] Error 1 make[2]: Leaving directory `/home/santuphys/NMTO-47.ZB.28/06.gfort/MAIN' make[1]: *** [cleanmake] Error 2 make[1]: Leaving directory `/home/santuphys/NMTO-47.ZB.28/06.gfort/MAIN' make: *** [ooo.dep] Error 2 

I tried all the other similar questions in this forum about link, but I could not resolve it. I specified the path to Lapack and Lblas in my pc also writing...

LAPACK_LIB=   -L/usr/lib/ -llapack  -lblas 

It did not work. Please help me with this issue.

Thanks in advance.

like image 488
Leostorm10 Avatar asked Nov 20 '14 06:11

Leostorm10


People also ask

What is Lpthread?

Pthread.h header file is included in the posix thread program but you need -lpthread while compiling because it links it with the library of pthread NOTE: -lpthread -lpcap all are the switches with gcc compiler that can link particular library in our source code. ( lpthread means "link pthread" library)

How do you resolve usr bin Ld Cannot find?

“/usr/bin/ld cannot find -lltdl” Error and Solution The “/usr/bin/ld cannot find -lltdl” error is related to the C development library named ltdl-dev . So installing the libtdl-dev can resolve this error.

What is LD command in Linux?

Description. The ld command, also called the linkage editor or binder, combines object files, archives, and import files into one output object file, resolving external references. It produces an executable object file that can be run.


2 Answers

On Ubuntu 14.04 make sure you have the packages

  • liblapack-dev
  • liblapack3
  • libopenblas-base
  • libopenblas-dev

installed. After that, "-L/usr/lib -llapack -lblas" should work. Also note that, as already mentioned in another answer, in the output you showed, you have "-L/usr/share/doc/liblacpack -L/usr/share/doc/libblas", which is certainly not what you want.

like image 145
janneb Avatar answered Sep 20 '22 10:09

janneb


Just install packages that contain liblapack.so.* and libblas.so.* libraries. If you are sure that those packages are already installed - just find them by: find / -name 'liblapack*' and add that path to gcc with -L/path/to/liblapack.

edit: In your invocation of fortran compiler there are some directories given with -L - but are you sure that needed libraries are located in documentation directories: -L/usr/share/doc/liblapack -L/usr/share/doc/libblas ?

like image 25
user2699113 Avatar answered Sep 19 '22 10:09

user2699113