diff --git a/1000-add-loongarch64-support-not-upstream-mv2_clock.patch b/1000-add-loongarch64-support-not-upstream-mv2_clock.patch new file mode 100644 index 0000000..2f00bdf --- /dev/null +++ b/1000-add-loongarch64-support-not-upstream-mv2_clock.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/1001-add-sw_64-support-not-upstream-mv2_clock.patch b/1001-add-sw_64-support-not-upstream-mv2_clock.patch new file mode 100644 index 0000000..176bfb9 --- /dev/null +++ b/1001-add-sw_64-support-not-upstream-mv2_clock.patch @@ -0,0 +1,20 @@ +diff --git a/src/mpid/ch3/channels/common/include/mv2_clock.h b/src/mpid/ch3/channels/common/include/mv2_clock.h +index 135798f..ae32d00 100644 +--- a/src/mpid/ch3/channels/common/include/mv2_clock.h ++++ b/src/mpid/ch3/channels/common/include/mv2_clock.h +@@ -106,6 +106,15 @@ static inline cycles_t get_cycles() + ); + return val; + } ++#elif defined(__sw_64__) ++typedef unsigned long cycles_t; ++static inline cycles_t get_cycles() ++{ ++ cycles_t ret; ++ ++ __asm__ __volatile__ ("rtc %0" : "=r"(ret)); ++ return ret; ++} + + #else + #warning get_cycles not implemented for this architecture: attempt asm/timex.h diff --git a/mvapich2.spec b/mvapich2.spec index 7cdff61..d3ed745 100644 --- a/mvapich2.spec +++ b/mvapich2.spec @@ -2,7 +2,7 @@ Name: mvapich2 Version: 2.3.6 -Release: 1 +Release: 2 Summary: OSU MVAPICH2 MPI package License: BSD and MIT URL: http://mvapich.cse.ohio-state.edu @@ -11,6 +11,9 @@ Source1: mvapich2.module.in Source2: mvapich2.macros.in Patch0001: 0001-mvapich23-unbundle-contrib-hwloc.patch Patch0002: 0002-mvapich23-unbundle-osu_benchmarks.patch +Patch1000: 1000-add-loongarch64-support-not-upstream-mv2_clock.patch +Patch1001: 1001-add-sw_64-support-not-upstream-mv2_clock.patch +# END KYLINSEC BuildRequires: gcc-gfortran python3-devel gcc-c++ BuildRequires: bison flex autoconf automake libtool BuildRequires: perl-Digest-MD5 hwloc-devel rdma-core-devel @@ -119,7 +122,12 @@ cd default --datarootdir=%{_datadir}/mvapich2 --docdir=%{_docdir}/mvapich2 \ --enable-error-checking=runtime --enable-timing=none --enable-g=mem,dbg,meminit \ --enable-fast=all --enable-shared --enable-static --enable-fortran=all --enable-cxx \ - --disable-silent-rules --disable-wrapper-rpath --with-hwloc=v2 +%ifarch sw_64 + --disable-fortran \ +%else + --enable-fortran=all \ +%endif + --disable-silent-rules --disable-wrapper-rpath --with-hwloc=v2 find . -name libtool -exec \ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g; @@ -192,9 +200,11 @@ cd .. %{_libdir}/mvapich2/bin/mpic++ %{_libdir}/mvapich2/bin/mpicc %{_libdir}/mvapich2/bin/mpicxx +%ifnarch sw_64 %{_libdir}/mvapich2/bin/mpif77 %{_libdir}/mvapich2/bin/mpif90 %{_libdir}/mvapich2/bin/mpifort +%endif %{_libdir}/mvapich2/lib/pkgconfig %{_libdir}/mvapich2/lib/*.a %{_libdir}/mvapich2/lib/*.so @@ -247,13 +257,16 @@ cd .. %changelog +* Mon Aug 28 2023 panchenbo - 2.3.6-2 +- add sw_64 and loongarch64 support + * Mon Jun 20 2022 liyanan - 2.3.6-1 - Update to 2.3.6 -* Sat 07 Aug 2021 sunguoshuai - 2.3-11 +* 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 +* Fri Jul 09 2021 zhaoyao - 2.3-10 - fix build error: Abording because C++ compiler does not work. * Sat Mar 27 2021 zhanghua - 2.3-9