diff --git a/macros.openmpi b/macros.openmpi index 05e613f830a4ea5ff699d1cacc177f54e1e38bfe..1ee6a3c6d04cd6b9716bb76898201979f3300969 100644 --- a/macros.openmpi +++ b/macros.openmpi @@ -1,6 +1,7 @@ %_openmpi_load \ . /etc/profile.d/modules.sh; \ - module load mpi/openmpi-%{_arch}; + module load mpi/openmpi-%{_arch}; \ + export OMPI_MCA_rmaps_base_oversubscribe=1 %_openmpi_unload \ . /etc/profile.d/modules.sh; \ module unload mpi/openmpi-%{_arch}; diff --git a/openmpi-4.0.1-riscv64.patch b/openmpi-4.0.1-riscv64.patch new file mode 100644 index 0000000000000000000000000000000000000000..d479065c474fce8032f86fe84ebc990c7c53ad1d --- /dev/null +++ b/openmpi-4.0.1-riscv64.patch @@ -0,0 +1,46 @@ +diff --git a/config/opal_config_asm.m4 b/config/opal_config_asm.m4 +index 65675d1..7c77d65 100644 +--- a/config/opal_config_asm.m4 ++++ b/config/opal_config_asm.m4 +@@ -1130,6 +1130,11 @@ AC_DEFUN([OPAL_CONFIG_ASM],[ + fi + OPAL_GCC_INLINE_ASSIGN='"1: li %0,0" : "=&r"(ret)' + ;; ++ 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 + # 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 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 diff --git a/openmpi-2.1.1.tar.bz2 b/openmpi-4.0.4.tar.bz2 similarity index 49% rename from openmpi-2.1.1.tar.bz2 rename to openmpi-4.0.4.tar.bz2 index a5cb1161f753e2db8e81cc9aef0400c181d80527..2340d806d655daf2401479e629b9fe97a2240f55 100644 Binary files a/openmpi-2.1.1.tar.bz2 and b/openmpi-4.0.4.tar.bz2 differ diff --git a/openmpi.module.in b/openmpi.module.in index 7e96154ea4b0c9df6ea44dca39c2902b263290e4..41583c419ddfab5d09d58058fc12c49f3c212d5e 100644 --- a/openmpi.module.in +++ b/openmpi.module.in @@ -6,7 +6,7 @@ conflict mpi prepend-path PATH @LIBDIR@/bin prepend-path LD_LIBRARY_PATH @LIBDIR@/lib prepend-path PKG_CONFIG_PATH @LIBDIR@/lib/pkgconfig -prepend-path MANPATH @MANDIR@ +prepend-path MANPATH :@MANDIR@ setenv MPI_BIN @LIBDIR@/bin setenv MPI_SYSCONFIG @ETCDIR@ setenv MPI_FORTRAN_MOD_DIR @FMODDIR@ diff --git a/openmpi.spec b/openmpi.spec index 9a3883ba6c916d20c8eda2bce1e46478a2216a67..0a9d8cc795c5a27ca3dbf97f35b33d57f0b18380 100644 --- a/openmpi.spec +++ b/openmpi.spec @@ -1,23 +1,35 @@ Name: openmpi -Version: 2.1.1 -Release: 20 -Summary: Open Source High Performance Computing +Version: 4.0.4 +Release: 1 +Summary: Open Message Passing Interface License: BSD and MIT and Romio URL: http://www.open-mpi.org/ -Source0: https://download.open-mpi.org/release/open-mpi/v2.1/openmpi-%{version}.tar.bz2 +Source0: https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-%{version}.tar.bz2 Source1: openmpi.module.in Source2: openmpi.pth.py3 Source3: macros.openmpi +# Add OPAL patch to enable riscv64 +# http://fedora.riscv.rocks:3000/rpms/openmpi/commit/14627af2cb42a8172d290a76e3c287c50109ad25 +# Thu Jul 02 2020 David Abdurachmanov - 4.0.4-1.0.riscv64 +Patch1: openmpi-4.0.1-riscv64.patch + BuildRequires: gcc-c++, gcc-gfortran BuildRequires: valgrind-devel, hwloc-devel, java-devel, libfabric-devel, papi-devel BuildRequires: libibverbs-devel >= 1.1.3, opensm-devel > 3.3.0 -BuildRequires: librdmacm-devel, rdma-core-devel, pmix-devel +BuildRequires: librdmacm-devel, rdma-core-devel, pmix-devel, libevent-devel BuildRequires: hwloc-gui chrpath -BuildRequires: perl-generators, perl(Getopt::Long) -BuildRequires: python3-devel +BuildRequires: perl-generators, perl-interpreter, perl(Getopt::Long) +BuildRequires: python3-devel, zlib-devel +%bcond_with ucx +%if %{with ucx} +BuildRequires: ucx-devel +%endif %ifarch x86_64 -BuildRequires: infinipath-psm-devel, libpsm2-devel zlib-devel +BuildRequires: infinipath-psm-devel, libpsm2-devel +%endif +%ifarch riscv64 +BuildRequires: autoconf automake libtool gettext %endif Provides: mpi, %{name}-java @@ -39,7 +51,9 @@ community in order to build the best MPI library available. %else %global name_all openmpi-x86_64 %endif -#%global namearch openmpi-%{_arch} +%ifarch riscv64 +%global name_all openmpi-%{_arch} +%endif %package devel Summary: Development files for openmpi @@ -69,6 +83,18 @@ This contains man files for the using of openmpi. %prep %autosetup -n openmpi-%{version} -p1 +%ifarch riscv64 +# autogen --> autoreconf to find newer 'alocal' & etc. +./autogen.pl --force +# Update config.* scripts to get RISC-V (riscv64) support +for f in $(find . -name config.guess); do + cp -v -f /usr/lib/rpm/openEuler/config.guess "$f" +done +for f in $(find . -name config.sub); do + cp -v -f /usr/lib/rpm/openEuler/config.sub "$f" +done +%endif + %build ./configure --prefix=%{_libdir}/%{name} \ --includedir=%{_includedir}/%{name_all} \ @@ -83,13 +109,15 @@ This contains man files for the using of openmpi. --with-valgrind \ --with-hwloc=/usr \ --mandir=%{_mandir}/%{name_all} \ + --with-libevent=external \ + --with-pmix=external \ CFLAGS="$RPM_OPT_FLAGS" \ CXXFLAGS="$RPM_OPT_FLAGS" \ FC=gfortran \ FCFLAGS="$RPM_OPT_FLAGS" \ LDFLAGS="-Wl,-z,now" -%make_build +%make_build V=1 %install %make_install @@ -130,8 +158,8 @@ sed -i -e s/-ldl// -e s/-lhwloc// \ install -d %{buildroot}/%{python3_sitearch}/%{name} install -pDm0644 %{SOURCE2} %{buildroot}/%{python3_sitearch}/openmpi.pth -file `find %{buildroot}%{_libdir}/openmpi/bin -type f` | grep -w ELF | awk -F : '{print $1}' |xargs chrpath -d +file `find %{buildroot}%{_libdir}/openmpi/bin -type f` | grep -w ELF | awk -F : '{print $1}' |xargs chrpath -d file `find %{buildroot}%{_libdir}/openmpi/lib -type f` | grep -w ELF | awk -F : '{print $1}' |xargs chrpath -d mkdir -p %{buildroot}/etc/ld.so.conf.d @@ -150,7 +178,7 @@ echo "%{_libdir}/openmpi/lib" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.c make check %files -%license LICENSE opal/mca/event/libevent2022/libevent/LICENSE +%license LICENSE %dir %{_libdir}/%{name} %dir %{_sysconfdir}/%{name_all} %dir %{_libdir}/%{name}/bin @@ -169,9 +197,11 @@ make check %{_libdir}/%{name}/bin/orte-* %{_libdir}/%{name}/bin/orted %{_libdir}/%{name}/bin/orterun +%if %{with ucx} %{_libdir}/%{name}/bin/oshmem_info %{_libdir}/%{name}/bin/oshrun %{_libdir}/%{name}/bin/shmemrun +%endif %{_libdir}/%{name}/lib/*.so.* %{_libdir}/%{name}/lib/openmpi/* %{_libdir}/%{name}/lib/mpi.jar @@ -184,16 +214,16 @@ make check %dir %{_includedir}/%{name_all} %{_includedir}/%{name_all}/* %{_libdir}/%{name}/share/doc/ -%{_libdir}/%{name}/bin/mpic* -%{_libdir}/%{name}/bin/mpiCC -%{_libdir}/%{name}/bin/mpif* +%{_libdir}/%{name}/bin/mpi[cCf]* %{_libdir}/%{name}/bin/opal* -%{_libdir}/%{name}/bin/ortecc -%{_libdir}/%{name}/bin/oshcc -%{_libdir}/%{name}/bin/oshfort -%{_libdir}/%{name}/bin/shmemcc -%{_libdir}/%{name}/bin/shmemfort +%{_libdir}/%{name}/bin/orte[cCf]* +%if %{with ucx} +%{_libdir}/%{name}/bin/osh[cCf]* +%{_libdir}/%{name}/bin/shmem[cCf]* +%endif %{_libdir}/%{name}/bin/mpijava* +%{_libdir}/%{name}/bin/profile2mat.pl +%{_libdir}/%{name}/bin/aggregate_profile.pl %{_libdir}/%{name}/lib/*.so %{_libdir}/%{name}/lib/*.mod %{_libdir}/%{name}/lib/pkgconfig/ @@ -211,6 +241,9 @@ make check %{_mandir}/%{name_all}/man*/* %changelog +* Mon May 16 2022 zxs-un - 4.0.4-1 +- upgrade to 4.0.4 and add support for riscv64 using OPAL patch from Fedora by David Abdurachmanov + * Thu Sep 9 2021 Pengju Jiang - 2.1.1-20 - solve the strip and rpath problem of safe conversion