From c6493e82b7d1df9f511668ff446092de9b35733b Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Thu, 20 Jul 2023 11:38:54 +0800 Subject: [PATCH] add loongarch64 support for openmpi --- ...-add-loongarch64-support-for-openmpi.patch | 58 +++++++++++++++++++ openmpi.spec | 11 +++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 0001-add-loongarch64-support-for-openmpi.patch diff --git a/0001-add-loongarch64-support-for-openmpi.patch b/0001-add-loongarch64-support-for-openmpi.patch new file mode 100644 index 0000000..e19d6d1 --- /dev/null +++ b/0001-add-loongarch64-support-for-openmpi.patch @@ -0,0 +1,58 @@ +From 015d0246d315377d1d8aeadeff8fcbc2aef49874 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Thu, 20 Jul 2023 03:27:39 +0000 +Subject: [PATCH] add loongarch64 support for openmpi + +--- + config/opal_config_asm.m4 | 5 +++++ + opal/include/opal/sys/architecture.h | 1 + + opal/include/opal/sys/cma.h | 5 +++++ + 3 files changed, 11 insertions(+) + +diff --git a/config/opal_config_asm.m4 b/config/opal_config_asm.m4 +index d8640e0..586a2c8 100644 +--- a/config/opal_config_asm.m4 ++++ b/config/opal_config_asm.m4 +@@ -1154,6 +1154,11 @@ AC_DEFUN([OPAL_CONFIG_ASM],[ + OPAL_ASM_SUPPORT_64BIT=1 + OPAL_GCC_INLINE_ASSIGN='"li %0, 0" : "=&r"(ret)' + ;; ++ loongarch64*) ++ opal_cv_asm_arch="LOONGARCH64" ++ OPAL_ASM_SUPPORT_64BIT=1 ++ OPAL_GCC_INLINE_ASSIGN='"li.d %0, 0" : "=&r"(ret)' ++ ;; + # There is no current difference between s390 and s390x + # But use two different defines in case some come later + # as s390 is 31bits while s390x is 64bits +diff --git a/opal/include/opal/sys/architecture.h b/opal/include/opal/sys/architecture.h +index 8a9fc53..ed54270 100644 +--- a/opal/include/opal/sys/architecture.h ++++ b/opal/include/opal/sys/architecture.h +@@ -45,6 +45,7 @@ + #define OPAL_S390 0110 + #define OPAL_S390X 0111 + #define OPAL_RISCV64 0120 ++#define OPAL_LOONGARCH64 0130 + #define OPAL_BUILTIN_SYNC 0200 + #define OPAL_BUILTIN_GCC 0202 + #define OPAL_BUILTIN_NO 0203 +diff --git a/opal/include/opal/sys/cma.h b/opal/include/opal/sys/cma.h +index 8040ccb..11417b5 100644 +--- a/opal/include/opal/sys/cma.h ++++ b/opal/include/opal/sys/cma.h +@@ -97,6 +97,11 @@ + #define __NR_process_vm_readv 270 + #define __NR_process_vm_writev 271 + ++#elif OPAL_ASSEMBLY_ARCH == OPAL_LOONGARCH64 ++/* LOONGARCH64 uses the asm-generic syscall numbers */ ++#define __NR_process_vm_readv 270 ++#define __NR_process_vm_writev 271 ++ + #else + #error "Unsupported architecture for process_vm_readv and process_vm_writev syscalls" + #endif +-- +2.33.0 + diff --git a/openmpi.spec b/openmpi.spec index cf4ea48..ece2020 100644 --- a/openmpi.spec +++ b/openmpi.spec @@ -1,6 +1,6 @@ Name: openmpi Version: 4.1.5 -Release: 1 +Release: 2 Summary: Open Source High Performance Computing License: BSD-3-Clause URL: http://www.open-mpi.org/ @@ -9,6 +9,9 @@ Source1: openmpi.module.in Source2: openmpi.pth.py3 Source3: macros.openmpi Patch1000: add-riscv64-support.patch +%ifarch loongarch64 +Patch1001: 0001-add-loongarch64-support-for-openmpi.patch +%endif BuildRequires: gcc-c++, gcc-gfortran BuildRequires: valgrind-devel, hwloc-devel, java-devel, libfabric-devel, papi-devel @@ -21,6 +24,9 @@ BuildRequires: automake libtool %ifarch x86_64 BuildRequires: infinipath-psm-devel, libpsm2-devel zlib-devel %endif +%ifarch loongarch64 +BuildRequires: automake +%endif Provides: mpi, %{name}-java Requires: environment(modules), openssh-clients @@ -218,6 +224,9 @@ make check %{_mandir}/%{name_all}/man*/* %changelog +* Thu Jul 20 2023 Wenlong Zhang - 4.1.5-2 +- fix build error that automake can not be found + * Fri Apr 21 2023 wulei - 4.1.5-1 - Upgrade package to version 4.1.5 -- Gitee