[racket] Compilation of program in racket failed

From: Laurent (laurent.orseau at gmail.com)
Date: Fri Jul 9 10:00:45 EDT 2010


I can't help you with your first question.

Another thing I would like is a self-contained command line executable
> that I can easily distribute to people without racket installed. ++lib
> embeds libraries in the executable
> but I use so many libraries that finding them all in order to list them is
> a
> pain. Is there a way to tell raco exe to embed them all? If not, is
> there any automated way to find all used so I can easily generate the
> correct command line with all the ++lib?

Maybe my own experience can be of some help.

Personally, I use an additional *collection* path where I put all my
personal additional libraries,
but then you need to use the library tools like `create-embedded-executable'
and others which provide more options than the raco command line.
If the libs are in a collection that is known to the current environment (is
that the correct word?) then they are automatically embedded inside the
executable, which is much simpler that adding each lib by hand.

Here is how I use it.
It may not be optimal since most of this comes from trial&error and analogy,
but at least it works for me:

   #:modules '((#f "main-file.ss"))
   #:configure-via-first-module? #t
   (parameterize ([current-namespace (make-base-namespace)])
     (compile `(namespace-require ''main-file)))

In order for (current-library-collection-paths) to work correctly,
additional collections must be set either in Languages inside DrRacket, or
on the command line to 'racket' with the -S option followed by the full path
to the collection.
You can also modify the `current-library-collection-paths' parameter
Also, if compiling inside DrRacket, you need to deactivate the Debugging
option in Languages (unless that bug is fixed).

Personally, I had less problems with using a file, say compile.rkt, that
defines a `main' function that executes the above code, and call it from the
command line with something like:

racket -S "<full-path-to-additional-collection-root>" -t compile.rkt --main

where "release" is an option passed to the `main' function.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100709/b014f2b7/attachment.html>

Posted on the users mailing list.