How to load an extension in Guile 2.0?

623 views Asked by At

I'm trying to load the Graphviz extension for Guile 2.0. This line of scheme code, suggested by Graphviz's documentation, works in Guile 1.8:

(load-extension "/usr/lib/graphviz/guile/libgv_guile.so" "SWIG_init")

However, it will fail in Guile 2.0 with the following error:

scheme@(guile-user)> (load-extension "/usr/lib/graphviz/guile/libgv_guile.so" "SWIG_init") 
ERROR: In procedure load-extension:
ERROR: In procedure dynamic-link: file: "/usr/lib/graphviz/guile/libgv_guile.so", message: "file not found"

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.

I've tried using the following alternative paths as well:

/usr/lib/graphviz/guile/libgv_guile
libgv_guile

Same results. How do I do that?

2

There are 2 answers

0
ivarec On BEST ANSWER

The problem was that my distribution's Graphviz packages were compiled against Guile 1.8, and those two versions of Guile are not ABI compatible.

Compiling Graphviz linking against Guile 2.0 (with Guile 2.0's headers) solved it.

1
Sil On
(load-extension "/usr/lib/graphviz/guile/libgv_guile.so" "SWIG_init")

It works for me : up to date Archlinux 64 bits, guile 2.09 and graphviz 2.30.1-7

Your error message says "File not found". Check that the file exists and you have enough permissions.