From 3660153906b6c7751aba1f533999dc476022ac65 Mon Sep 17 00:00:00 2001 From: andreaborio <13642830+andreaborio@users.noreply.github.com> Date: Wed, 17 Jun 2026 11:58:26 +0200 Subject: [PATCH] Fix quality-score link after streaming refactor The streaming refactor made ds4.o depend on ds4_distributed.o and ds4_ssd.o: ds4_session_* call ds4_dist_session_*, and ds4_engine_open/ close call ds4_ssd_*. The gguf-tools quality-score target still links only ds4.o plus the backend object, so `make -C gguf-tools quality-score` fails at link time on both the Metal and CUDA branches with undefined ds4_dist_*/ds4_ssd_* symbols and no scorer is produced. Add ds4_distributed.o and ds4_ssd.o to QUALITY_TARGETS and QUALITY_OBJS on both branches, matching the CORE_OBJS set that ds4 and ds4-server already link. Build-only change, no backend source touched, so the correctness (ds4_test) and speed (ds4-bench) tracks are unaffected. Tested on macOS / Metal (Apple M5 Pro): make -C gguf-tools quality-score before: ld: undefined symbols ds4_dist_*/ds4_ssd_*, no binary after: links and builds gguf-tools/quality-testing/score_official CUDA branch changed symmetrically but not built here (no CUDA box); it mirrors the working CUDA CORE_OBJS. --- gguf-tools/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gguf-tools/Makefile b/gguf-tools/Makefile index 799895a41..88ec3c116 100644 --- a/gguf-tools/Makefile +++ b/gguf-tools/Makefile @@ -4,8 +4,8 @@ UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) NATIVE_CPU_FLAG ?= -mcpu=native QUALITY_LDLIBS := -lm -pthread -framework Foundation -framework Metal -QUALITY_TARGETS := ds4.o ds4_metal.o -QUALITY_OBJS := ../ds4.o ../ds4_metal.o +QUALITY_TARGETS := ds4.o ds4_distributed.o ds4_ssd.o ds4_metal.o +QUALITY_OBJS := ../ds4.o ../ds4_distributed.o ../ds4_ssd.o ../ds4_metal.o QUALITY_LINK := $(CC) $(CFLAGS) -I.. -o else NATIVE_CPU_FLAG ?= -march=native @@ -17,8 +17,8 @@ NVCC_ARCH_FLAGS := -arch=$(CUDA_ARCH) endif NVCCFLAGS ?= -O3 --use_fast_math $(NVCC_ARCH_FLAGS) -Xcompiler $(NATIVE_CPU_FLAG) -Xcompiler -pthread QUALITY_LDLIBS ?= -lm -Xcompiler -pthread -L$(CUDA_HOME)/targets/sbsa-linux/lib -L$(CUDA_HOME)/lib64 -lcudart -lcublas -QUALITY_TARGETS := ds4.o ds4_cuda.o -QUALITY_OBJS := ../ds4.o ../ds4_cuda.o +QUALITY_TARGETS := ds4.o ds4_distributed.o ds4_ssd.o ds4_cuda.o +QUALITY_OBJS := ../ds4.o ../ds4_distributed.o ../ds4_ssd.o ../ds4_cuda.o QUALITY_LINK := $(NVCC) $(NVCCFLAGS) -I.. -o endif