tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Allow 'native' option to mk/ to use the system's MPI implementation


I want to (again?) put forward a patch of mine that I use since day one
in HPC. We install the C/C++/Fortran toolchain together with MPI
libraries before then installing software from pkgsrc.

So I added MPI_TYPE=native that basically makes mk/ do
nothing and have the builds use the mpicc and friends found in PATH
from the system (or our toolchain installs, respectively).

Are there opinions for/against this? I hope that it doens't hurt anyone
and would like to get rid of this old add-on patch by committing it to

The reason not to mangle this into builtin logic for openmpi or mpich
is that our external MPI does not necessarily correspond to either of
those. The standard interface to link to MPI is to call the compiler
wrappers that are available without any further work on the side of

Alrighty then,


Dr. Thomas Orgis
HPC @ Universität Hamburg
? wip
? pkgtools/digest/work
? x11/qt5-qtbase/.Makefile.swp
? x11/qt5-qtbase/build.log
Index: mk/
RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.5
diff -u -r1.5
--- mk/	2 Sep 2019 02:23:02 -0000	1.5
+++ mk/	10 May 2021 10:49:08 -0000
@@ -2,14 +2,16 @@
 # This Makefile fragment is meant to be included by packages
 # that use any MPI implementation instead of one particular one.
-# The available MPI implementations are "mpich" and "openmpi".
+# The available MPI implementations are "mpich" and "openmpi",
+# or just whatever you have installed in the system (mpi wrapper
+# compiler names are standardized).
 # User-settable variables:
 #	This value represents the type of MPI we wish to use on the system.
-#	Possible: mpich, openmpi
+#	Possible: mpich, openmpi, native
 #	Default: mpich
 .if !defined(MPI_BUILDLINK3_MK)
@@ -21,10 +23,12 @@
 .if exists(${LOCALBASE}/bin/mpicc)
 MPI_TYPE?=	mpich	# default to MPICH due to backward compatibility
-.if ${MPI_TYPE} == "mpich"
+.if ${MPI_TYPE} == "native"
+# nothing
+.elif ${MPI_TYPE} == "mpich"
 _MPI_PACKAGE=	parallel/mpi-ch
 .elif ${MPI_TYPE} == "openmpi"
 _MPI_PACKAGE=	parallel/openmpi
@@ -32,8 +36,9 @@
 	"${MPI_TYPE} is not an acceptable MPI type for ${PKGNAME}."
+.if defined(_MPI_PACKAGE)
 .include "../../${_MPI_PACKAGE}/"

Home | Main Index | Thread Index | Old Index