2021-05-11 23:30:57 +02:00
|
|
|
# $NetBSD: mpi.buildlink3.mk,v 1.6 2021/05/11 21:30:57 thor Exp $
|
2010-05-16 13:07:39 +02:00
|
|
|
#
|
|
|
|
# This Makefile fragment is meant to be included by packages
|
|
|
|
# that use any MPI implementation instead of one particular one.
|
2021-05-11 23:30:57 +02:00
|
|
|
# The available MPI implementations are "mpich" and "openmpi",
|
|
|
|
# or just whatever you have installed in the system (mpi wrapper
|
|
|
|
# compiler names are standardized).
|
|
|
|
#
|
|
|
|
# You have to decide on one implementation and stick to it. Especially
|
|
|
|
# with the native option, installing an MPI implementation from pkgsrc
|
|
|
|
# will break things for programs that you built before.
|
2010-05-16 13:07:39 +02:00
|
|
|
#
|
2019-09-02 04:23:02 +02:00
|
|
|
# User-settable variables:
|
2010-05-16 13:07:39 +02:00
|
|
|
#
|
|
|
|
# MPI_TYPE
|
|
|
|
# This value represents the type of MPI we wish to use on the system.
|
2021-05-11 23:30:57 +02:00
|
|
|
# Changing this value is only safe when you ensure that all MPI-using
|
|
|
|
# packages are re-built, and if switching to native, the MPI package
|
|
|
|
# from pkgsrc needs to be deinstalled first.
|
2010-05-16 13:07:39 +02:00
|
|
|
#
|
2021-05-11 23:30:57 +02:00
|
|
|
# Possible: mpich, openmpi, native
|
2010-05-16 13:07:39 +02:00
|
|
|
# Default: mpich
|
|
|
|
|
|
|
|
.if !defined(MPI_BUILDLINK3_MK)
|
|
|
|
MPI_BUILDLINK3_MK= # define it
|
|
|
|
|
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
|
|
|
# Try to find if we have anything installed already
|
2019-04-20 18:32:42 +02:00
|
|
|
.if exists(${LOCALBASE}/bin/mpicc)
|
2021-05-11 23:30:57 +02:00
|
|
|
_INST_MPI_PACKAGE!= ${PKG_INFO} -Q PKGPATH -F ${LOCALBASE}/bin/mpicc
|
|
|
|
MPI_TYPE?= ${_INST_MPI_PACKAGE:T:S/-//}
|
|
|
|
.endif
|
2010-05-16 13:07:39 +02:00
|
|
|
|
|
|
|
MPI_TYPE?= mpich # default to MPICH due to backward compatibility
|
2021-05-11 23:30:57 +02:00
|
|
|
.if ${MPI_TYPE} == "native"
|
|
|
|
. if exists(${LOCALBASE}/bin/mpicc)
|
|
|
|
PKG_FAIL_REASON+= \
|
|
|
|
"MPI installed from pkgsrc conflicts with native. Deinstall ${_INST_MPI_PACKAGE}."
|
|
|
|
. endif
|
|
|
|
.elif ${MPI_TYPE} == "mpich"
|
2010-05-16 13:07:39 +02:00
|
|
|
_MPI_PACKAGE= parallel/mpi-ch
|
2019-04-20 18:32:42 +02:00
|
|
|
.elif ${MPI_TYPE} == "openmpi"
|
2010-05-16 13:07:39 +02:00
|
|
|
_MPI_PACKAGE= parallel/openmpi
|
|
|
|
.else # invalid or unimplemented type
|
2016-04-11 06:22:33 +02:00
|
|
|
PKG_FAIL_REASON+= \
|
2010-05-16 13:07:39 +02:00
|
|
|
"${MPI_TYPE} is not an acceptable MPI type for ${PKGNAME}."
|
|
|
|
.endif
|
|
|
|
|
2021-05-11 23:30:57 +02:00
|
|
|
.if defined(_MPI_PACKAGE)
|
|
|
|
. if !defined(_INST_MPI_PACKAGE) || ${_INST_MPI_PACKAGE} == ${_MPI_PACKAGE}
|
2019-04-20 18:32:42 +02:00
|
|
|
.include "../../${_MPI_PACKAGE}/buildlink3.mk"
|
2021-05-11 23:30:57 +02:00
|
|
|
. else
|
|
|
|
PKG_FAIL_REASON+= \
|
|
|
|
"Attempt to switch MPI type to ${MPI_TYPE} conflicting with installed ${_INST_MPI_PACKAGE}."
|
|
|
|
. endif
|
|
|
|
.endif
|
2010-05-16 13:07:39 +02:00
|
|
|
|
|
|
|
.endif # MPI_BUILDLINK3_MK
|