LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-31-2020, 12:35 AM   #1
centguy
Member
 
Registered: Feb 2008
Posts: 635
Blog Entries: 1

Rep: Reputation: 48
linking with shared object. Can we use -L?


This is working:

Quote:

gfortran -fPIC -ffree-line-length-0 -o fm-forces types_and_constants.o sgsym.o commod.o fm-forces.f90 /usr/lib64/liblapack.so.3 /usr/lib64/libblas.so.3
But then

this is not working:

Quote:

gfortran -fPIC -ffree-line-length-0 -o fm-forces types_and_constants.o sgsym.o commod.o fm-forces.f90 -L/usr/lib64 -llapack -lblas
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
make: *** [Makefile:33: fm-forces] Error 1

So I am forced to use the full path to each of the .so.x object?

If it is .a, then -L"path-to-lapack-blas" -llapack -lblas
will just work.

Such an embarassing question...
 
Old 08-31-2020, 01:13 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,078

Rep: Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364
most probably you need to use *.so files with -l, *.so.3 (or similar) will not be found. The usual solution is to create a symbolic link. Also -L/usr/lib64 is usually not required.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
data sharing between c++ shared object and Fortran shared object Madhubala Debian 2 08-19-2011 02:22 AM
"Unresolved reference" errora while doing dynamic Linking of C++.so (shared object) micropanther Programming 10 04-19-2011 06:59 AM
[SOLVED] How to build a shared object from other libraries (linking statically)? eantoranz Programming 4 10-26-2007 12:19 PM
Shared object library that uses another shared object library Nightfox Programming 1 02-15-2006 10:00 PM
error while loading shared libraries: libdb-4.1.so: cannot open shared object file putquery8581 Linux - Software 1 10-01-2004 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration