[plt-scheme] PLT Scheme linux distribution

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jun 26 20:40:49 EDT 2007

At Tue, 26 Jun 2007 17:01:15 -0700, "Keith Frost" wrote:
> On 6/26/07, Glauber Prado <glauberalex at uol.com.br> wrote:
> > i think i could be completely wrong but isnt the env variable
> > "LD_LYBRARY_PATH" used to handle this on linux env?
> Right. I was hoping that if I just set this environment variable to
> include the path to libmzscheme3m-370.so, that mzscheme would find the
> lib.  But it seems the PLT installation doesn't depend on
> LD_LIBRARY_PATH (or ldconfig ?) to find the shared library, instead
> hard-coding the path.

Yes, you can set LD_LIBRARY_PATH to include the path to
libmzscheme3-370.so, and then it will be found when starting the
`mzscheme' executable.

The build-specified path is hardwired into the executable as an
"rpath", which essentially adds to the front of LD_LIBRARY_PATH, but
doesn't cause it to be ignored.

Of course, setting LD_LIBRARY_PATH is not the same as having a path in
the executable that is relative to the executable. Some Unix variants
do support such paths, but not Linux (I think). In general, the
Unix/Linux way of doing things is to always put shared libraries in one

It's possible to create a stub script/executable that doesn't use
shared libraries, and that sets LD_LIBRARY_PATH before exec'ing the
`mzscheme' binary. In fact, that's what you get when you create a PLT
Scheme executable under Linux (when using shared libraries). It's an
abuse of LD_LIBRARY_PATH, though there doesn't seem to be a reasonable
alternative for creating self-contained executable packages.


Posted on the users mailing list.