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:22:56 +0200 Message-ID: <878vg3n1sv.fsf@gnuvola.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1338783727 17714 80.91.229.3 (4 Jun 2012 04:22:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Jun 2012 04:22:07 +0000 (UTC) Cc: guile-user@gnu.org To: cong gu Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jun 04 06:22:06 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 1SbOnt-00010j-ME for guile-user@m.gmane.org; Mon, 04 Jun 2012 06:22:05 +0200 Original-Received: from localhost ([::1]:35810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbOnt-0002ud-A2 for guile-user@m.gmane.org; Mon, 04 Jun 2012 00:22:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbOno-0002tv-0p for guile-user@gnu.org; Mon, 04 Jun 2012 00:22:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbOnm-0002nM-D6 for guile-user@gnu.org; Mon, 04 Jun 2012 00:21:59 -0400 Original-Received: from smtp208.alice.it ([82.57.200.104]:59963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbOnm-0002n7-3B for guile-user@gnu.org; Mon, 04 Jun 2012 00:21:58 -0400 Original-Received: from ambire (95.236.25.58) by smtp208.alice.it (8.6.023.02) id 4F056E8510F52D24; Mon, 4 Jun 2012 06:21:56 +0200 Original-Received: from ttn by ambire with local (Exim 4.72) (envelope-from ) id 1SbOoj-0000VX-Gs; Mon, 04 Jun 2012 06:22:57 +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.104 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:9493 Archived-At: BTW, i made a similar design decision in Guile 1.4.x (see below), which now i regret, so that's why i comment: to selfishly keep you away from my regrets so that you can find your own. :-D [cc trimmed] ________________________________________________________ SCM_DEFINE (scm_dynamic_link, "dynamic-link", 1, 0, 0, (SCM name), doc: /*********** Open the dynamic library file @var{name} and return its @dfn{library handle}, suitable for passing to the following functions. As a special case, if @var{name} is @code{#f}, the returned handle is for the Guile executable itself. */) { #define FUNC_NAME s_scm_dynamic_link const char *fname = NULL; lt_dladvise advise; lt_dlhandle handle; if (SCM_NFALSEP (name)) { SCM_COERCE_SUBSTR (name); SCM_VALIDATE_ROSTRING_COPY (1, name, fname); } NOINTS (); ZHOPEFULLY (lt_dladvise_init (&advise)); ZHOPEFULLY (lt_dladvise_global (&advise)); if (!fname || '/' != fname[0]) ZHOPEFULLY (lt_dladvise_ext (&advise)); handle = lt_dlopenadvise (fname, advise); lt_dladvise_destroy (&advise); HOPEFULLY (handle); INTSOK (); SCM_RETURN_NEWSMOB2 (tc, SCM_UNPACK (name), handle); #undef FUNC_NAME }