Marcel Telka
2024-04-08 e44703e81887ee34cdaa681246ff7cb2065cc027
commit | author | age
db0c73 1 #
AL 2 # CDDL HEADER START
3 #
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.
7 #
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.
12 #
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]
18 #
19 # CDDL HEADER END
20 #
9ec9c2 21 # Copyright (c) 2013-2017, Aurelien Larcher. All rights reserved.
db0c73 22 #
AL 23
b55e44 24 MPI_IMPLEMENTATIONS_LIST = mpich openmpi
AL 25
9ec9c2 26 # Define compilers
db0c73 27 MPI.mpich =         mpich
AL 28
29 MPICC.mpich =       mpicc
30 MPICXX.mpich =      mpicxx
31 MPIF77.mpich =      mpif77
32 MPIFC.mpich =       mpif90
33
34 MPI.openmpi =       openmpi
35
b55e44 36 MPICC.openmpi =     mpicc
AL 37 MPICXX.openmpi =    mpicxx
38 MPIF77.openmpi =    mpif77
39 MPIFC.openmpi =     mpif90
40
db0c73 41 # Default to mpich
AL 42 MPI_IMPLEMENTATION ?= $(MPI.mpich)
43
b55e44 44 MPICC =             $(MPICC.$(MPI_IMPLEMENTATION))
AL 45 MPICXX =            $(MPICXX.$(MPI_IMPLEMENTATION))
46 MPIF77 =            $(MPIF77.$(MPI_IMPLEMENTATION))
47 MPIFC =             $(MPIFC.$(MPI_IMPLEMENTATION))
db0c73 48
3ef317 49 # Define compiler enviromnent
AL 50 MPI_COMPILER = $(COMPILER)
51 MPI_COMPILER_ROOT=
52 MPI_COMPILER_LIBDIR=
53
54 ifeq ($(strip $(MPI_COMPILER)),gcc)
55
56 MPI_COMPILER_ROOT=$(GCC_ROOT)
57 MPI_COMPILER_LIBDIR=$(MPI_COMPILER_ROOT)/lib/$(ARCHLIBSUBDIR$(BITS))
58
59 endif
60
61 # Define implementation specific paths
9ec9c2 62 MPI_BUNDLE =        $(MPI_IMPLEMENTATION)-$(MPI_COMPILER)
AL 63
64 MPI_PREFIX.32 =     $(USRLIBDIR)/$(MPI_IMPLEMENTATION)/$(MPI_COMPILER)
65 MPI_PREFIX.64 =     $(USRLIBDIR64)/$(MPI_IMPLEMENTATION)/$(MPI_COMPILER)
3ef317 66 MPI_PREFIX    =        $(MPI_PREFIX.$(BITS))
db0c73 67
b55e44 68 MPI_BINDIR.32 =     $(MPI_PREFIX.32)/bin
AL 69 MPI_BINDIR.64 =     $(MPI_PREFIX.64)/bin
db0c73 70 MPI_BINDIR    =     $(MPI_BINDIR.$(BITS))
AL 71
b55e44 72 MPI_SBINDIR.32 =     $(MPI_PREFIX.32)/sbin
AL 73 MPI_SBINDIR.64 =     $(MPI_PREFIX.64)/sbin
db0c73 74 MPI_SBINDIR    =     $(MPI_SBINDIR.$(BITS))
AL 75
b55e44 76 MPI_LIBDIR.32 =     $(MPI_PREFIX.32)/lib
AL 77 MPI_LIBDIR.64 =     $(MPI_PREFIX.64)/lib
3ef317 78 MPI_LIBDIR    =     $(MPI_LIBDIR.$(BITS))
db0c73 79
b55e44 80 MPI_ETCDIR.32 =     $(MPI_PREFIX.32)/etc
AL 81 MPI_ETCDIR.64 =     $(MPI_PREFIX.64)/etc
3ef317 82 MPI_ETCDIR    =     $(MPI_ETCDIR.$(BITS))
db0c73 83
AL 84 MPI_INCDIR =        $(USRINCDIR)/$(MPI_IMPLEMENTATION)
85
86 MPI_SHAREDIR =      $(USRSHAREDIR)
3ef317 87 MPI_DATADIR  =      $(MPI_SHAREDIR)/$(MPI_IMPLEMENTATION)
AL 88 MPI_DOCDIR   =      $(USRSHAREDOCDIR)/$(MPI_IMPLEMENTATION)
89 MPI_HTMLDIR  =      $(USRSHAREDOCDIR)/www
90 MPI_MANDIR   =      $(USRSHAREMANDIR)
91
db0c73 92
9ec9c2 93 # Create meta rule to trigger build for each listed implementation
db0c73 94
9ec9c2 95 ifneq ($(strip $(COMPONENT_MPI_BUILD)),)
AL 96
97 $(BUILD_DIR_32)/%/.configured:    BITS=32
98 $(BUILD_DIR_64)/%/.configured:    BITS=64
99
100 $(BUILD_DIR_32)/%/.built:    BITS=32
101 $(BUILD_DIR_64)/%/.built:    BITS=64
102
103 BUILD_32=
104 BUILD_64=
105
106 $(BUILD_DIR_32)/%/.installed: BITS=32
107 $(BUILD_DIR_64)/%/.installed: BITS=64
108
109 INSTALL_32=
110 INSTALL_64=
111
112 $(BUILD_DIR_32)/%/.tested:        BITS=32
113 $(BUILD_DIR_64)/%/.tested:        BITS=64
114
115 $(BUILD_DIR_32)/%/.tested-and-compared:        BITS=32
116 $(BUILD_DIR_64)/%/.tested-and-compared:        BITS=64
117
118 TEST_32=
119 TEST_64=
120
121 define mpi-rule
122
123 BUILD_DIR_32_$(1) =    $$(BUILD_DIR)/$$(MACH32)/$(1)
124 BUILD_DIR_64_$(1) =    $$(BUILD_DIR)/$$(MACH64)/$(1)
125
126 $(BUILD_DIR)/%/$(1)/.configured:  MPI_IMPLEMENTATION=$(1)
127
128 $(BUILD_DIR)/%/$(1)/.built:       MPI_IMPLEMENTATION=$(1)
129
130 BUILD_32+= $$(BUILD_DIR_32_$(1))/.built
131 BUILD_64+= $$(BUILD_DIR_64_$(1))/.built
132
133 $(BUILD_DIR)/%/$(1)/.installed:   MPI_IMPLEMENTATION=$(1)
134
135 INSTALL_32+= $$(BUILD_DIR_32_$(1))/.installed
136 INSTALL_64+= $$(BUILD_DIR_64_$(1))/.installed
137
138 $(BUILD_DIR)/%/$(1)/.tested:      MPI_IMPLEMENTATION=$(1)
139
140 $(BUILD_DIR)/%/$(1)/.tested-and-compared:      MPI_IMPLEMENTATION=$(1)
141
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
149
150 endef
151
152 $(foreach mpi, $(COMPONENT_MPI_BUILD), $(eval $(call mpi-rule,$(mpi))))
153
154 endif
3ef317 155
AL 156 COMPONENT_MPI_BUILD_DIR= $(BUILD_DIR_$(BITS)_$(MPI_IMPLEMENTATION))