aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-10 08:28:13 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-14 08:27:03 +0200
commitac994a45e239bdbb9aa5c34cbab2de71295ba420 (patch)
tree98c7adf49d156f641d5f0b1e02bcc79aea75991f /Makefile
parent2c37727e653d2340d8977dd5db4addc767dd81ea (diff)
downloadffwd-ac994a45e239bdbb9aa5c34cbab2de71295ba420.tar.gz
ffwd-ac994a45e239bdbb9aa5c34cbab2de71295ba420.zip
chore: rename sources; binaries pplx-embed, pplx-embed-server
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile49
1 files changed, 23 insertions, 26 deletions
diff --git a/Makefile b/Makefile
index 890fc7b..2e6d54d 100644
--- a/Makefile
+++ b/Makefile
@@ -16,9 +16,8 @@ endif
UNAME_S := $(shell uname -s)
# Source files
-SRCS = pplx_embed.c \
- pplx_distributed.c \
- pplx_server.c \
+SRCS = embed.c \
+ embed_distributed.c \
qwen_kernels.c \
qwen_kernels_generic.c \
qwen_kernels_neon.c \
@@ -29,12 +28,12 @@ SRCS = pplx_embed.c \
deps/ae/anet.c \
deps/ae/monotonic.c
-MLX_SRCS = pplx_embed_mlx.c
-CUDA_SRCS = pplx_embed_cuda.cu
+MLX_SRCS = embed_mlx.c
+CUDA_SRCS = embed_cuda.cu
OBJS = $(SRCS:.c=.o)
MLX_OBJS = $(MLX_SRCS:.c=.o)
-TARGET = pplx_embed
+TARGET = pplx-embed
SERVER_TARGET = pplx-embed-server
LIB = libpplxembed.a
@@ -54,7 +53,7 @@ endif
all: help
help:
- @echo "pplx_embed - Inference for pplx-embed-v1 and pplx-embed-context-v1 embedding models"
+ @echo "pplx-embed - Inference for pplx-embed-v1 and pplx-embed-context-v1 embedding models"
@echo ""
@echo "Build targets:"
@echo " make blas Build with BLAS acceleration (CPU)"
@@ -69,7 +68,7 @@ help:
@echo "(HTTP API), and the static library $(LIB)."
@echo ""
@echo "Usage:"
- @echo " ./pplx_embed -d /path/to/model-dir \"text1\" \"text2\""
+ @echo " ./pplx-embed -d /path/to/model-dir \"text1\" \"text2\""
@echo " ./pplx-embed-server --model pplx-embed-v1-0.6b=/path/to/model-dir"
# =============================================================================
@@ -99,8 +98,8 @@ blas:
MLX_PREFIX := $(shell brew --prefix mlx 2>/dev/null)
MLXC_PREFIX := $(shell brew --prefix mlx-c 2>/dev/null)
-mlx: SRCS += pplx_embed_mlx.c
-mlx: OBJS = $(SRCS:.c=.o) pplx_embed_mlx.o
+mlx: SRCS += embed_mlx.c
+mlx: OBJS = $(SRCS:.c=.o) embed_mlx.o
ifeq ($(UNAME_S),Darwin)
mlx: CFLAGS = $(CFLAGS_BASE) -DUSE_BLAS -DACCELERATE_NEW_LAPACK -DUSE_MLX \
-I$(MLXC_PREFIX)/include
@@ -111,7 +110,7 @@ mlx: LDFLAGS += -framework Accelerate -framework Metal -framework Foundation \
endif
mlx:
$(MAKE) clean
- $(MAKE) $(TARGET) $(SERVER_TARGET) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" EXTRA_OBJS="pplx_embed_mlx.o"
+ $(MAKE) $(TARGET) $(SERVER_TARGET) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" EXTRA_OBJS="embed_mlx.o"
# =============================================================================
# CUDA build (Linux NVIDIA GPU - uses CUDA Runtime + cuBLAS)
@@ -123,10 +122,10 @@ cuda: CFLAGS = $(CFLAGS_BASE) -DUSE_BLAS -DUSE_OPENBLAS -DUSE_CUDA -I/usr/inclu
cuda: LDFLAGS += -L$(CUDA_HOME)/lib64 -lopenblas -lcudart -lcublas
cuda:
$(MAKE) clean
- $(MAKE) pplx_embed_cuda.o
- $(MAKE) $(TARGET) $(SERVER_TARGET) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" EXTRA_OBJS="pplx_embed_cuda.o"
+ $(MAKE) embed_cuda.o
+ $(MAKE) $(TARGET) $(SERVER_TARGET) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" EXTRA_OBJS="embed_cuda.o"
-pplx_embed_cuda.o: pplx_embed_cuda.cu pplx_embed_cuda.h pplx_embed_internal.h pplx_embed.h
+embed_cuda.o: embed_cuda.cu embed_cuda.h embed_internal.h embed.h
$(NVCC) -O3 -std=c++17 -DUSE_BLAS -DUSE_OPENBLAS -DUSE_CUDA -I/usr/include/openblas -I$(CUDA_HOME)/include -x cu -c -o $@ $<
# =============================================================================
@@ -183,32 +182,30 @@ debug:
$(LIB): $(OBJS) $(EXTRA_OBJS)
ar rcs $@ $^
-$(TARGET): $(LIB) main.o
- $(CC) $(CFLAGS) -o $@ main.o $(LIB) $(LDFLAGS) $(CJSON_LDFLAGS)
+$(TARGET): $(LIB) embed_cli.o
+ $(CC) $(CFLAGS) -o $@ embed_cli.o $(LIB) $(LDFLAGS) $(CJSON_LDFLAGS)
-$(SERVER_TARGET): $(LIB) server_main.o
- $(CC) $(CFLAGS) -o $@ server_main.o $(LIB) $(LDFLAGS) $(CJSON_LDFLAGS)
+$(SERVER_TARGET): $(LIB) embed_server.o
+ $(CC) $(CFLAGS) -o $@ embed_server.o $(LIB) $(LDFLAGS) $(CJSON_LDFLAGS)
# =============================================================================
# Compile rules
# =============================================================================
-pplx_embed.o: pplx_embed.c pplx_embed.h qwen_kernels.h qwen_safetensors.h
+embed.o: embed.c embed.h qwen_kernels.h qwen_safetensors.h
$(CC) $(CFLAGS) $(CJSON_CFLAGS) -Ideps/ae -c -o $@ $<
-pplx_distributed.o: pplx_distributed.c pplx_distributed.h pplx_embed.h pplx_embed_mlx.h
+embed_distributed.o: embed_distributed.c embed_distributed.h embed.h embed_mlx.h
$(CC) $(CFLAGS) -c -o $@ $<
-pplx_server.o: pplx_server.c pplx_server.h pplx_embed.h pplx_embed_mlx.h qwen_tokenizer.h deps/ae/ae.h deps/ae/anet.h
+embed_server.o: embed_server.c embed_server.h embed.h embed_mlx.h qwen_tokenizer.h deps/ae/ae.h deps/ae/anet.h
$(CC) $(CFLAGS) $(CJSON_CFLAGS) -Ideps/ae -c -o $@ $<
-pplx_embed_mlx.o: pplx_embed_mlx.c pplx_embed_mlx.h pplx_embed.h qwen_safetensors.h
+embed_mlx.o: embed_mlx.c embed_mlx.h embed.h qwen_safetensors.h
$(CC) $(CFLAGS) -c -o $@ $<
-main.o: main.c pplx_embed.h pplx_distributed.h qwen_kernels.h qwen_tokenizer.h
+embed_cli.o: embed_cli.c embed.h embed_distributed.h qwen_kernels.h qwen_tokenizer.h
$(CC) $(CFLAGS) $(CJSON_CFLAGS) -Ideps/ae -c -o $@ $<
-server_main.o: server_main.c pplx_embed.h pplx_server.h qwen_kernels.h
- $(CC) $(CFLAGS) $(CJSON_CFLAGS) -Ideps/ae -c -o $@ $<
qwen_kernels.o: qwen_kernels.c qwen_kernels.h qwen_kernels_impl.h
$(CC) $(CFLAGS) -c -o $@ $<
@@ -233,6 +230,6 @@ deps/ae/%.o: deps/ae/%.c deps/ae/ae.h deps/ae/anet.h deps/ae/monotonic.h
# =============================================================================
clean:
- rm -f $(OBJS) pplx_embed_mlx.o pplx_embed_cuda.o main.o server_main.o \
+ rm -f $(OBJS) embed_mlx.o embed_cuda.o embed_cli.o embed_server.o \
$(TARGET) $(SERVER_TARGET) $(LIB) libpplxembed.dylib libpplxembed.so \
tests/test_kernels_generic tests/test_kernels_blas