From unknown Sun Aug 10 08:59:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69737: GSL cannot find CBLAS symbols Resent-From: Artyom Bologov Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 11 Mar 2024 22:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69737 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 69737@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171019720311644 (code B ref -1); Mon, 11 Mar 2024 22:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Mar 2024 22:46:43 +0000 Received: from localhost ([127.0.0.1]:41448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjoPq-00031i-RZ for submit@debbugs.gnu.org; Mon, 11 Mar 2024 18:46:43 -0400 Received: from lists.gnu.org ([209.51.188.17]:52230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjoPn-00031X-23 for submit@debbugs.gnu.org; Mon, 11 Mar 2024 18:46:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjoPD-0006VX-44 for bug-guix@gnu.org; Mon, 11 Mar 2024 18:46:03 -0400 Received: from mta-09-4.privateemail.com ([198.54.127.118]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjoPA-00035V-DD for bug-guix@gnu.org; Mon, 11 Mar 2024 18:46:02 -0400 Received: from mta-09.privateemail.com (localhost [127.0.0.1]) by mta-09.privateemail.com (Postfix) with ESMTP id C885818000B6 for ; Mon, 11 Mar 2024 18:45:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aartaka.me; s=default; t=1710197152; bh=vtWPOSGGZuvtmkWg3gsIHTMBPClSVeECYNCSdJam5O4=; h=From:To:Subject:Date:From; b=ekcmEeertkkuMHvwbSxyZ1Dd+QQV+4kIqp7BGbJpMtuzo+SMPmiCgAwAJFw/cbTRc vrGhTyuNd7g3C+ITXjp6URWNTDaEnPcIu53Zxlp1/gFtd+2YR4IpDVYsvOlCtC+Xks JnGye4Y/8ODPKzWa7ec3h9swysa6Gt/yckueOF5NmoW5GXnBb36DIBtpPX/pgbOxT2 WdmGSy4Q01d0ycbbH0IwZTNgZ+hUlVeNI4TlyCz8w8Uxyer4T4oTqrURLgbcJ69mNc V9q68f8sf/jOnLdg38+y0b56zEnGKAT7LzUkNrYz/zspy0R1MWTgOVJpMHi3Uf42qx QnWkN+DXuWD+g== Received: from paranoidal (unknown [185.167.217.34]) by mta-09.privateemail.com (Postfix) with ESMTPA for ; Mon, 11 Mar 2024 18:45:51 -0400 (EDT) User-agent: mu4e 1.10.8; emacs 29.1 From: Artyom Bologov Date: Tue, 12 Mar 2024 02:06:28 +0400 Message-ID: <87edcgqtfw.fsf@aartaka.me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Virus-Scanned: ClamAV using ClamSMTP Received-SPF: pass client-ip=198.54.127.118; envelope-from=mail@aartaka.me; helo=MTA-09-4.privateemail.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URI_NOVOWEL=0.5 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=gslcblas.scm Content-Description: Scheme file with buggy GSL behavior (use-modules (system foreign) (system foreign-library)) (define libgsl (load-foreign-library "/gnu/store/zfxs8xbh68nb8smvsdf9i6aj6hbzgix4-profile/lib/libgsl.so")) (define gsl-vector-alloc (foreign-library-function libgsl "gsl_vector_alloc" #:return-type '* #:arg-types (list size_t))) (define gsl-vector-set (foreign-library-function libgsl "gsl_vector_set" #:return-type void #:arg-types (list '* size_t double))) (define gsl-vector-get (foreign-library-function libgsl "gsl_vector_get" #:return-type double #:arg-types (list '* size_t))) (define gsl-blas-dscal (foreign-library-function libgsl "gsl_blas_dscal" #:return-type void #:arg-types (list double '*))) (let* ((n 3) (x (gsl-vector-alloc n))) (for-each (lambda (i) (gsl-vector-set x i i)) (iota n)) (gsl-blas-dscal 10 x)) --=-=-= Content-Type: text/plain 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. --=-=-=-- From unknown Sun Aug 10 08:59:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69737: GSL cannot find CBLAS symbols References: <87edcgqtfw.fsf@aartaka.me> In-Reply-To: <87edcgqtfw.fsf@aartaka.me> Resent-From: Artyom Bologov Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 12 Mar 2024 22:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69737 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 69737@debbugs.gnu.org Cc: Arun Isaac Received: via spool by 69737-submit@debbugs.gnu.org id=B69737.17102822813287 (code B ref 69737); Tue, 12 Mar 2024 22:25:02 +0000 Received: (at 69737) by debbugs.gnu.org; 12 Mar 2024 22:24:41 +0000 Received: from localhost ([127.0.0.1]:43991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkAY5-0000qx-By for submit@debbugs.gnu.org; Tue, 12 Mar 2024 18:24:41 -0400 Received: from mta-15-3.privateemail.com ([198.54.122.111]:14501) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkAXz-0000qc-SV for 69737@debbugs.gnu.org; Tue, 12 Mar 2024 18:24:39 -0400 Received: from mta-15.privateemail.com (localhost [127.0.0.1]) by mta-15.privateemail.com (Postfix) with ESMTP id 87B1B18000BB; Tue, 12 Mar 2024 18:23:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aartaka.me; s=default; t=1710282234; bh=rk4tNPkZmT9aYY9h9uxngeVOBjqdTl69ko9R5xmbQzk=; h=From:To:Subject:Date:CC:From; b=zDbWIYyGzWbKNhDNIjjN7D/DJ1t/NTENumWwxg5qilv5omNbM+7NTVP9IHu3bG8kM i3PFFA2bHVjL0eCTql51XYrO3smQfCFanvX5oP+3vm5TywtTjPwtK40cncRaLrDrKk turQl3qrNmwzOO10DATnqQHN7sAMRrvdv+gl3Cysq+tC6ws541rK93kRvdeX/zdKdF X+BsROZ+VZrtfS7lGijz9UOwb6aaPbaSVsF2PtaXC5cdaTMh3cfbXKvRiA0eJnF26G LRgbkVSSWi9zpqX0dEFah8MELIJT5+qOwQzH6P4CEvLbHaS7bvBEqCkSQ/BkIBmxEB CHSRbowv7jirg== Received: from paranoidal (unknown [185.167.217.34]) by mta-15.privateemail.com (Postfix) with ESMTPA; Tue, 12 Mar 2024 18:23:52 -0400 (EDT) User-agent: mu4e 1.10.8; emacs 29.1 From: Artyom Bologov Date: Wed, 13 Mar 2024 02:22:14 +0400 Message-ID: <87le6ndr92.fsf@aartaka.me> MIME-Version: 1.0 Content-Type: text/plain X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) CC-ing Arun Isaac to keep him in the loop. -- Artyom. From unknown Sun Aug 10 08:59:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69737: GSL cannot find CBLAS symbols Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 13 Mar 2024 00:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69737 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Artyom Bologov Cc: Arun Isaac , 69737@debbugs.gnu.org Received: via spool by 69737-submit@debbugs.gnu.org id=B69737.171028892914813 (code B ref 69737); Wed, 13 Mar 2024 00:16:02 +0000 Received: (at 69737) by debbugs.gnu.org; 13 Mar 2024 00:15:29 +0000 Received: from localhost ([127.0.0.1]:44180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkCHI-0003qr-SV for submit@debbugs.gnu.org; Tue, 12 Mar 2024 20:15:29 -0400 Received: from mail-108-mta77.mxroute.com ([136.175.108.77]:41735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkCHE-0003qe-JD for 69737@debbugs.gnu.org; Tue, 12 Mar 2024 20:15:28 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta77.mxroute.com (ZoneMTA) with ESMTPSA id 18e352957160003bea.002 for <69737@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 13 Mar 2024 00:14:45 +0000 X-Zone-Loop: 3ae594be2e85369816fce9c41df841200130cc523bc4 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2jQm9zGYLz/2VtpbYKop+tiqKT2LIUsahsoa+Y9HEr0=; b=C3kspIYEgfnK4maF5VP6LgyzzI jPSPBY8bNrmXm+DTQCDn8Ajv3Qfomjs7ScupKnnJU9DrcJbJLCIl5owGZk2eadz4RSIEPPxWLCbH/ uOT37mXwCeYTR0CGTRSTRGDkc41UptJ7gOhBXrTsTvYH3ICOFK8k6NI5R4IkPl6AnSG4mnWOK5Cga ZqvhBhAaKjWE1tgTeYmBVSznfCDBoYyJ+16vU8WjW3lyI2s6Y70c7NoKSkLp7QFhOt7FQKCVKtny+ EMmIvEazkeYfqZHF9s+iX4pMx59Sd8Rfj69ekGM9rQG8VbrTcl2s4gBKB6AK/lXbMUWfxC0O3uDyg piyWBOcw==; From: Richard Sent In-Reply-To: <87le6ndr92.fsf@aartaka.me> (Artyom Bologov's message of "Wed, 13 Mar 2024 02:22:14 +0400") References: <87edcgqtfw.fsf@aartaka.me> <87le6ndr92.fsf@aartaka.me> Date: Tue, 12 Mar 2024 20:14:30 -0400 Message-ID: <87bk7j0yzd.fsf@freakingpenguin.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) 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. From unknown Sun Aug 10 08:59:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69737: GSL cannot find CBLAS symbols Resent-From: Artyom Bologov Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 13 Mar 2024 21:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69737 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Richard Sent Cc: Arun Isaac , 69737@debbugs.gnu.org, Artyom Bologov Received: via spool by 69737-submit@debbugs.gnu.org id=B69737.171036435032228 (code B ref 69737); Wed, 13 Mar 2024 21:13:02 +0000 Received: (at 69737) by debbugs.gnu.org; 13 Mar 2024 21:12:30 +0000 Received: from localhost ([127.0.0.1]:47527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkVtm-0008Nk-Fn for submit@debbugs.gnu.org; Wed, 13 Mar 2024 17:12:30 -0400 Received: from mta-07-3.privateemail.com ([198.54.118.214]:15932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkVtj-0008NV-Ft for 69737@debbugs.gnu.org; Wed, 13 Mar 2024 17:12:29 -0400 Received: from mta-07.privateemail.com (localhost [127.0.0.1]) by mta-07.privateemail.com (Postfix) with ESMTP id B18E818000B8; Wed, 13 Mar 2024 17:11:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aartaka.me; s=default; t=1710364305; bh=B4IqDdd1vw+6I7+4oEwedxo4SOSiSo9BlukQT5CAiC0=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=lHuruhMRzsjL0wSlgsrebUTvlazeYfiZTZScuniWm3NnQfs7u6J7ypamRFqvo0pho MkEXwMC8cfcnncXvxniWIRx8wUc1BSpqbGwCdj71UgX8SNQZNugg7dCJ21m+iPuZOz x0mgAIPLGLz1DvBivCmgTZvmEDDfTDSl63Ny9GkGTJOBS6MHpA3rYmjByWaeKc6TD/ ogT3eUKMz1kAfRbkmjdzpkCkMAAQ9fVSEDL4GT2llKReC/b9kzmtHoiQmynRkyT+48 mCJmL30cuq9HkJQnpGbKiltK4pp8zF95E5sodYXTToO4Z2AP49+IDDdrdz0xXTxEzo 8e5nyaHIUfrwg== Received: from paranoidal (unknown [185.167.217.34]) by mta-07.privateemail.com (Postfix) with ESMTPA; Wed, 13 Mar 2024 17:11:40 -0400 (EDT) References: <87edcgqtfw.fsf@aartaka.me> <87le6ndr92.fsf@aartaka.me> <87bk7j0yzd.fsf@freakingpenguin.com> User-agent: mu4e 1.10.8; emacs 29.1 From: Artyom Bologov Date: Thu, 14 Mar 2024 01:09:45 +0400 In-reply-to: <87bk7j0yzd.fsf@freakingpenguin.com> Message-ID: <87y1alalcz.fsf@aartaka.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Richard! Thanks a lot, that solved it! I guess no actionable things for this issue anymore. Sorry for the false lead on GSL =F0=9F=98=85 -- Artyom.