bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libgsl.so is broken: it has unresolved symbols cblas_*


From: Mark Galassi
Subject: Re: libgsl.so is broken: it has unresolved symbols cblas_*
Date: Fri, 16 Oct 2020 19:55:38 -0600
User-agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu)


> /usr/local/lib/libgsl.so: undefined reference to `cblas_zher2k'
> /usr/local/lib/libgsl.so: undefined reference to `cblas_dtrsm'

Dear Yuri,

There are 2 places that make it hard to miss that your linking needs to
have both -lgsl and -lgslcblas:

The first chapter in the book is called "Using the library":

https://www.gnu.org/software/gsl/doc/html/usage.html

and it tells you to link like this:

$ gcc -L/usr/local/lib example.o -lgsl -lgslcblas -lm

The other place is if you run

pkg-config gsl --libs

or

gsl-config --libs

[maybe the bug report here is that those two give different output]

There is a reason for separating out the -lgslcblas: libgslcblas
provides a basic BLAS (basic linear algebra system), and you might want
the option of linking to another BLAS that might be more appropriate for
your situation.

So it's hard to think of this as a bug, but I would suggest that we
could improve something: if you do

man gsl

you get the section 3 man page that shows the #include, but does not
tell you how to link.  It does point you to the full reference docs, but
it might be nice to add the link line as well.

Looking at your build output it looks like you got a failure, but it
also looks like you are building in C++.  Could it be that you need to
specify C linkage in the source?

Could you provide a "minimum working example" (MWE): the simplest
possible GSL program, the "uname -a" of your operating system, the
compile and link lines you used to build it, and the error message from
that.

Then we could maybe give suggestions in how to include/link, or see if
it is a bug related to how FreeBSD does shared library linking.

Or am I missing the opint of what you're trying to say?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]