From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: cong gu Newsgroups: gmane.lisp.guile.user Subject: Re: using GSL with cblas via FFI Date: Sun, 3 Jun 2012 17:04:29 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=14dae9340af5f824f304c198999b X-Trace: dough.gmane.org 1338761082 19013 80.91.229.3 (3 Jun 2012 22:04:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 3 Jun 2012 22:04:42 +0000 (UTC) To: wingo@pobox.com, guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jun 04 00:04:41 2012 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SbIuc-00019e-Sr for guile-user@m.gmane.org; Mon, 04 Jun 2012 00:04:39 +0200 Original-Received: from localhost ([::1]:54464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbIuc-0007Ix-ED for guile-user@m.gmane.org; Sun, 03 Jun 2012 18:04:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbIuX-0007Ir-NP for guile-user@gnu.org; Sun, 03 Jun 2012 18:04:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbIuW-0006Xv-3Y for guile-user@gnu.org; Sun, 03 Jun 2012 18:04:33 -0400 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:63367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbIuV-0006X1-Rf for guile-user@gnu.org; Sun, 03 Jun 2012 18:04:32 -0400 Original-Received: by yenm7 with SMTP id m7so3060620yen.0 for ; Sun, 03 Jun 2012 15:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=S1SgJvRms2BUDz3tgIUYJWHjxPA904T+e2xPrPPSmkQ=; b=DTwPPHmvujZAEW3RtMdZHmp+BzUIMceCLSwWwf9wBGB/5p2MAgfGdXV3U0UkIL13GT /aOveKYdqW3SyO8u/NMy5OY1OYxbJg8MPJisWSyMlkRVGwG2133By42q0sAuQ9ogQTjW MfGxsuLCme+o4TIUNkhRtutljI8tH8RdozSCqhUYr77RaNCDqO1xNAHxdhrmDhduqMqh ECxZ2kxHOZqoMX4Gw2HESzOcHxb6VUiHlVW++y8zF7Bnf1z6K8WAwW02OS46kKesPlg8 DrdjUVaMIcWcQ0fa6oBTm9+hSPlXse1MUHCtC/zrg8Z1Iat8gkNoL+r8eEdI+VJMYTSb UZRQ== Original-Received: by 10.50.236.74 with SMTP id us10mr6390813igc.29.1338761069208; Sun, 03 Jun 2012 15:04:29 -0700 (PDT) Original-Received: by 10.64.60.4 with HTTP; Sun, 3 Jun 2012 15:04:29 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.169 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9491 Archived-At: --14dae9340af5f824f304c198999b Content-Type: text/plain; charset=ISO-8859-1 I found libtool offers a way to make a shared library globally available. So I wrote a patch that provides `dynamic-link-global'. A call like `(dynamic-link-global "libgslcblas")' should make things work. I don't know whether it is portable, though. Documentation of libtool mentioned that not all loaders are able to act upon this `advice'. -- Cong Gu --14dae9340af5f824f304c198999b Content-Type: application/octet-stream; name="guile-2.0.5-dl-global.patch" Content-Disposition: attachment;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