Add riscv64 support

This commit is contained in:
misaka00251 2023-01-04 00:43:57 +08:00
parent d4939ac589
commit 7d44d66d40
No known key found for this signature in database
GPG Key ID: 4AA100DC964EDE26
2 changed files with 58 additions and 1 deletions

49
add-riscv64-support.patch Normal file
View File

@ -0,0 +1,49 @@
Author: lvxiaoqian <xiaoqian@nj.iscas.ac.cn>
Date: Mon Aug 15 14:06:16 2022 +0800
add riscv support
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..8040ccb 100644
--- a/opal/include/opal/sys/cma.h
+++ b/opal/include/opal/sys/cma.h
@@ -92,6 +92,11 @@
#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

View File

@ -1,6 +1,6 @@
Name: openmpi Name: openmpi
Version: 4.1.4 Version: 4.1.4
Release: 2 Release: 3
Summary: Open Source High Performance Computing Summary: Open Source High Performance Computing
License: BSD-3-Clause License: BSD-3-Clause
URL: http://www.open-mpi.org/ URL: http://www.open-mpi.org/
@ -8,6 +8,7 @@ Source0: https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-%{ve
Source1: openmpi.module.in Source1: openmpi.module.in
Source2: openmpi.pth.py3 Source2: openmpi.pth.py3
Source3: macros.openmpi Source3: macros.openmpi
Patch1000: add-riscv64-support.patch
BuildRequires: gcc-c++, gcc-gfortran BuildRequires: gcc-c++, gcc-gfortran
BuildRequires: valgrind-devel, hwloc-devel, java-devel, libfabric-devel, papi-devel BuildRequires: valgrind-devel, hwloc-devel, java-devel, libfabric-devel, papi-devel
@ -16,6 +17,7 @@ BuildRequires: librdmacm-devel, rdma-core-devel, pmix-devel
BuildRequires: hwloc-gui chrpath BuildRequires: hwloc-gui chrpath
BuildRequires: perl-generators, perl(Getopt::Long) BuildRequires: perl-generators, perl(Getopt::Long)
BuildRequires: python3-devel libevent-devel BuildRequires: python3-devel libevent-devel
BuildRequires: automake libtool
%ifarch x86_64 %ifarch x86_64
BuildRequires: infinipath-psm-devel, libpsm2-devel zlib-devel BuildRequires: infinipath-psm-devel, libpsm2-devel zlib-devel
%endif %endif
@ -36,6 +38,8 @@ community in order to build the best MPI library available.
%ifarch aarch64 %ifarch aarch64
%global name_all openmpi-aarch64 %global name_all openmpi-aarch64
%elifarch riscv64
%global name_all openmpi-riscv64
%else %else
%global name_all openmpi-x86_64 %global name_all openmpi-x86_64
%endif %endif
@ -68,6 +72,7 @@ This contains man files for the using of openmpi.
%prep %prep
%autosetup -n openmpi-%{version} -p1 %autosetup -n openmpi-%{version} -p1
./autogen.pl --force
%build %build
./configure --prefix=%{_libdir}/%{name} \ ./configure --prefix=%{_libdir}/%{name} \
@ -208,6 +213,9 @@ make check
%{_mandir}/%{name_all}/man*/* %{_mandir}/%{name_all}/man*/*
%changelog %changelog
* Tue Jan 03 2023 misaka00251 <liuxin@iscas.ac.cn> - 4.1.4-3
- Add riscv64 support, patch from lvxiaoqian@iscas
* Fri Jul 29 2022 wangkai <wangkai385@h-partners.com> - 4.1.4-2 * Fri Jul 29 2022 wangkai <wangkai385@h-partners.com> - 4.1.4-2
- Reslove conflict with pmix-devel and update license - Reslove conflict with pmix-devel and update license