Fix: Issue with CUBLAS compilation error due to missing -fPIC flag

Fix: Issue with CUBLAS compilation error due to missing `-fPIC` flag
This commit is contained in:
B1gM8c 2023-04-22 21:00:14 +08:00 committed by Slaren
parent 0e018fe008
commit d181095e5b

View file

@ -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