Add initial support for riscv64

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2022-09-23 11:14:10 +03:00
parent 63ea11607f
commit a2d99af93a
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 84 additions and 1 deletions

View File

@ -0,0 +1,61 @@
From 0693a0dc91b5b2dbd7a83ac298d7c3a437d76327 Mon Sep 17 00:00:00 2001
From: David Abdurachmanov <davidlt@rivosinc.com>
Date: Fri, 23 Sep 2022 11:08:32 +0300
Subject: [PATCH] Add initial support for riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
---
config/opal_config_asm.m4 | 5 +++++
opal/include/opal/sys/architecture.h | 1 +
opal/include/opal/sys/cma.h | 7 +++++++
3 files changed, 13 insertions(+)
diff --git a/config/opal_config_asm.m4 b/config/opal_config_asm.m4
index 5183c7e..d8640e0 100644
--- a/config/opal_config_asm.m4
+++ b/config/opal_config_asm.m4
@@ -1148,6 +1148,11 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
AC_MSG_WARN([$opal_cv_asm_arch: gcc atomics have been known to perform poorly on powerpc.])
fi
+ ;;
+ riscv64*)
+ opal_cv_asm_arch="RISCV64"
+ OPAL_ASM_SUPPORT_64BIT=1
+ OPAL_GCC_INLINE_ASSIGN='"li %0, 0" : "=&r"(ret)'
;;
# There is no current difference between s390 and s390x
# But use two different defines in case some come later
diff --git a/opal/include/opal/sys/architecture.h b/opal/include/opal/sys/architecture.h
index ee9aa96..8a9fc53 100644
--- a/opal/include/opal/sys/architecture.h
+++ b/opal/include/opal/sys/architecture.h
@@ -44,6 +44,7 @@
#define OPAL_ARM64 0101
#define OPAL_S390 0110
#define OPAL_S390X 0111
+#define OPAL_RISCV64 0120
#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 4211013..9e02f99 100644
--- a/opal/include/opal/sys/cma.h
+++ b/opal/include/opal/sys/cma.h
@@ -92,6 +92,13 @@
#define __NR_process_vm_readv 340
#define __NR_process_vm_writev 341
+#elif OPAL_ASSEMBLY_ARCH == OPAL_RISCV64
+
+/* RISCV64 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.35.1

View File

@ -33,11 +33,15 @@
%endif
# Run autogen - needed for some patches
%ifnarch riscv64
%bcond_with autogen
%else
%bcond_without autogen
%endif
Name: openmpi%{?_cc_name_suffix}
Version: 4.1.4
Release: 4%{?dist}
Release: 4.0.riscv64%{?dist}
Summary: Open Message Passing Interface
License: BSD and MIT and Romio
URL: http://www.open-mpi.org/
@ -49,6 +53,8 @@ Source2: openmpi.pth.py2
Source3: openmpi.pth.py3
Source4: macros.openmpi
Patch10: 0001-Add-initial-support-for-riscv64.patch
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
BuildRequires: make
@ -57,7 +63,9 @@ BuildRequires: libtool
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(File::Find)
%endif
%ifarch %{valgrind_arches}
BuildRequires: valgrind-devel
%endif
%if %{with rdma}
BuildRequires: opensm-devel > 3.3.0
BuildRequires: rdma-core-devel
@ -101,6 +109,14 @@ BuildRequires: zlib-devel
BuildRequires: rpm-mpi-hooks
%endif
%ifarch riscv64
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: gettext
BuildRequires: perl-interpreter
%endif
Provides: mpi
%if 0%{?rhel} == 7
# Need this for /etc/profile.d/modules.sh
@ -202,8 +218,10 @@ OpenMPI support for Python 3.
%endif
--enable-mpi1-compatibility \
--with-sge \
%ifarch %{valgrind_arches}
--with-valgrind \
--enable-memchecker \
%endif
--with-hwloc=/usr \
%if !0%{?el7}
--with-libevent=external \
@ -379,6 +397,10 @@ make check
%changelog
* Fri Sep 23 2022 David Abdurachmanov <davidlt@rivosinc.com> - 4.1.4-4.0.riscv64
- Add initial support for riscv64
- Fix valgrind check
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild