summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b56df3d8..8f73297f 100644
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,11 @@ ifndef UNAME_M
UNAME_M := $(shell uname -m)
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)
CXXV := $(shell $(CXX) --version | head -n 1)
@@ -150,6 +155,9 @@ endif
# Architecture specific
# 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
+
+ifndef RISCV
+
ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64))
# Use all CPU extensions that are available:
CFLAGS += -march=native -mtune=native
@@ -198,6 +206,11 @@ ifneq ($(filter ppc64%,$(UNAME_M)),)
endif
endif
+else
+ CFLAGS += -march=rv64gcv -mabi=lp64d
+ CXXFLAGS += -march=rv64gcv -mabi=lp64d
+endif
+
ifndef LLAMA_NO_K_QUANTS
CFLAGS += -DGGML_USE_K_QUANTS
CXXFLAGS += -DGGML_USE_K_QUANTS