[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(dynamic-link "libm") fails [was Re: Integrate Guile with GNU Scientific
From: |
Matt Wette |
Subject: |
(dynamic-link "libm") fails [was Re: Integrate Guile with GNU Scientific Library] |
Date: |
Sat, 5 Oct 2019 09:55:40 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
scheme@(guile-user)> (dynamic-link "libffi")
$1 = #<dynamic-object "libffi">
scheme@(guile-user)> (dynamic-link "libm")
ERROR: In procedure dynamic-link:
In procedure dynamic-link: file: "libm", message: "file not found"
Both libraries are linked into guile, so being already linked is not an
issue.
However:
mwette$ file /usr/lib/x86_64-linux-gnu/libm.so
/usr/lib/x86_64-linux-gnu/libm.so: ASCII text
mwette$ cat /usr/lib/x86_64-linux-gnu/libm.so
/* GNU ld script
*/
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib/x86_64-linux-gnu/libm.so.6 AS_NEEDED (
/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a
/lib/x86_64-linux-gnu/libmvec.so.1 ) )
This is an apparent redirection. I think this is a bug (or feature) of
dlopen:
mwette$ cat z2.c
#include <stdio.h>
#include <dlfcn.h>
int main() {
void *p;
p = dlopen("/usr/lib/x86_64-linux-gnu/libm.so", RTLD_NOW);
printf("%p\n", p);
}
mwette$ gcc z2.c -ldl
mwette$ ./a.out
(nil)
Matt
On 10/3/19 6:10 PM, Matt Wette wrote:
$ 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.