From 2390573ce3e156f7825250380579fabaed779b95 Mon Sep 17 00:00:00 2001 From: B1gM8c <89020353+B1gM8c@users.noreply.github.com> Date: Sat, 22 Apr 2023 21:00:14 +0800 Subject: [PATCH] Fix: Issue with CUBLAS compilation error due to missing -fPIC flag Fix: Issue with CUBLAS compilation error due to missing `-fPIC` flag --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b297959c9..ef6d63ede 100644 --- a/Makefile +++ b/Makefile @@ -109,10 +109,8 @@ ifdef LLAMA_CUBLAS LDFLAGS += -lcublas -lculibos -lcudart -lcublasLt -lpthread -ldl -lrt -L/usr/local/cuda/lib64 OBJS += ggml-cuda.o NVCC = nvcc - NVCCFLAGS = --forward-unknown-to-host-linker -arch=native + NVCCFLAGS = --forward-unknown-to-host-linker -arch=native --compiler-options -fPIC ggml-cuda.o: ggml-cuda.cu ggml-cuda.h - $(NVCC) $(NVCCFLAGS) $(CXXFLAGS) -c $< -o $@ -endif ifdef LLAMA_GPROF CFLAGS += -pg CXXFLAGS += -pg