Automatic Arch Linux detection for BLAS
This commit is a port of a detection method used in koboldcpp's Makefile in order to automatically set the -lcblas option on Arch Linux
This commit is contained in:
parent
921dcee00a
commit
4e3c178be4
1 changed files with 10 additions and 1 deletions
11
Makefile
11
Makefile
|
@ -13,6 +13,15 @@ ifndef UNAME_M
|
|||
UNAME_M := $(shell uname -m)
|
||||
endif
|
||||
|
||||
ARCH_LINUX1 := $(shell grep "Arch Linux" /etc/os-release 2>/dev/null)
|
||||
ARCH_LINUX2 := $(shell grep "ID_LIKE=arch" /etc/os-release 2>/dev/null)
|
||||
ifdef ARCH_LINUX1
|
||||
ARCH_ADD = -lcblas
|
||||
endif
|
||||
ifdef ARCH_LINUX2
|
||||
ARCH_ADD = -lcblas
|
||||
endif
|
||||
|
||||
CCV := $(shell $(CC) --version | head -n 1)
|
||||
CXXV := $(shell $(CXX) --version | head -n 1)
|
||||
|
||||
|
@ -107,7 +116,7 @@ ifndef LLAMA_NO_ACCELERATE
|
|||
endif
|
||||
ifdef LLAMA_OPENBLAS
|
||||
CFLAGS += -DGGML_USE_OPENBLAS -I/usr/local/include/openblas
|
||||
LDFLAGS += -lopenblas
|
||||
LDFLAGS += -lopenblas $(ARCH_ADD)
|
||||
endif
|
||||
ifdef LLAMA_CUBLAS
|
||||
CFLAGS += -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue