unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: cong gu <gucong43216@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: using GSL with cblas via FFI
Date: Mon, 04 Jun 2012 06:22:56 +0200	[thread overview]
Message-ID: <878vg3n1sv.fsf@gnuvola.org> (raw)
In-Reply-To: <CAH_4JjMHzEQ42Mj1E8h=skudqSOihCrA9a3Br4AUbPz++PkE+w@mail.gmail.com> (cong gu's message of "Sun, 3 Jun 2012 17:04:29 -0500")

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
}



  parent reply	other threads:[~2012-06-04  4:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-03 22:04 using GSL with cblas via FFI cong gu
2012-06-04  4:15 ` Thien-Thi Nguyen
2012-06-04  6:11   ` cong gu
2012-06-04  4:22 ` Thien-Thi Nguyen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-03-24 14:54 Johan Hidding
2011-03-25 20:31 ` Ludovic Courtès
2011-03-26  9:53   ` Johan Hidding
2011-03-31 15:18     ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878vg3n1sv.fsf@gnuvola.org \
    --to=ttn@gnuvola.org \
    --cc=gucong43216@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).