SBCL 2.3.1 compile from source under Mac os x M1 can't find zstd.h

Bug #2007302 reported by William G Lederer
6
This bug affects 1 person
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-8792.61.2~4/RELEASE_ARM64_T6000 arm64

customize-target-features.lisp

(lambda (features)
  (flet ((enable (x)
           (pushnew x features))
         (disable (x)
           (setf features (remove x features))))
    (enable :sb-thread)
    (enable :sb-core-compression)
    (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/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.

Once that is corrected (see below), the error is

cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -I/opt/local/include/ -fno-omit-frame-pointer -I. -I../../ -c -o arm64-darwin-os.o arm64-darwin-os.c
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -I/opt/local/include/ -fno-omit-frame-pointer -I. -I../../ -c -o fullcgc.o fullcgc.c
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -I/opt/local/include/ -fno-omit-frame-pointer -I. -I../../ -c -o gencgc.o gencgc.c
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -I/opt/local/include/ -fno-omit-frame-pointer -I. -I../../ -c -o traceroot.o traceroot.c
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -I/opt/local/include/ -fno-omit-frame-pointer -I. -I../../ -c -o arm64-assem.o arm64-assem.S
cc -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -fdollars-in-identifiers -I/opt/local/include/ -fno-omit-frame-pointer -I. -I../../ -c -o ../../tlsf-bsd/tlsf/tlsf.o ../../tlsf-bsd/tlsf/tlsf.c
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-bsd/tlsf/tlsf.o -lSystem -lc -ldl -lpthread -lzstd -lm
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-in-identifiers -I/opt/local/include/
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://sourceforge.net/p/sbcl/sbcl/ci/9de74a0d4d

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.