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.