added support for RISCV CFLAGS & native compile + cross compile options
This commit is contained in:
parent
92d0b751a7
commit
bc23fcd797
1 changed files with 13 additions and 0 deletions
13
Makefile
13
Makefile
|
@ -35,6 +35,11 @@ ifndef UNAME_M
|
||||||
UNAME_M := $(shell uname -m)
|
UNAME_M := $(shell uname -m)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef RISCV_CROSS_COMPILE
|
||||||
|
CC := riscv64-unknown-linux-gnu-gcc
|
||||||
|
CXX := riscv64-unknown-linux-gnu-g++
|
||||||
|
endif
|
||||||
|
|
||||||
CCV := $(shell $(CC) --version | head -n 1)
|
CCV := $(shell $(CC) --version | head -n 1)
|
||||||
CXXV := $(shell $(CXX) --version | head -n 1)
|
CXXV := $(shell $(CXX) --version | head -n 1)
|
||||||
|
|
||||||
|
@ -145,6 +150,9 @@ endif
|
||||||
# Architecture specific
|
# Architecture specific
|
||||||
# TODO: probably these flags need to be tweaked on some architectures
|
# TODO: probably these flags need to be tweaked on some architectures
|
||||||
# feel free to update the Makefile for your architecture and send a pull request or issue
|
# feel free to update the Makefile for your architecture and send a pull request or issue
|
||||||
|
|
||||||
|
ifndef RISCV
|
||||||
|
|
||||||
ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64))
|
ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64))
|
||||||
# Use all CPU extensions that are available:
|
# Use all CPU extensions that are available:
|
||||||
CFLAGS += -march=native -mtune=native
|
CFLAGS += -march=native -mtune=native
|
||||||
|
@ -193,6 +201,11 @@ ifneq ($(filter ppc64%,$(UNAME_M)),)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
else
|
||||||
|
CFLAGS += -march=rv64gcv -mabi=lp64d
|
||||||
|
CXXFLAGS += -march=rv64gcv -mabi=lp64d
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef LLAMA_NO_K_QUANTS
|
ifndef LLAMA_NO_K_QUANTS
|
||||||
CFLAGS += -DGGML_USE_K_QUANTS
|
CFLAGS += -DGGML_USE_K_QUANTS
|
||||||
CXXFLAGS += -DGGML_USE_K_QUANTS
|
CXXFLAGS += -DGGML_USE_K_QUANTS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue