GNU bug report logs - #69737
GSL cannot find CBLAS symbols

Previous Next

Package: guix;

Reported by: Artyom Bologov <mail <at> aartaka.me>

Date: Mon, 11 Mar 2024 22:47:01 UTC

Severity: normal

To reply to this bug, email your comments to 69737 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#69737; Package guix. (Mon, 11 Mar 2024 22:47:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Artyom Bologov <mail <at> aartaka.me>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 11 Mar 2024 22:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Artyom Bologov <mail <at> aartaka.me>
To: bug-guix <at> gnu.org
Subject: GSL cannot find CBLAS symbols
Date: Tue, 12 Mar 2024 02:06:28 +0400
[Message part 1 (text/plain, inline)]
Hi y'all,

I'm working on Guile bindings for GNU Scientific Library (GSL), and I
encountered a bug: GSL cannot find CBLAS functions when invoked directly
from Guile.

I'm attaching a script, gslcblas.scm, ran (given that you replace the
path to libgsl.so in it with a machine-specific one) with

guile gslcblas.scm

[gslcblas.scm (text/plain, attachment)]
[Message part 3 (text/plain, inline)]
It errors out with

guile: symbol lookup error: [...]/libgsl.so: undefined symbol: cblas_dscal

Loading libgslcblas.so into the Scheme image doesn't help, it errors out
the same. That's why I'm thinking it's not a Guile Scheme problem, but a
library one: GSL C code breaks with no knowledge of CBLAS.

The suggested fix is to link libgsl.so against libgslcblas.so (or any
other CBLAS library?), so that the functions from the latter are
available in the former. that seems to be what Arch package does
(https://archlinux.org/packages/extra/x86_64/gsl/), at least. Although I
admit this is a strange circular behavior, it makes sense too: CBLAS is
an implementation detail for BLAS support in GSL, and should be linked
as such.

I'm not knowledgeable enough in the ways of building GSL (or any complex
C software really), so I cannot come up with a proper patch. Hopefully
that's enough info for someone to act on.

Acknowledgements: Huge thanks to Arun Isaac who helped me debug this
problem!

Thanks,
--
Artyom Bologov.

Information forwarded to bug-guix <at> gnu.org:
bug#69737; Package guix. (Tue, 12 Mar 2024 22:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 69737 <at> debbugs.gnu.org (full text, mbox):

From: Artyom Bologov <mail <at> aartaka.me>
To: 69737 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: GSL cannot find CBLAS symbols
Date: Wed, 13 Mar 2024 02:22:14 +0400
CC-ing Arun Isaac to keep him in the loop.
--
Artyom.




Information forwarded to bug-guix <at> gnu.org:
bug#69737; Package guix. (Wed, 13 Mar 2024 00:16:02 GMT) Full text and rfc822 format available.

Message #11 received at 69737 <at> debbugs.gnu.org (full text, mbox):

From: Richard Sent <richard <at> freakingpenguin.com>
To: Artyom Bologov <mail <at> aartaka.me>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, 69737 <at> debbugs.gnu.org
Subject: Re: bug#69737: GSL cannot find CBLAS symbols
Date: Tue, 12 Mar 2024 20:14:30 -0400
Hi Artyom,

I found your code ran when I added

--8<---------------cut here---------------start------------->8---
(define libcblas
  ;; Your store path may differ
  (load-foreign-library "/gnu/store/dzx94b3xv4h1ik1bfrbxaw7n84y9r8zz-gsl-2.7.1/lib/libgslcblas.so"
                        #:global? #t))
--8<---------------cut here---------------end--------------->8---

before (define libgsl ...)

> If global? is true, symbols defined by the loaded library will be
> available when other modules need to resolve symbols; the default is
> #f, which keeps symbols local.
https://www.gnu.org/software/guile/manual/html_node/Foreign-Libraries.html

I have not tested if the calculation is correct.

-- 
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.




Information forwarded to bug-guix <at> gnu.org:
bug#69737; Package guix. (Wed, 13 Mar 2024 21:13:02 GMT) Full text and rfc822 format available.

Message #14 received at 69737 <at> debbugs.gnu.org (full text, mbox):

From: Artyom Bologov <mail <at> aartaka.me>
To: Richard Sent <richard <at> freakingpenguin.com>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, 69737 <at> debbugs.gnu.org,
 Artyom Bologov <mail <at> aartaka.me>
Subject: Re: bug#69737: GSL cannot find CBLAS symbols
Date: Thu, 14 Mar 2024 01:09:45 +0400
Hi Richard!

Thanks a lot, that solved it! I guess no actionable things for this
issue anymore. Sorry for the false lead on GSL 😅

--
Artyom.




This bug report was last modified 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.