PKGBUILDs/extra/openmpi/PKGBUILD

135 lines
3.4 KiB
Bash
Raw Normal View History

2017-09-13 19:28:17 +00:00
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2022-06-07 12:35:30 +00:00
# Maintainer: David Runge <dvzrv@archlinux.org>
2017-09-13 19:28:17 +00:00
# Contributor: Anatol Pomozov <anatol dot pomozov at gmail>
2014-09-19 19:29:48 +00:00
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org
2022-06-07 12:35:30 +00:00
# - remove make/optdepend on cuda and configure option
2024-02-12 13:58:08 +00:00
# - remove make/optdepend on hip-runtime-amd and rocm configure option
2024-02-06 04:27:48 +00:00
# - build for v8 only, 32-bit support dropped in version 5
buildarch=8
2014-09-19 19:29:48 +00:00
2024-02-06 04:15:00 +00:00
pkgbase=openmpi
pkgname=(
openmpi
openmpi-docs
)
2024-02-12 13:58:08 +00:00
pkgver=5.0.2
2024-03-24 16:53:50 +00:00
pkgrel=7
2014-09-19 19:29:48 +00:00
pkgdesc='High performance message passing library (MPI)'
2022-06-07 12:35:30 +00:00
arch=(x86_64)
2017-09-13 19:28:17 +00:00
url='https://www.open-mpi.org'
2024-02-06 04:15:00 +00:00
license=('BSD-3-Clause AND LicenseRef-MPICH')
makedepends=(
gcc-fortran
2023-06-03 19:01:09 +00:00
gcc-libs
glibc
hwloc
libevent
2024-02-12 13:58:08 +00:00
libfabric
2023-06-03 19:01:09 +00:00
libnl
2024-02-12 13:58:08 +00:00
openpmix
2024-02-06 04:15:00 +00:00
prrte
2023-06-03 19:01:09 +00:00
valgrind
2024-02-06 04:15:00 +00:00
zlib
2022-06-07 12:35:30 +00:00
)
2023-06-03 19:01:09 +00:00
source=(
2024-02-06 04:15:00 +00:00
https://www.open-mpi.org/software/ompi/v${pkgver%.*}/downloads/$pkgbase-$pkgver.tar.bz2)
2024-02-12 13:58:08 +00:00
sha256sums=('ee46ad8eeee2c3ff70772160bff877cbf38c330a0bc3b3ddc811648b3396698f')
b2sums=('ea7a584ab945c8b2fcdd8a3c2510205582606442efaad2058b321ad4c787b2f66f79e86aa4b8b094eba9508fa208f40a4a843b9938d93899eee1948d0299b7b8')
2024-02-06 04:15:00 +00:00
_pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#$pkgdir/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
prepare() {
cd $pkgbase-$pkgver
# workaround for https://github.com/open-mpi/ompi/issues/12257
sed -i 's|WRAPPER__FCFLAGS|WRAPPER_FCFLAGS|g' configure
sed -i 's|WRAPPER_EXTRA_FCFLAGS|WRAPPER_FCFLAGS|g' configure
sed -i 's|"-I/usr/include",||' opal/tools/wrappers/opal_wrapper.c
}
2014-09-19 19:29:48 +00:00
2014-09-29 15:51:13 +00:00
build() {
2023-02-27 23:56:21 +00:00
local configure_options=(
--prefix=/usr
--enable-builtin-atomics
--enable-memchecker
--enable-mpi-fortran=all
--enable-pretty-print-stacktrace
--libdir=/usr/lib
2024-02-06 04:15:00 +00:00
--sysconfdir=/etc/$pkgbase
2023-02-27 23:56:21 +00:00
--with-hwloc=external
--with-libevent=external
--with-pmix=external
2024-02-06 04:15:00 +00:00
--with-prrte=external
2023-02-27 23:56:21 +00:00
--with-valgrind
)
2024-02-06 04:15:00 +00:00
cd $pkgbase-$pkgver
2014-09-19 19:29:48 +00:00
2024-01-25 00:41:38 +00:00
# set environment variables for reproducible build
# see https://github.com/open-mpi/ompi/blob/main/docs/release-notes/general.rst
export HOSTNAME=buildhost
export USER=builduser
2023-12-29 20:54:01 +00:00
# TODO: remove ac_cv_func_sem_open=no when there is a glibc release fixing https://sourceware.org/bugzilla/show_bug.cgi?id=30789
ac_cv_func_sem_open=no ./configure "${configure_options[@]}"
2022-06-07 12:35:30 +00:00
# prevent excessive overlinking due to libtool
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make V=1
2014-09-19 19:29:48 +00:00
}
2014-09-29 15:51:13 +00:00
check() {
2024-02-06 04:15:00 +00:00
make check -C $pkgbase-$pkgver
}
package_openmpi() {
depends=(
gcc-libs
glibc
hwloc
2024-02-23 18:48:16 +00:00
libevent libevent_{core,pthreads}-2.1.so
2024-02-12 13:58:08 +00:00
libfabric
2024-02-06 04:15:00 +00:00
libnl
openpmix libpmix.so
2024-02-12 13:58:08 +00:00
prrte libprrte.so
2024-02-06 04:15:00 +00:00
zlib
)
optdepends=(
'gcc-fortran: fortran support'
2024-02-25 14:13:14 +00:00
'openssh: for execution on remote hosts via plm_ssh_agent'
2024-02-06 04:15:00 +00:00
)
provides=(
libmpi.so
libmpi_mpifh.so
libmpi_usempi_ignore_tkr.so
libmpi_usempif08.so
libopen-pal.so
2024-02-19 22:58:18 +00:00
liboshmem.so
2024-02-06 04:15:00 +00:00
)
2024-02-25 00:39:42 +00:00
backup=(etc/$pkgname/$pkgname-mca-params.conf)
2024-02-06 04:15:00 +00:00
make DESTDIR="$pkgdir" install -C $pkgbase-$pkgver
(
cd "$pkgdir"
_pick $pkgbase-docs usr/share/doc
)
install -Dm 644 $pkgbase-$pkgver/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
2014-09-29 15:51:13 +00:00
}
2024-02-06 04:15:00 +00:00
package_openmpi-docs() {
pkgdesc+=" - documentation"
2014-09-19 19:29:48 +00:00
2024-02-12 13:58:08 +00:00
mv -v $pkgname/* "$pkgdir"
2024-02-06 04:15:00 +00:00
install -vDm 644 $pkgbase-$pkgver/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
2014-09-19 19:29:48 +00:00
}
2017-09-13 19:28:17 +00:00
# vim: ts=2 sw=2 et: