exysle
exysle

Reputation: 11

Installing SBCL 2.2.7 via asdf-vm on Mac OS X M1 leads to 'zstd.h' bug - save.c:45:11: fatal error: 'zstd.h' file not found

I am currently trying to install SBCL via ASDF-VM on an M1 Mac, and I am running into the following bug trying to build 2.2.7:

beginning GENESIS, creating headers in "src/runtime/genesis"

real    0m23.834s
user    0m21.823s
sys 0m1.858s
//entering make-target-1.sh
//building runtime system and symbol table file
rm -f *.[do] sbcl ldb unit-tests sbcl.h core *.tmp libsbcl.a shrinkwrap-sbcl* sbcl.mk
echo '#include "genesis/config.h"' >sbcl.h
echo '#include "genesis/constants.h"' >>sbcl.h
save.c:45:11: fatal error: 'zstd.h' file not found
# include <zstd.h>
          ^~~~~~~~
1 error generated.
coreparse.c:48:11: fatal error: 'zstd.h' file not found
# include <zstd.h>
          ^~~~~~~~
1 error generated.
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -fno-omit-frame-pointer -I.  -c -o alloc.o alloc.c
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -fno-omit-frame-pointer -I.  -c -o backtrace.o backtrace.c
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -fno-omit-frame-pointer -I.  -c -o breakpoint.o breakpoint.c
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -fno-omit-frame-pointer -I.  -c -o coalesce.o coalesce.c
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -fno-omit-frame-pointer -I.  -c -o coreparse.o coreparse.c
coreparse.c:48:11: fatal error: 'zstd.h' file not found
# include <zstd.h>
          ^~~~~~~~
1 error generated.
make: *** [coreparse.o] Error 1
Installed SBCL
/Users/exysle/.asdf/plugins/sbcl/bin/install: line 190: /Users/exysle/.asdf/installs/sbcl/2.2.7/bin/sbcl: No such file or directory

It seems like the bug is apparent in 2.2.7 and 2.2.6, but it seems like 2.2.5 installs perfectly.

Upvotes: 1

Views: 442

Answers (1)

ignis volens
ignis volens

Reputation: 9252

This is because SBCL 2.2.6 and later uses zstd for core compression, and presumably that does not ship with macOS (certainly I can not find it on my machine).

I do not understand asdf-vm, but it looks like the plugin for SBCL is here, and it is significant that it explicitly lists zstd in its prerequisites.

You will only get this problem if you build with the --fancy option: unless you use that the build will not include the core compression stuff. If I build with ./make/sh --fancy then it fails in just this way.

A way to diagnose this is to run ./make-config.sh and then look at what's in local-target-features.lisp-expr. It should not contain any mention of :sb-core-compression: if it does, you'll need zstd.

Upvotes: 2

Related Questions