aboutsummaryrefslogtreecommitdiff
path: root/bench/Makefile
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-25 14:00:54 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-25 14:01:11 +0200
commit13dd2132310fb4dc5aa3dd217ed62f2e8301b981 (patch)
tree0e6f5dfdc686365af06fb59d32957e47a3ca5a79 /bench/Makefile
parentb673eb9a72138b89f1efecf52578020cb43857ff (diff)
downloadffwd-13dd2132310fb4dc5aa3dd217ed62f2e8301b981.tar.gz
ffwd-13dd2132310fb4dc5aa3dd217ed62f2e8301b981.zip
all: migrate to yyjson
Diffstat (limited to 'bench/Makefile')
-rw-r--r--bench/Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/bench/Makefile b/bench/Makefile
index 9eeaa95..948dab3 100644
--- a/bench/Makefile
+++ b/bench/Makefile
@@ -4,6 +4,7 @@ include ../build.mk
CFLAGS += -std=c11
BLAS_LIBS := $(HOST_BLAS_LDFLAGS)
+JSON_LIBS := $(YYJSON_LDFLAGS)
# Benchmarks link the blas libffwd archive from the per-config build tree and
# include its headers.
@@ -30,24 +31,24 @@ all: $(BENCHES)
libffwd-blas:
$(MAKE) -C $(LIBFFWD_DIR) BACKEND=blas
-$(eval $(call c_program_deps,bench_kernels,bench_kernels.c,bench.h libffwd-blas,$(LIBFFWD_A),-pthread -I$(LIBFFWD_DIR),$(BLAS_LIBS) -lm))
+$(eval $(call c_program_deps,bench_kernels,bench_kernels.c,bench.h libffwd-blas,$(LIBFFWD_A),-pthread -I$(LIBFFWD_DIR),$(BLAS_LIBS) $(JSON_LIBS) -lm))
-$(eval $(call c_program_deps,bench_tokenizer,bench_tokenizer.c,libffwd-blas,$(LIBFFWD_A),-I$(LIBFFWD_DIR),-lm))
+$(eval $(call c_program_deps,bench_tokenizer,bench_tokenizer.c,libffwd-blas,$(LIBFFWD_A),-I$(LIBFFWD_DIR),$(JSON_LIBS) -lm))
# The server utilities (base64, sbuf, util) depend on no library, so the bench
# compiles those sources directly here and keeps the build self-contained.
SERVER_UTIL_SRCS := $(SERVER_DIR)/base64.c $(SERVER_DIR)/sbuf.c $(SERVER_DIR)/util.c
$(eval $(call c_program_deps,bench_server_utils,bench_server_utils.c $(SERVER_UTIL_SRCS),bench.h,,-I$(SERVER_DIR),-lm))
-$(eval $(call c_program_deps,bench_model,bench_model.c,bench.h libffwd-blas,$(LIBFFWD_A),-pthread -I$(LIBFFWD_DIR),$(BLAS_LIBS) -lm))
+$(eval $(call c_program_deps,bench_model,bench_model.c,bench.h libffwd-blas,$(LIBFFWD_A),-pthread -I$(LIBFFWD_DIR),$(BLAS_LIBS) $(JSON_LIBS) -lm))
-$(eval $(call c_program_deps,bench_late_rerank,bench_late_rerank.c,libffwd-blas,$(LIBFFWD_A),-pthread -I$(LIBFFWD_DIR),$(BLAS_LIBS) -lm))
+$(eval $(call c_program_deps,bench_late_rerank,bench_late_rerank.c,libffwd-blas,$(LIBFFWD_A),-pthread -I$(LIBFFWD_DIR),$(BLAS_LIBS) $(JSON_LIBS) -lm))
# MLX rerank benchmark: the blas engine archive for the CPU reference paths plus
# mlx.c for the device API. The archive calls cblas, so the bench links
# Accelerate/OpenBLAS itself ($(HOST_BLAS_LDFLAGS)) on top of Metal/MLX. macOS only.
MLX_DRIVER_CFLAGS := -pthread -DCHECK_MLX -I$(MLXC_PREFIX)/include -I$(LIBFFWD_DIR) $(HOST_BLAS_CFLAGS)
-MLX_DRIVER_LDLIBS := $(MLX_BACKEND_LDFLAGS) $(HOST_BLAS_LDFLAGS) -lm
+MLX_DRIVER_LDLIBS := $(MLX_BACKEND_LDFLAGS) $(HOST_BLAS_LDFLAGS) $(JSON_LIBS) -lm
$(eval $(call c_program_deps,bench_late_rerank_mlx,bench_late_rerank.c $(LIBFFWD_DIR)/mlx.c,libffwd-blas,$(LIBFFWD_A),$(MLX_DRIVER_CFLAGS),$(MLX_DRIVER_LDLIBS)))
bench: bench_kernels