Next: , Up: Guile Bindings


11.1 Guile Preparations

The GnuTLS Guile bindings are by default installed under the GnuTLS installation directory (e.g., typically /usr/local/share/guile/site/). Normally Guile will not find the module there without help. You may experience something like this:

     $ guile
     guile> (use-modules (gnutls))
     <unnamed port>: no code for module (gnutls)
     guile>

There are two ways to solve this. The first is to make sure that when building GnuTLS, the Guile bindings will be installed in the same place where Guile looks. You may do this by using the --with-guile-site-dir parameter as follows:

     $ ./configure --with-guile-site-dir=no

This will instruct GnuTLS to attempt to install the Guile bindings where Guile will look for them. It will use guile-config info pkgdatadir to learn the path to use.

If Guile was installed into /usr, you may also install GnuTLS using the same prefix:

     $ ./configure --prefix=/usr

If you want to specify the path to install the Guile bindings you can also specify the path directly:

     $ ./configure --with-guile-site-dir=/opt/guile/share/guile/site

The second solution requires some more work but may be easier to use if you do not have system administrator rights to your machine. You need to instruct Guile so that it finds the GnuTLS Guile bindings. Either use the GUILE_LOAD_PATH environment variable as follows:

     $ GUILE_LOAD_PATH="/usr/local/share/guile/site:$GUILE_LOAD_PATH" guile
     guile> (use-modules (gnutls))
     guile>

Alternatively, you can modify Guile's %load-path variable (see Guile's run-time options).

At this point, you might get an error regarding libguile-gnutls-v-0 similar to:

     gnutls.scm:361:1: In procedure dynamic-link in expression (load-extension "libguile-gnutls-v-0" "scm_init_gnutls"):
     gnutls.scm:361:1: file: "libguile-gnutls-v-0", message: "libguile-gnutls-v-0.so: cannot open shared object file: No such file or directory"

In this case, you will need to modify the run-time linker path, for example as follows:

     $ LD_LIBRARY_PATH=/usr/local/lib GUILE_LOAD_PATH=/usr/local/share/guile/site guile
     guile> (use-modules (gnutls))
     guile>

To check that you got the intended GnuTLS library version, you may print the version number of the loaded library as follows:

     $ guile
     guile> (use-modules (gnutls))
     guile> (gnutls-version)
     "2.10.0"
     guile>