diff --git a/mv2_clock-support-loongarch64.patch b/mv2_clock-support-loongarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f00bdfe4a7ba4acdf7e5f77caa721b727495a60 --- /dev/null +++ b/mv2_clock-support-loongarch64.patch @@ -0,0 +1,37 @@ +From 2c87d0fb35dc83c446665c80c78629bb9114e2b4 Mon Sep 17 00:00:00 2001 +From: houfangdong +Date: Thu, 18 Nov 2021 09:03:23 +0800 +Subject: [PATCH 3/3] mv2_clock support loongarch64. + +--- + src/mpid/ch3/channels/common/include/mv2_clock.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/src/mpid/ch3/channels/common/include/mv2_clock.h b/src/mpid/ch3/channels/common/include/mv2_clock.h +index 98f05df..45f3316 100644 +--- a/src/mpid/ch3/channels/common/include/mv2_clock.h ++++ b/src/mpid/ch3/channels/common/include/mv2_clock.h +@@ -92,6 +92,20 @@ static inline cycles_t get_cycles() + + return ret; + } ++#elif defined(__loongarch64) ++typedef unsigned long cycles_t; ++static inline cycles_t get_cycles() ++{ ++ int rID = 0; ++ cycles_t val = 0; ++ ++ __asm__ __volatile__( ++ "rdtime.d %0, %1 \n\t" ++ : "=r"(val), "=r"(rID) ++ : ++ ); ++ return val; ++} + + #else + #warning get_cycles not implemented for this architecture: attempt asm/timex.h +-- +2.27.0 + diff --git a/mvapich2.spec b/mvapich2.spec index 3f5c3c988638a48d738af0527312cd4e9c74310d..141ab29f91555da4f7f9dbef99183a6d267cdd16 100644 --- a/mvapich2.spec +++ b/mvapich2.spec @@ -2,7 +2,7 @@ Name: mvapich2 Version: 2.3 -Release: 11 +Release: 12 Summary: OSU MVAPICH2 MPI package License: BSD and MIT URL: http://mvapich.cse.ohio-state.edu @@ -18,6 +18,9 @@ Patch0006: fix-multiple-definition-error.patch Patch0007: fix-undefined-reference.patch Patch0008: fix-psm2-multiple-definition.patch Patch0009: fix-undefined-reference-in-psm2-files.patch +%ifarch loongarch64 +Patch0010: mv2_clock-support-loongarch64.patch +%endif BuildRequires: gcc-gfortran python3-devel gcc-c++ BuildRequires: bison flex autoconf automake libtool BuildRequires: perl-Digest-MD5 hwloc-devel rdma-core-devel @@ -260,10 +263,13 @@ cd .. %changelog -* Sat 07 Aug 2021 sunguoshuai - 2.3-11 +* Tue Jan 17 2023 wangkai - 2.3-12 +- add loongarch support + +* Sat Aug 07 2021 sunguoshuai - 2.3-11 - fix build error with gcc 10,include allow mismatched arguement and multiple definition -* Wed July 9 2021 zhaoyao - 2.3-10 +* Wed Jun 09 2021 zhaoyao - 2.3-10 - fix build error: Abording because C++ compiler does not work. * Sat Mar 27 2021 zhanghua - 2.3-9