From 6b70483500a130873bf08af014e0df0a76089455 Mon Sep 17 00:00:00 2001 From: wangshuo Date: Tue, 14 May 2024 15:58:00 +0800 Subject: [PATCH] fix build error for loongarch64 (cherry picked from commit c4cb6caf1821ace8b16cab2a9e6d312160e8d78e) --- add-loongarch64-support.patch | 26 ++++++++++++++++++++++++++ llama.cpp.spec | 6 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 add-loongarch64-support.patch diff --git a/add-loongarch64-support.patch b/add-loongarch64-support.patch new file mode 100644 index 0000000..c9ec162 --- /dev/null +++ b/add-loongarch64-support.patch @@ -0,0 +1,26 @@ +diff --git a/ggml.c b/ggml.c +index beb7f46..2374287 100644 +--- a/ggml.c ++++ b/ggml.c +@@ -299,7 +299,7 @@ typedef double ggml_float; + #if defined(_MSC_VER) || defined(__MINGW32__) + #include + #else +-#if !defined(__riscv) ++#if !defined(__riscv) && !defined(__loongarch64) + #include + #endif + #endif +diff --git a/k_quants.c b/k_quants.c +index 6348fce..6816121 100644 +--- a/k_quants.c ++++ b/k_quants.c +@@ -26,7 +26,7 @@ + #if defined(_MSC_VER) || defined(__MINGW32__) + #include + #else +-#if !defined(__riscv) ++#if !defined(__riscv) && !defined(__loongarch64) + #include + #endif + #endif diff --git a/llama.cpp.spec b/llama.cpp.spec index 01defcf..19552ec 100644 --- a/llama.cpp.spec +++ b/llama.cpp.spec @@ -3,12 +3,13 @@ Name: llama.cpp Version: 20230815 -Release: 3 +Release: 4 License: MIT Summary: Port of English lagre model LLaMA implemented based on C/C++ URL: https://github.com/ggerganov/llama.cpp Source0: https://github.com/ggerganov/llama.cpp/archive/refs/tags/%{llama_commitid}.tar.gz +Patch0: add-loongarch64-support.patch BuildRequires: gcc,gcc-c++,cmake @@ -39,6 +40,9 @@ popd %{_libdir}/libembdinput.a %changelog +* Tue May 14 2024 wangshuo - 20230815-4 +- add loongarch64 support + * Wed Sep 20 2023 zhoupengcheng - 20230815-3 - rename /usr/bin/convert.py - update long-term yum.repo in dockerfile -- Gitee