Raco exe question

I run the following 'raco exe' command with the understanding that Racket will be embedded:

(system "raco exe ++lang racket --gui ProcessorX.rkt")

When I run the resulting main.app the GUI program displays and runs as expected.

Next, I'd like to ensure that if I pass the same main.app to an identical Operating System, but without Racket installed, it would still run. To simulate this 'no Racket installed' state, I can temporarily rename the installed Racket on my test Mac from: /Applications/Racket v8.13 to: 'RRacket v8.13'

I again run the main.app but this time I get an error message that indicates the executable expects to find Racket v8.13 (not what I expect or want).

Error message:

ffi-lib: could not load foreign library

path: /Applications/Racket v8.13/lib/libpng16.16.dylib

System error: dlopen (/Applications/Racket v8.13/lib/libpng16.16.dylib)

Note that the 'raco exe ...' command did place the file where expected:

../main.app/Content/Resources/exts/ert/r1/libpng16.16.dylib

but the executable is not looking for it in this location.

Any thoughts?

Thanks.

Hi, @Don.

I think you are looking for distribute. I am spoiled, and mostly use the DrRacket GUI for creating executables, but it should be the same.

This bundles lib-files like DLLs and even ensures, e.g., that files referred to by runtime paths in your code, work the way they should when you deploy.

I hope that is helpful.

3 Likes

It may be helpful to think of raco exe like a dynamically-linked executable and raco distribute like a statically-linked executable (bundle), but I’ve never seen anyone else make that comparison and I wouldn't trust it too far. I’m sure someone will tell me just how wrong this analogy is :wink:

3 Likes