pullup 3232
[pkgsrcv2.git] / mk / mpi.buildlink3.mk
1 # $NetBSD$
2 #
3 # This Makefile fragment is meant to be included by packages
4 # that use any MPI implementation instead of one particular one.
5 # The available MPI implementations are "mpich" and "openmpi".
6 #
7 # === User-settable variables ===
8 #
9 # MPI_TYPE
10 #       This value represents the type of MPI we wish to use on the system.
11 #
12 #       Possible: mpich, openmpi
13 #       Default: mpich
14
15 .if !defined(MPI_BUILDLINK3_MK)
16 MPI_BUILDLINK3_MK=      # define it
17
18 .include "../../mk/bsd.prefs.mk"
19
20 # Try to find if we have anything installed already
21 .if exists($(LOCALBASE)/bin/mpicc)
22 _MPI_PACKAGE!=  $(PKG_INFO) -Q PKGPATH -F $(LOCALBASE)/bin/mpicc
23 MPI_TYPE?=      $(_MPI_PACKAGE:T)
24 .else
25
26 MPI_TYPE?=      mpich   # default to MPICH due to backward compatibility
27 .if $(MPI_TYPE) == "mpich"
28 _MPI_PACKAGE=   parallel/mpi-ch
29 .elif $(MPI_TYPE) == "openmpi"
30 _MPI_PACKAGE=   parallel/openmpi
31 .else # invalid or unimplemented type
32 PKG_FAIL_REASON=        \
33         "${MPI_TYPE} is not an acceptable MPI type for ${PKGNAME}."
34 .endif
35 .endif
36
37 .include "../../$(_MPI_PACKAGE)/buildlink3.mk"
38
39 .endif  # MPI_BUILDLINK3_MK