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

From: d (derick.eddington at gmail.com)
Date: Tue Feb 6 20:31:41 EST 2007

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:

$ mzscheme
Welcome to MzScheme v369.7 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
> (require (planet "digest.ss" ("soegaard" "digest.plt" 1 0)))
> (digest #"abc" 'md5)
"900150983cd24fb0d6963f7d28e17f72"
> (digest #"abc" 'sha1)
"a9993e364706816aba3e25717850c26c9cd0d89d"
> (define b (make-bytes 10000000))
> (md5 b)
"311175294563b07db7ea80dee2e5b3c6"
> (require (prefix mz: (lib "md5.ss")))
> (mz:md5 b)
#"311175294563b07db7ea80dee2e5b3c6"
> (time (md5 b))
cpu time: 36 real time: 43 gc time: 0
"311175294563b07db7ea80dee2e5b3c6"
> (time (mz:md5 b))
cpu time: 11641 real time: 11885 gc time: 4
#"311175294563b07db7ea80dee2e5b3c6"
> 

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 ...

-- 
: Derick
----------------------------------------------------------------

On Tue, 2007-02-06 at 14:44 +0100, Jens Axel Søgaard wrote:
> Geoffrey S. Knauth:
>  > On ubuntu 6.10 edgy AMD64, I got:
> 
>  > Welcome to DrScheme, version 360.
>  > Language: Pretty Big (includes MrEd and Advanced Student).
>  > > (require (planet "digest.ss" ("soegaard" "digest.plt" 1 0)))
>  > ffi-lib: couldn't open "libcrypto.so" (libcrypto.so: cannot open
>  > shared object file: No such file or directory)
> 
>  > I do have a libcrypto.so in /usr/lib.
> 
> 
> Jon Rafkind skrev:
> > $ uname -a
> > Linux dynamo 2.6.16-gentoo-r7 #10 Tue Jun 27 20:26:34 EDT 2006 x86_64 
> > AMD Athlon(tm) 64 Processor 3500+ AuthenticAMD GNU/Linux
> 
> You both seem to have the same version of DrScheme (360).
> 
> Jon, where is your libcrypto.so located?
> 
> Is it LD_LIBRARY_PATH that decides where DrScheme looks for
> shared libraries on Linux?
> 




Posted on the users mailing list.