fix build error for loongarch64

This commit is contained in:
wangshuo 2024-05-14 15:58:00 +08:00
parent 1fcf1bf042
commit c4cb6caf18
2 changed files with 31 additions and 1 deletions

View File

@ -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 <intrin.h>
#else
-#if !defined(__riscv)
+#if !defined(__riscv) && !defined(__loongarch64)
#include <immintrin.h>
#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 <intrin.h>
#else
-#if !defined(__riscv)
+#if !defined(__riscv) && !defined(__loongarch64)
#include <immintrin.h>
#endif
#endif

View File

@ -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 <wangshuo@kylinos.cn> - 20230815-4
- add loongarch64 support
* Wed Sep 20 2023 zhoupengcheng <zhoupengcheng11@huawei.com> - 20230815-3
- rename /usr/bin/convert.py
- update long-term yum.repo in dockerfile