SBCL 2.3.1 compile from source under Mac os x M1 can't find zstd.h
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
uname -a
Darwin carter.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-
customize-
(lambda (features)
(flet ((enable (x)
(pushnew x features))
(disable (x)
(setf features (remove x features))))
(enable :sb-thread)
(enable :sb-core-
(enable :sb-thread)
(enable :sb-futex)
features))
Compiling gives
//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/
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.
Once that is corrected (see below), the error is
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-
cc -g -dynamic -twolevel_namespace -bind_at_load -o sbcl alloc.o arena.o backtrace.o breakpoint.o coalesce.o coreparse.o dynbind.o funcall.o gc-common.o globals.o hopscotch.o interr.o interrupt.o largefile.o main.o math.o monitor.o murmur_hash.o os-common.o parse.o print.o regnames.o runtime.o safepoint.o save.o sc-offset.o search.o stringspace.o thread.o time.o validate.o var-io.o vars.o wrap.o run-program.o sprof.o arm64-arch.o bsd-os.o arm64-bsd-os.o darwin-os.o arm64-darwin-os.o fullcgc.o gencgc.o traceroot.o arm64-assem.o ../../tlsf-
ld: library not found for -lzstd
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sbcl] Error 1
Expectation is that this will compile without error.
To fix these errors, the file Config.arm64-darwin in src/runtime needs to have the CFLAGS and the OS_LIBS changed:
CFLAGS += -g -Wall -fdollars-
OS_LIBS = -lSystem -lc -ldl -L/opt/local/lib/
I'm using ports to install various parts, rather than homebrew.
This is quite similar to https:/