unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Unknown <unknown@unknown.invalid>
To: matt.wette@gmail.com, guile-user@gnu.org
Subject: Re: Integrate Guile with GNU Scientific Library
Date: Fri, 04 Oct 2019 14:32:16 +0000	[thread overview]
Message-ID: <EdsrpAm_v3v7EztHdOxNWCr9BVfqSDFoOgn6wC_FKqVRVa0kw28yO_8lWJ8XDG6rUtuXoAM26IFIK5k5345PL5FJhxbFN0I0_eSM7sdAl0s=@protonmail.com> (raw)
In-Reply-To: <872711be-6794-bb44-3634-b90baf568751@gmail.com>

On 4 Oct 2019, 03:10, Matt Wette < matt.wette@gmail.com> wrote:

On 10/3/19 12:28 AM, Freeduck via General Guile related discussions wrote:

> Hi All,

>

> I am trying to integrate Guile with a part of GNU Scientific Library and have found SWIG, which seems very easy to use, but only supports Guile 2.0. I have Guile 2.2 installed.

> The Guile homepage has a tutorial on integrating Guile into C, and the manual has a section on dynamic ffi, but it I find it hard to get started, maybe it is just lack of experience.

>

> My main problem is not integrating with GSL, but doing polynomial regression. I have been working in Racket for a while which has allot of maths integrated. Is there something like numpy/scipy for Guile.

>

> Kind regards

>

> Kristian

>

> Sent with [ProtonMail](https://protonmail.com) Secure Email.

The FFI Helper in nyacc (https://savannah.nongnu.org/projects/nyacc)

provides the functionality of swig.  You can try that.  I'd be

interested in how you like that compared to swig.

A quick hack to see if I could get it to work for gsl failed:

$ cat gsl-sort.ffi

(define-ffi-module (gsl-sort)

  #:pkg-config "gsl"

  #:include '("gsl/gsl_sort.h"))

$ guild compile-ffi gsl-sort.ffi

...

ERROR: In procedure dynamic-link:

In procedure dynamic-link: file: "libm", message: "file not found"

So for some reason the linker is not finding libm.so on my Unbuntu.

I will need to look into that.

You can check the examples in examples/nyacc/lang/ffi-help.

First, sorry if I'm messing up bottom posting and formatting ... I'm responding using a non-free mobile phone app :)

Second, the answer might be totally off-topic, but I always found it easier to generate math programs by Guile and then compile them, then a full, seamless library level integration into a Guile program itself. See, e.g.

https://gitlab.com/codetk/schemetran

for a naive implementation of fortran wrappers and compiler helpers in Guile. It is naive, but I managed to do a lot of sophisticated linear algebra with it.

Anyway, good luck :) .

T

PS also in mine previous experiences when trying to link stuff using ffi, looking at the symbols in libraries directly helped.

  reply	other threads:[~2019-10-04 14:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03  7:28 Integrate Guile with GNU Scientific Library Freeduck via General Guile related discussions
2019-10-04  1:10 ` Matt Wette
2019-10-04 14:32   ` Unknown [this message]
2019-10-04 22:41   ` Matt Wette
2019-10-05 16:55   ` (dynamic-link "libm") fails [was Re: Integrate Guile with GNU Scientific Library] Matt Wette

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='EdsrpAm_v3v7EztHdOxNWCr9BVfqSDFoOgn6wC_FKqVRVa0kw28yO_8lWJ8XDG6rUtuXoAM26IFIK5k5345PL5FJhxbFN0I0_eSM7sdAl0s=@protonmail.com' \
    --to=unknown@unknown.invalid \
    --cc=guile-user@gnu.org \
    --cc=matt.wette@gmail.com \
    /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).