1 |
|
# Copyright 1999-2024 Gentoo Authors
|
|
1 |
# Copyright 1999-2025 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
6 |
FORTRAN_NEEDED=fortran
|
7 |
|
inherit cuda flag-o-matic fortran-2 libtool multilib-minimal
|
|
7 |
inherit cuda flag-o-matic fortran-2 libtool
|
8 |
8 |
|
9 |
9 |
MY_P=${P/-mpi}
|
10 |
10 |
|
... | ... | |
16 |
16 |
openmpi_rm_pbs
|
17 |
17 |
openmpi_rm_slurm"
|
18 |
18 |
|
19 |
|
IUSE_OPENMPI_OFED_FEATURES="
|
20 |
|
openmpi_ofed_features_control-hdr-padding
|
21 |
|
openmpi_ofed_features_udcm
|
22 |
|
openmpi_ofed_features_rdmacm
|
23 |
|
openmpi_ofed_features_dynamic-sl"
|
24 |
|
|
25 |
19 |
DESCRIPTION="A high-performance message passing library (MPI)"
|
26 |
20 |
HOMEPAGE="https://www.open-mpi.org"
|
27 |
|
SRC_URI="https://download.open-mpi.org/release/open-mpi/v$(ver_cut 1-2)/${P}.tar.bz2"
|
|
21 |
SRC_URI="https://www.open-mpi.org/software/ompi/v$(ver_cut 1-2)/downloads/${MY_P}.tar.bz2"
|
28 |
22 |
S="${WORKDIR}/${MY_P}"
|
29 |
23 |
|
30 |
24 |
LICENSE="BSD"
|
31 |
25 |
SLOT="0"
|
32 |
|
KEYWORDS="~alpha amd64 arm arm64 ~loong ~ppc ppc64 ~riscv sparc x86 ~amd64-linux"
|
33 |
|
IUSE="cma cuda cxx fortran ipv6 libompitrace peruse romio valgrind
|
34 |
|
${IUSE_OPENMPI_FABRICS} ${IUSE_OPENMPI_RM} ${IUSE_OPENMPI_OFED_FEATURES}"
|
|
26 |
KEYWORDS="amd64 -arm arm64 -ppc ppc64 -x86 ~amd64-linux"
|
|
27 |
IUSE="cma cuda fortran ipv6 peruse romio valgrind
|
|
28 |
${IUSE_OPENMPI_FABRICS} ${IUSE_OPENMPI_RM}"
|
35 |
29 |
|
36 |
30 |
REQUIRED_USE="
|
37 |
31 |
openmpi_rm_slurm? ( !openmpi_rm_pbs )
|
38 |
32 |
openmpi_rm_pbs? ( !openmpi_rm_slurm )
|
39 |
|
openmpi_ofed_features_control-hdr-padding? ( openmpi_fabrics_ofed )
|
40 |
|
openmpi_ofed_features_udcm? ( openmpi_fabrics_ofed )
|
41 |
|
openmpi_ofed_features_rdmacm? ( openmpi_fabrics_ofed )
|
42 |
|
openmpi_ofed_features_dynamic-sl? ( openmpi_fabrics_ofed )"
|
|
33 |
"
|
43 |
34 |
|
44 |
35 |
RDEPEND="
|
45 |
36 |
!sys-cluster/mpich
|
46 |
37 |
!sys-cluster/mpich2
|
47 |
38 |
!sys-cluster/nullmpi
|
48 |
|
!sys-cluster/pmix
|
49 |
|
>=dev-libs/libevent-2.0.22:=[${MULTILIB_USEDEP},threads(+)]
|
50 |
|
dev-libs/libltdl:0[${MULTILIB_USEDEP}]
|
51 |
|
>=sys-apps/hwloc-2.0.2:=[${MULTILIB_USEDEP}]
|
52 |
|
>=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
|
|
39 |
>=dev-libs/libevent-2.0.22:=[threads(+)]
|
|
40 |
>=sys-apps/hwloc-2.0.2:=
|
|
41 |
sys-cluster/pmix:=
|
|
42 |
sys-cluster/prrte:=
|
|
43 |
>=sys-libs/zlib-1.2.8-r1
|
53 |
44 |
cuda? ( >=dev-util/nvidia-cuda-toolkit-6.5.19-r1:= )
|
54 |
45 |
openmpi_fabrics_ofed? ( sys-cluster/rdma-core )
|
55 |
46 |
openmpi_fabrics_knem? ( sys-cluster/knem )
|
56 |
47 |
openmpi_rm_pbs? ( sys-cluster/torque )
|
57 |
48 |
openmpi_rm_slurm? ( sys-cluster/slurm )
|
58 |
|
openmpi_ofed_features_rdmacm? ( sys-cluster/rdma-core )"
|
|
49 |
"
|
59 |
50 |
DEPEND="${RDEPEND}
|
60 |
51 |
valgrind? ( dev-debug/valgrind )"
|
61 |
52 |
|
62 |
|
MULTILIB_WRAPPED_HEADERS=(
|
63 |
|
/usr/include/mpi.h
|
64 |
|
/usr/include/openmpi/mpiext/mpiext_cuda_c.h
|
65 |
|
)
|
66 |
|
|
67 |
|
PATCHES=(
|
68 |
|
"${FILESDIR}/${PN}-4.1.6-incompatible-pointers.patch"
|
69 |
|
)
|
70 |
|
|
71 |
53 |
pkg_setup() {
|
72 |
54 |
fortran-2_pkg_setup
|
73 |
55 |
|
... | ... | |
91 |
73 |
>> opal/etc/openmpi-mca-params.conf || die
|
92 |
74 |
}
|
93 |
75 |
|
94 |
|
multilib_src_configure() {
|
|
76 |
src_configure() {
|
95 |
77 |
# -Werror=lto-type-mismatch, -Werror=strict-aliasing
|
96 |
78 |
# The former even prevents successfully running ./configure, but both appear
|
97 |
79 |
# at `make` time as well.
|
... | ... | |
108 |
90 |
# https://github.com/open-mpi/ompi/blob/9eec56222a5c98d13790c9ee74877f1562ac27e8/config/opal_config_subdir.m4#L118
|
109 |
91 |
# so no --cache-dir for now.
|
110 |
92 |
--enable-mpi-fortran=$(usex fortran all no)
|
111 |
|
--enable-orterun-prefix-by-default
|
|
93 |
--enable-prte-prefix-by-default
|
112 |
94 |
--enable-pretty-print-stacktrace
|
113 |
95 |
|
114 |
96 |
--sysconfdir="${EPREFIX}/etc/${PN}"
|
115 |
97 |
|
116 |
|
--with-hwloc="${EPREFIX}/usr"
|
117 |
|
--with-hwloc-libdir="${EPREFIX}/usr/$(get_libdir)"
|
118 |
|
--with-libltdl="${EPREFIX}/usr"
|
119 |
|
--with-libevent="${EPREFIX}/usr"
|
120 |
|
--with-libevent-libdir="${EPREFIX}/usr/$(get_libdir)"
|
121 |
|
# unkeyworded, lacks multilib. Do not automagically build against it.
|
122 |
|
--with-pmix=internal
|
|
98 |
--with-hwloc=external
|
|
99 |
--with-libevent=external
|
|
100 |
--with-prrte=external
|
123 |
101 |
|
124 |
|
# Re-enable for 5.0!
|
|
102 |
# Oiriginally supposed to be re-enabled for 5.0!
|
125 |
103 |
# See https://github.com/open-mpi/ompi/issues/9697#issuecomment-1003746357
|
126 |
104 |
# and https://bugs.gentoo.org/828123#c14
|
|
105 |
#
|
|
106 |
# However as of 5.0.3 the docs still say:
|
|
107 |
#
|
|
108 |
# As such, supporting data heterogeneity is a feature that has fallen
|
|
109 |
# into disrepair and is currently known to be broken in this release
|
|
110 |
# of Open MPI.
|
127 |
111 |
--disable-heterogeneous
|
128 |
112 |
|
129 |
|
$(use_enable cxx mpi-cxx)
|
130 |
113 |
$(use_enable ipv6)
|
131 |
|
$(use_enable libompitrace)
|
132 |
114 |
$(use_enable peruse)
|
133 |
115 |
$(use_enable romio io-romio)
|
134 |
116 |
|
135 |
117 |
$(use_with cma)
|
136 |
118 |
|
137 |
|
$(multilib_native_use_enable openmpi_ofed_features_control-hdr-padding openib-control-hdr-padding)
|
138 |
|
$(multilib_native_use_enable openmpi_ofed_features_rdmacm openib-rdmacm)
|
139 |
|
$(multilib_native_use_enable openmpi_ofed_features_udcm openib-udcm)
|
140 |
|
$(multilib_native_use_enable openmpi_ofed_features_dynamic-sl openib-dynamic-sl)
|
141 |
|
|
142 |
|
$(multilib_native_use_with cuda cuda "${EPREFIX}"/opt/cuda)
|
143 |
|
$(multilib_native_use_with valgrind)
|
144 |
|
$(multilib_native_use_with openmpi_fabrics_ofed verbs "${EPREFIX}"/usr)
|
145 |
|
$(multilib_native_use_with openmpi_fabrics_knem knem "${EPREFIX}"/usr)
|
146 |
|
$(multilib_native_use_with openmpi_rm_pbs tm)
|
147 |
|
$(multilib_native_use_with openmpi_rm_slurm slurm)
|
|
119 |
$(use_with cuda cuda "${EPREFIX}"/opt/cuda)
|
|
120 |
$(use_with valgrind)
|
|
121 |
$(use_with openmpi_fabrics_knem knem "${EPREFIX}"/usr)
|
|
122 |
$(use_with openmpi_rm_pbs tm)
|
|
123 |
$(use_with openmpi_rm_slurm slurm)
|
148 |
124 |
)
|
149 |
125 |
|
150 |
|
CONFIG_SHELL="${BROOT}"/bin/bash ECONF_SOURCE="${S}" econf "${myconf[@]}"
|
|
126 |
CONFIG_SHELL="${BROOT}"/bin/bash econf "${myconf[@]}"
|
151 |
127 |
}
|
152 |
128 |
|
153 |
|
multilib_src_compile() {
|
|
129 |
src_compile() {
|
154 |
130 |
emake V=1
|
155 |
131 |
}
|
156 |
132 |
|
157 |
|
multilib_src_test() {
|
|
133 |
src_test() {
|
158 |
134 |
emake -C test check
|
159 |
135 |
}
|
160 |
136 |
|
161 |
|
multilib_src_install() {
|
|
137 |
src_install() {
|
162 |
138 |
default
|
163 |
139 |
|
164 |
|
# fortran header cannot be wrapped (bug #540508), workaround part 1
|
165 |
|
if multilib_is_native_abi && use fortran; then
|
166 |
|
mkdir "${T}"/fortran || die
|
167 |
|
mv "${ED}"/usr/include/mpif* "${T}"/fortran || die
|
168 |
|
else
|
169 |
|
# some fortran files get installed unconditionally
|
170 |
|
rm \
|
171 |
|
"${ED}"/usr/include/mpif* \
|
172 |
|
"${ED}"/usr/bin/mpif* \
|
173 |
|
|| die
|
174 |
|
fi
|
175 |
|
}
|
176 |
|
|
177 |
|
multilib_src_install_all() {
|
178 |
|
# fortran header cannot be wrapped (bug #540508), workaround part 2
|
179 |
|
if use fortran; then
|
180 |
|
mv "${T}"/fortran/mpif* "${ED}"/usr/include || die
|
181 |
|
fi
|
182 |
|
|
183 |
140 |
# Remove la files, no static libs are installed and we have pkg-config
|
184 |
141 |
find "${ED}" -name '*.la' -delete || die
|
185 |
|
|
186 |
|
einstalldocs
|
187 |
142 |
}
|