tech-pkg archive

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

[new patch] Re: Allow 'native' option to mk/ to use the system's MPI implementation


here is an updated version of the patch after some comments by wiz.

It now detects settings that are inconsistent and would break things

Any further comments? Fine to commit?

Alrighty then,


Dr. Thomas Orgis
HPC @ Universität Hamburg
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/	11 May 2021 14:55:27 -0000
@@ -2,14 +2,23 @@
 # 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).
+# 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.
 # User-settable variables:
 #	This value represents the type of MPI we wish to use on the system.
+#       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.
-#	Possible: mpich, openmpi
+#	Possible: mpich, openmpi, native
 #	Default: mpich
 .if !defined(MPI_BUILDLINK3_MK)
@@ -19,12 +28,17 @@
 # Try to find if we have anything installed already
 .if exists(${LOCALBASE}/bin/mpicc)
 MPI_TYPE?=	mpich	# default to MPICH due to backward compatibility
-.if ${MPI_TYPE} == "mpich"
+.if ${MPI_TYPE} == "native"
+.  if exists(${LOCALBASE}/bin/mpicc)
+	"MPI installed from pkgsrc conflicts with native. Deinstall ${_INST_MPI_PACKAGE}."
+.  endif
+.elif ${MPI_TYPE} == "mpich"
 _MPI_PACKAGE=	parallel/mpi-ch
 .elif ${MPI_TYPE} == "openmpi"
 _MPI_PACKAGE=	parallel/openmpi
@@ -32,8 +46,14 @@
 	"${MPI_TYPE} is not an acceptable MPI type for ${PKGNAME}."
+.if defined(_MPI_PACKAGE)
+.  if !defined(_INST_MPI_PACKAGE) || ${_INST_MPI_PACKAGE} == ${_MPI_PACKAGE}
 .include "../../${_MPI_PACKAGE}/"
+.  else
+	"Attempt to switch MPI type to ${MPI_TYPE} conflicting with installed ${_INST_MPI_PACKAGE}."
+.  endif

Home | Main Index | Thread Index | Old Index