Lacking Natural Simplicity

Random musings on books, code, and tabletop games.

Compiling s7 scheme on macOS

To compile s7 scheme with a standalone REPL, s7's home page says to add the empty file mus-config.h to the source directory, then (in Linux):

gcc s7.c -o repl -DWITH_MAIN -I. -O2 -g -ldl -lm -Wl,-export-dynamic

It turns out that on macOS, whose ld (from clang) doesn't understand -export-dynamic, you have to do

gcc s7.c -o repl -DWITH_MAIN -I. -O2 -g -ldl -lm -Wl,-dynamic

Then you need to do

./repl libc.scm

which seems to generate libc_s7.c and compile it into libc_s.so. Then you can run the REPL:

./repl

which, from looking at s7.c, loads repl.scm. Unfortunately, I don't understand the repl commands, except for pwd and cd. Oh, and (exit) exits the repl.

Last edited: 2020-08-03 16:03:57 EDT

Print Friendly and PDF

Comments

Comments powered by Disqus