Files
ports/net/openmpi/Makefile
T
Laurent Chardon 5fd2f89be3 net/openmpi: Add modulefile
- Add modulefile
- Explicitely configure without ucx until ucx is ready (See PR 293793)
- Reformat Makefile with portfmt
- Bump PORTREVISION

PR:		295816
Reviewed by:	thierry (mentor)
Approved by:	thierry (mentor)
2026-06-04 05:58:23 -04:00

134 lines
3.8 KiB
Makefile

PORTNAME= openmpi
DISTVERSION= 5.0.10
PORTREVISION= 1
CATEGORIES= net parallel
MASTER_SITES= https://download.open-mpi.org/release/open-mpi/v${DISTVERSION:R}/
MAINTAINER= laurent@FreeBSD.org
COMMENT= High Performance Message Passing Library
WWW= https://www.open-mpi.org/
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
NOT_FOR_ARCHS= armv6 armv7 i386 powerpc
NOT_FOR_ARCHS_REASON= Not supported on 32-bits
LIB_DEPENDS= libevent.so:devel/libevent \
libhwloc.so:devel/hwloc2 \
libmunge.so:security/munge \
libpmix.so:net/pmix \
libprrte.so:net/prrte
# :keepla because port uses lt_dlopen
USES= compiler:c11 fortran gmake libtool:keepla localbase perl5 \
pkgconfig python:build shebangfix tar:bzip2
USE_LDCONFIG= ${PREFIX}/${MPIDIR}/lib
USE_PERL5= build
SHEBANG_FILES= ompi/mca/common/monitoring/aggregate_profile.pl \
ompi/mca/common/monitoring/profile2mat.pl
MPIBASE?= mpi
MPIDIR?= ${MPIBASE}/${PKGBASE}
GNU_CONFIGURE= yes
GNU_CONFIGURE_MANPREFIX= ${PREFIX}/${MPIDIR}/share
GNU_CONFIGURE_PREFIX= ${PREFIX}/${MPIDIR}
CONFIGURE_ARGS+= --enable-mca-no-build=verbs,btl_openib,oob_ud \
--enable-mpi-fortran=usempif08 \
--program-prefix= \
--with-hwloc=external \
--with-libevent=external \
--with-pmix=${LOCALBASE} \
--with-prrte=${LOCALBASE} \
--with-wrapper-ldflags=-Wl,-rpath=-Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER} \
--without-ofi \
--without-ucx
TEST_TARGET= check
CFLAGS+= ${CFLAGS_F2018}
LDFLAGS+= -lpthread
PIE_UNSAFE= yes
CONFLICTS_INSTALL= openmpi4-4*
DOCSDIR= ${PREFIX}/${MPIDIR}/share/doc
MANDIRS= ${PREFIX}/${MPIDIR}/share/man
BINARY_ALIAS= python3=${PYTHON_CMD}
SUB_FILES= ${PORTNAME}
SUB_LIST= DISTVERSION=${DISTVERSION} \
MPIDIR=${MPIDIR}
PLIST_SUB+= MPIDIR=${MPIDIR}
PORTDOCS= *
OPTIONS_DEFINE= AVX DEBUG DOCS IPV6 ROMIO SLURM
OPTIONS_DEFAULT= ROMIO SLURM
OPTIONS_EXCLUDE_aarch64= AVX
OPTIONS_EXCLUDE_armv6= AVX SLURM
OPTIONS_EXCLUDE_armv7= AVX SLURM
OPTIONS_EXCLUDE_i386= SLURM
OPTIONS_EXCLUDE_powerpc= AVX SLURM
OPTIONS_EXCLUDE_powerpc64= AVX
OPTIONS_EXCLUDE_powerpc64le= AVX
OPTIONS_EXCLUDE_riscv64= AVX
OPTIONS_SUB= yes
AVX_DESC= Enable AVX instructions
ROMIO_DESC= Enable romio mpi-io support
SLURM_DESC= Enable SLURM support
AVX_CONFIGURE_OFF= --enable-mca-no-build=op-avx
DEBUG_CONFIGURE_ENABLE= debug
DEBUG_INSTALL_TARGET_OFF= install-strip
DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}recommonmark>0:textproc/py-recommonmark@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sphinx>0:textproc/py-sphinx@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sphinx_rtd_theme>0:textproc/py-sphinx_rtd_theme@${PY_FLAVOR}
IPV6_CONFIGURE_ENABLE= ipv6
ROMIO_CONFIGURE_OFF= --disable-io-romio
SLURM_CONFIGURE_WITH= slurm
# Slurm integration in OpenMPI is handled through the PMIx interface
#SLURM_LIB_DEPENDS= libslurm.so:sysutils/slurm-wlm
.include <bsd.port.pre.mk>
.if ${FORTRAN_DEFAULT} == gfortran
FCFLAGS+= -fallow-argument-mismatch
# gfortran doesn't find libgfortran.spec on riscv64
.if ${ARCH} == "riscv64"
FCFLAGS+= -B${LOCALBASE}/lib/gcc${GCC_DEFAULT}
.endif
.endif
# Both clang and gcc support half precision on these platforms
# Note: RISC-V can support half precision with Zhf extension
.if ${ARCH:Maarch64} || ${ARCH:Mamd64}
PLIST_SUB+= SHORTFLOAT=""
.else
PLIST_SUB+= SHORTFLOAT="@comment "
.endif
# clang does not support 16 byte atomic operations without -mcx16 on amd64
# See https://github.com/open-mpi/ompi/issues/13134
.if ${ARCH} == amd64 && ${COMPILER_TYPE} == clang
CFLAGS+= -mcx16
.endif
LIBDIR2FIX= oshmem/tools/wrappers opal/tools/wrappers 3rd-party/openpmix \
ompi/tools/wrappers
pre-configure:
.for d in ${LIBDIR2FIX}
${REINPLACE_CMD} -e 's|$$(libdir)/pkgconfig|${LOCALBASE}/libdata/pkgconfig|g' \
${WRKSRC}/${d}/Makefile.in
.endfor
post-install:
${MKDIR} ${STAGEDIR}${PREFIX}/etc/modulefiles
${INSTALL_DATA} ${WRKDIR}/${PORTNAME} \
${STAGEDIR}${PREFIX}/etc/modulefiles/${PORTNAME}
.include <bsd.port.post.mk>