From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.user Subject: Re: using GSL with cblas via FFI Date: Mon, 04 Jun 2012 06:15:47 +0200 Message-ID: <87d35fn24s.fsf@gnuvola.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1338783335 15551 80.91.229.3 (4 Jun 2012 04:15:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Jun 2012 04:15:35 +0000 (UTC) Cc: wingo@pobox.com, guile-user@gnu.org To: cong gu Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jun 04 06:15:33 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 1SbOhY-0004CU-Tl for guile-user@m.gmane.org; Mon, 04 Jun 2012 06:15:33 +0200 Original-Received: from localhost ([::1]:35551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbOhY-0002QN-KU for guile-user@m.gmane.org; Mon, 04 Jun 2012 00:15:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbOhT-0002Q2-FU for guile-user@gnu.org; Mon, 04 Jun 2012 00:15:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbOhR-00019b-Rv for guile-user@gnu.org; Mon, 04 Jun 2012 00:15:27 -0400 Original-Received: from smtp205.alice.it ([82.57.200.101]:38398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbOhR-0000vO-Gr for guile-user@gnu.org; Mon, 04 Jun 2012 00:15:25 -0400 Original-Received: from ambire (95.236.25.58) by smtp205.alice.it (8.6.023.02) id 4F421F7B0BDA91CA; Mon, 4 Jun 2012 06:14:48 +0200 Original-Received: from ttn by ambire with local (Exim 4.72) (envelope-from ) id 1SbOho-0000V6-Ap; Mon, 04 Jun 2012 06:15:48 +0200 In-Reply-To: (cong gu's message of "Sun, 3 Jun 2012 17:04:29 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.101 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:9492 Archived-At: () cong gu () Sun, 3 Jun 2012 17:04:29 -0500 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'. Aside from portability, there is also coherence in design to consider. In (info "(libtool) Libltdl interface") i see seven funcs that take =E2=80=98lt_dladvise *ADVISE=E2=80=99: lt_dladvise_init lt_dladvise_destroy lt_dladvise_ext lt_dladvise_global lt_dladvise_local lt_dladvise_resident lt_dladvise_preload The first two manage the object; the last five mutate its internals. Your proposal sequences =E2=80=98lt_dladvise_ext=E2=80=99 and =E2=80=98lt_d= ladvise_global=E2=80=99 with =E2=80=98lt_dlopenadvise=E2=80=99, essentially. This is fine for your= needs today, no doubt. How about further on, when you need _resident or _preload, or _FOO (in some future libtool release), or when you want _global but not _ext? With five bits, you have 32 combinations (actually less, as not all combinations are meaningful, e.g., _global and _local together). It would be awkward to eventually find all these combinations wrapped individually, in C and exposed to Scheme. What is a better way?