python/cliff: update to 4.8.0
[oi-userland.git] / make-rules / mpi-macros.mk
blob9b0e02e33011813109eca353068dfb2609063d82
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
21 # Copyright (c) 2013-2017, Aurelien Larcher. All rights reserved.
24 MPI_IMPLEMENTATIONS_LIST = mpich openmpi
26 # Define compilers
27 MPI.mpich = mpich
29 MPICC.mpich = mpicc
30 MPICXX.mpich = mpicxx
31 MPIF77.mpich = mpif77
32 MPIFC.mpich = mpif90
34 MPI.openmpi = openmpi
36 MPICC.openmpi = mpicc
37 MPICXX.openmpi = mpicxx
38 MPIF77.openmpi = mpif77
39 MPIFC.openmpi = mpif90
41 # Default to mpich
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)
51 MPI_COMPILER_ROOT=
52 MPI_COMPILER_LIBDIR=
54 ifeq ($(strip $(MPI_COMPILER)),gcc)
56 MPI_COMPILER_ROOT=$(GCC_ROOT)
57 MPI_COMPILER_LIBDIR=$(MPI_COMPILER_ROOT)/lib/$(ARCHLIBSUBDIR$(BITS))
59 endif
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
103 BUILD_32=
104 BUILD_64=
106 $(BUILD_DIR_32)/%/.installed: BITS=32
107 $(BUILD_DIR_64)/%/.installed: BITS=64
109 INSTALL_32=
110 INSTALL_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
118 TEST_32=
119 TEST_64=
121 define mpi-rule
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
145 else
146 TEST_32+= $$(BUILD_DIR_32_$(1))/.tested-and-compared
147 TEST_64+= $$(BUILD_DIR_64_$(1))/.tested-and-compared
148 endif
150 endef
152 $(foreach mpi, $(COMPONENT_MPI_BUILD), $(eval $(call mpi-rule,$(mpi))))
154 endif
156 COMPONENT_MPI_BUILD_DIR= $(BUILD_DIR_$(BITS)_$(MPI_IMPLEMENTATION))