guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to use gsl with the guile ffi


From: tantalum
Subject: how to use gsl with the guile ffi
Date: Fri, 28 Dec 2018 13:15:09 +0000
User-agent: Posteo Webmail

im getting the error "In procedure dynamic-link: file: "libgsl", message: "file not found"" with the following code:

    (import (system foreign))
    (define gsl (dynamic-link "libgsl"))

* gsl (optionally?) depends on libgslcblas, which itself links without error, but loading it with (dynamic-link) beforehand did not help * some libraries work, for example libmagic. libm for example gives the same error message * the file /usr/lib/libgsl.so exists and is a symlink to the regular file libgsl.so.23.1.0 whose content begins with ELF> * similar problem on the mailing list https://lists.gnu.org/archive/html/guile-user/2016-05/msg00010.html * ive tried to set LD_LIBRARY_PATH with export to /usr/lib with no apparent effect * i was going from this manual entry https://www.gnu.org/software/guile/manual/html_node/Dynamic-FFI.html
* guile (GNU Guile) 2.2.4

the issue can actually be reproduced with a c program:

    #include <dlfcn.h>
    #include <stdio.h>

    int main () {
      void* a = dlopen("libgsl.so", RTLD_NOW);
      printf("got %p\n", a);
      if (a) printf("ok\n"); else printf("error: %s\n", dlerror());
    }

gcc t.c -ldl && ./a.out

the program only works without error when compiled with -lgslcblas.
so, it could be a more basic issue, but i dont know how to proceed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]