From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johan Hidding Newsgroups: gmane.lisp.guile.user Subject: Re: using GSL with cblas via FFI Date: Sat, 26 Mar 2011 10:53:52 +0100 Message-ID: References: <87y643aqns.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1301133261 19107 80.91.229.12 (26 Mar 2011 09:54:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 26 Mar 2011 09:54:21 +0000 (UTC) Cc: guile-user@gnu.org To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Mar 26 10:54:14 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q3QCD-0004MB-5u for guile-user@m.gmane.org; Sat, 26 Mar 2011 10:54:13 +0100 Original-Received: from localhost ([127.0.0.1]:40400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3QCC-00068j-Ot for guile-user@m.gmane.org; Sat, 26 Mar 2011 05:54:12 -0400 Original-Received: from [140.186.70.92] (port=37523 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3QBv-00068e-NS for guile-user@gnu.org; Sat, 26 Mar 2011 05:53:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q3QBu-0000F4-IB for guile-user@gnu.org; Sat, 26 Mar 2011 05:53:55 -0400 Original-Received: from mail-pv0-f169.google.com ([74.125.83.169]:64775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q3QBu-0000Ev-Cs; Sat, 26 Mar 2011 05:53:54 -0400 Original-Received: by pvg4 with SMTP id 4so384837pvg.0 for ; Sat, 26 Mar 2011 02:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cdwZhIV+aUvvqSfFNmnUQP5zx+ofPzewGaIr3Gv8Dlg=; b=YL8KzQhpMozhFGnBqQkYzCpPOCZFiqJP0K1VS38vXMUFQVvkNi3hbEcfpanO4cULij Sel1OpjwSoHUd1T/4XcuuZdqfRgh5IJiENHrLaq1L5ONzTJ9LOmHp96MF+5fi1OsFj2X 1iC5oBfYIDAE1XITVz5qeKoExOi3iE42Pm048= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=O0LuNeY7r1c9HqIVBk8TbueuLnraSPdHccX1Zk0aOsasghylDomnS9d1WllKf7hoQT Xk01q2W4Esw36w+IXNgCA974wUjYr1eB8qDrSevCysV/KpCyImOBbZS38rx7k1eiIXk5 OrCaqWE1VjPpmeamU2RLMXpX2ksZttrGdEdnU= Original-Received: by 10.142.218.16 with SMTP id q16mr1592285wfg.5.1301133232126; Sat, 26 Mar 2011 02:53:52 -0700 (PDT) Original-Received: by 10.142.217.10 with HTTP; Sat, 26 Mar 2011 02:53:52 -0700 (PDT) In-Reply-To: <87y643aqns.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.169 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8555 Archived-At: Hello Ludo', I had a chat with Mark Weaver on IRC; he could reproduce the error. The output shows basic GSL working, but GSL+CBLAS failing. I found a way to -combine the static versions into a single shared library using a trick I found on StackOverflow: > gcc -shared -o c.so -Wl,--whole-archive libgsl.a libgslcblas.a -Wl,--no-w= hole-archive Then the code works fine. A C program using GSL is normally compiled using -lgsl -lgslcblas, as the CBLAS functionality is optional. Cheers, Johan =3D=3D=3D > guile ./minex.scm #2f64((-0.234971334260896 -0.594500912896459 -1.11255443967142 0.801480195855566 -0.316194645848403) (1.24290785268759 -2.08593556136405 -1.22752508394053 0.277045912580934 -0.516092994917882) (0.459567260627738 1.15395341561812 -0.835952522855203 0.0988356041772604 -0.635311924759972) (-0.244100471165847 1.15963505516295 0.0613902743778219 0.259165537608565 0.0346540015684283) (0.296738078387975 2.71061022226222 0.0472142970448045 -0.602746825007033 1.07870413974582)) #f64(0.967207588370043 -1.05773505748483 0.554728493261389 -0.996518864916059 0.577347100608013) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -1.74071198327312 guile: symbol lookup error: /usr/lib/libgsl.so: undefined symbol: cblas_dtr= sv =3D=3D=3D 2011/3/25 Ludovic Court=C3=A8s : > Hi Johan, > > Johan Hidding writes: > >> I'm trying to use GSL through the FFI, but the program is not linked >> to libgslcblas, so it cannot find some functions. Attached a minimal > > Can you please post your Guile session including the error message that > you get? > > Thanks, > Ludo=E2=80=99. >