4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
21 # Copyright (c) 2013-2017, Aurelien Larcher. All rights reserved.
24 MPI_IMPLEMENTATIONS_LIST
= mpich openmpi
37 MPICXX.openmpi
= mpicxx
38 MPIF77.openmpi
= mpif77
39 MPIFC.openmpi
= mpif90
42 MPI_IMPLEMENTATION ?
= $(MPI.mpich
)
44 MPICC
= $(MPICC.
$(MPI_IMPLEMENTATION
))
45 MPICXX
= $(MPICXX.
$(MPI_IMPLEMENTATION
))
46 MPIF77
= $(MPIF77.
$(MPI_IMPLEMENTATION
))
47 MPIFC
= $(MPIFC.
$(MPI_IMPLEMENTATION
))
49 # Define compiler enviromnent
50 MPI_COMPILER
= $(COMPILER
)
54 ifeq ($(strip $(MPI_COMPILER
)),gcc
)
56 MPI_COMPILER_ROOT
=$(GCC_ROOT
)
57 MPI_COMPILER_LIBDIR
=$(MPI_COMPILER_ROOT
)/lib
/$(ARCHLIBSUBDIR
$(BITS
))
61 # Define implementation specific paths
62 MPI_BUNDLE
= $(MPI_IMPLEMENTATION
)-$(MPI_COMPILER
)
64 MPI_PREFIX
.32 = $(USRLIBDIR
)/$(MPI_IMPLEMENTATION
)/$(MPI_COMPILER
)
65 MPI_PREFIX
.64 = $(USRLIBDIR64
)/$(MPI_IMPLEMENTATION
)/$(MPI_COMPILER
)
66 MPI_PREFIX
= $(MPI_PREFIX.
$(BITS
))
68 MPI_BINDIR
.32 = $(MPI_PREFIX
.32)/bin
69 MPI_BINDIR
.64 = $(MPI_PREFIX
.64)/bin
70 MPI_BINDIR
= $(MPI_BINDIR.
$(BITS
))
72 MPI_SBINDIR
.32 = $(MPI_PREFIX
.32)/sbin
73 MPI_SBINDIR
.64 = $(MPI_PREFIX
.64)/sbin
74 MPI_SBINDIR
= $(MPI_SBINDIR.
$(BITS
))
76 MPI_LIBDIR
.32 = $(MPI_PREFIX
.32)/lib
77 MPI_LIBDIR
.64 = $(MPI_PREFIX
.64)/lib
78 MPI_LIBDIR
= $(MPI_LIBDIR.
$(BITS
))
80 MPI_ETCDIR
.32 = $(MPI_PREFIX
.32)/etc
81 MPI_ETCDIR
.64 = $(MPI_PREFIX
.64)/etc
82 MPI_ETCDIR
= $(MPI_ETCDIR.
$(BITS
))
84 MPI_INCDIR
= $(USRINCDIR
)/$(MPI_IMPLEMENTATION
)
86 MPI_SHAREDIR
= $(USRSHAREDIR
)
87 MPI_DATADIR
= $(MPI_SHAREDIR
)/$(MPI_IMPLEMENTATION
)
88 MPI_DOCDIR
= $(USRSHAREDOCDIR
)/$(MPI_IMPLEMENTATION
)
89 MPI_HTMLDIR
= $(USRSHAREDOCDIR
)/www
90 MPI_MANDIR
= $(USRSHAREMANDIR
)
93 # Create meta rule to trigger build for each listed implementation
95 ifneq ($(strip $(COMPONENT_MPI_BUILD
)),)
97 $(BUILD_DIR_32
)/%/.configured
: BITS
=32
98 $(BUILD_DIR_64
)/%/.configured
: BITS
=64
100 $(BUILD_DIR_32
)/%/.built
: BITS
=32
101 $(BUILD_DIR_64
)/%/.built
: BITS
=64
106 $(BUILD_DIR_32
)/%/.installed
: BITS
=32
107 $(BUILD_DIR_64
)/%/.installed
: BITS
=64
112 $(BUILD_DIR_32
)/%/.tested
: BITS
=32
113 $(BUILD_DIR_64
)/%/.tested
: BITS
=64
115 $(BUILD_DIR_32
)/%/.tested-and-compared
: BITS
=32
116 $(BUILD_DIR_64
)/%/.tested-and-compared
: BITS
=64
123 BUILD_DIR_32_
$(1) = $$(BUILD_DIR
)/$$(MACH32
)/$(1)
124 BUILD_DIR_64_
$(1) = $$(BUILD_DIR
)/$$(MACH64
)/$(1)
126 $(BUILD_DIR
)/%/$(1)/.configured
: MPI_IMPLEMENTATION
=$(1)
128 $(BUILD_DIR
)/%/$(1)/.built
: MPI_IMPLEMENTATION
=$(1)
130 BUILD_32
+= $$(BUILD_DIR_32_
$(1))/.built
131 BUILD_64
+= $$(BUILD_DIR_64_
$(1))/.built
133 $(BUILD_DIR
)/%/$(1)/.installed
: MPI_IMPLEMENTATION
=$(1)
135 INSTALL_32
+= $$(BUILD_DIR_32_
$(1))/.installed
136 INSTALL_64
+= $$(BUILD_DIR_64_
$(1))/.installed
138 $(BUILD_DIR
)/%/$(1)/.tested
: MPI_IMPLEMENTATION
=$(1)
140 $(BUILD_DIR
)/%/$(1)/.tested-and-compared
: MPI_IMPLEMENTATION
=$(1)
142 ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR
)/results-
*.master
)),)
143 TEST_32
+= $$(BUILD_DIR_32_
$(1))/.tested
144 TEST_64
+= $$(BUILD_DIR_64_
$(1))/.tested
146 TEST_32
+= $$(BUILD_DIR_32_
$(1))/.tested-and-compared
147 TEST_64
+= $$(BUILD_DIR_64_
$(1))/.tested-and-compared
152 $(foreach mpi
, $(COMPONENT_MPI_BUILD
), $(eval
$(call mpi-rule
,$(mpi
))))
156 COMPONENT_MPI_BUILD_DIR
= $(BUILD_DIR_
$(BITS
)_
$(MPI_IMPLEMENTATION
))