[plt-scheme] Message digests: md5, sha1, etc.

From: Richard Cobbe (cobbe at ccs.neu.edu)
Date: Tue Feb 6 21:00:33 EST 2007

On Tue, Feb 06, 2007 at 05:31:41PM -0800, d wrote:
> Maybe this helps.  I also have an Ubuntu Edgy and I've been having to
> modify $PLT/collects/readline/mzrl.ss so that libreadline.so is found
> because my Ubuntu does not have a file or link named libreadline.so, it
> has libreadline.so.5.  Similarly, I don't have a file or link named
> libcrypto.so, I have libcrypto.so.0.9.8.  I got the same "ffi-lib:
> couldn't open "libcrypto.so" ...".  When I modified Jens Axel's
> digest.ss and changed line 37 from:
>   [else       (ffi-lib "libcrypto")]))
> to:
>   [else       (ffi-lib "libcrypto" "0.9.8")]))
> it worked:


> Changing that line isn't the desired solution, I imagine.  I'm not
> familiar with Ubuntu, maybe there is some confusion between Ubuntu's ld
> setup and (lib "foreign.ss")?  Seems like Ubuntu would want to allow
> clients of ld to not have to specify library version numbers ...

Advance disclaimer: I've never used Ubuntu, but I have used other Linux
variants, including Debian, and I've also done a lot of C/C++ development
on Solaris, which uses a similar shared-library infrastructure.

Advance disclaimer 2: what I've stated below is based on the Unix
conventions for managing shared libraries.  This particular situation
involves dynamically-loaded libraries, but that's probably OK, because
they're the same thing on at least Linux & Solaris (tho not Mac OS X).

According to the standard Unix conventions for linking with and loading
shared libraries, changing that line *is* the desired solution, though not
in quite the way that you specify; it should be
    (ffi-lib "libcrypto" "0")
instead of
    (ffi-lib "libcrypto" "0.9.8")

If you don't have a libcrypto.so.0, Derick, then there's something amiss.
(It should be a symlink to libcrypto.so.0.9.8.)

Likewise, the ref to libreadline.so in mzrl.ss should really specify the
major version number of libreadline it expects.  (But, I hear you cry,
won't this break mzrl.ss when the major version number changes?  Yes, but
it's already broken in that case, because the library is likely to be
incompatible in key ways, up to and including not defining the necessary

As a stopgap, Derick, you can probably install the missing symlinks
libreadline.so and libcrypto.so.  If Ubuntu is anything like Debian, there
are packages named libreadline-dev and libcrypto-dev (or something similar)
that will create the necessary symlinks.


Posted on the users mailing list.