!13 [sync] PR-12: Fix build error for loongarch64

From: @openeuler-sync-bot 
Reviewed-by: @znzjugod 
Signed-off-by: @znzjugod
This commit is contained in:
openeuler-ci-bot 2024-05-28 02:37:05 +00:00 committed by Gitee
commit c5e5ee8a61
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From 3d913d653d9bf75ae56b46deeffb28874fedb6d1 Mon Sep 17 00:00:00 2001
From: zhangzikang <zhangzikang@kylinos.cn>
Date: Fri, 17 May 2024 10:03:26 +0800
Subject: [PATCH] Fix build error for loongarch64
---
third_party/ggml/src/ggml.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/third_party/ggml/src/ggml.c b/third_party/ggml/src/ggml.c
index beb7f46..2374287 100644
--- a/third_party/ggml/src/ggml.c
+++ b/third_party/ggml/src/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
--
2.43.0

View File

@ -2,13 +2,17 @@
Name: chatglm-cpp
Version: 0.2.4
Release: 4
Release: 5
License: MIT
Summary: Port of Chinese lagre model ChatGLM-6B & ChatGLM2-6B implemented based on C/C++
URL: https://github.com/li-plus/chatglm.cpp
Source0: https://github.com/li-plus/chatglm.cpp/releases/download/0.2.4/chatglm-cpp-%{version}.tar.gz
%ifarch loongarch64
Patch0: 0001-Fix-build-error-for-loongarch64.patch
%endif
BuildRequires: gcc,gcc-c++,cmake
Requires: sentencepiece
@ -47,6 +51,9 @@ popd
/usr/lib/static/libggml.a
%changelog
* Fri May 17 2024 zhangzikang <zhangzikang@kylinos.cn> - 0.2.4-5
- Fix build error for loongarch64
* Wed Sep 20 2023 zhoupengcheng <zhoupengcheng11@huawei.com> - 0.2.4-4
- packing chatglm_convert.py file
- install python models for chatglm_convert.py int dockerfile