File: Makefile

package info (click to toggle)
opa-ff 10.8.0.0.201%2Bdfsg.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 18,080 kB
  • sloc: ansic: 203,006; sh: 24,754; perl: 14,685; exp: 8,412; makefile: 5,185; xml: 189; cpp: 93; tcl: 50; python: 44
file content (253 lines) | stat: -rw-r--r-- 7,901 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# BEGIN_ICS_COPYRIGHT8 ****************************************
# 
# Copyright (c) 2015, Intel Corporation
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 
#     * Redistributions of source code must retain the above copyright notice,
#       this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of Intel Corporation nor the names of its contributors
#       may be used to endorse or promote products derived from this software
#       without specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 
# END_ICS_COPYRIGHT8   ****************************************

# Makefile for MPI application/benchmark source for end user system
# targets:
# 	full 	- build all targets.
#   basic   - build all applications provivded in opa-fastfabric package
# 	quick 	- build commonly used apps.
# 	all		- synonym for quick
# 	clobber - remove all built files.
#
# 	The following targets build the matching applications. If the
# 	application name differs from the target name, it is listed
# 	in parens.
#
# 	GROUPSTRESS	
# 	DEVIATION
# 	LAT (latency)
#	BW (bandwidth)
#	MULTIBW (multi-pair bandwidth)
#	OSU2 (version 2 of osu_latency, osu_bw, osu_bcast, osu_bibw)
#	OSU2_MPI2 (version 2 of osu MPI2 benchmarks)
#	OSU38 (version 3.8 of the OSU benchmarks)
#	IMB/PMB (Pallas)
#	XHPL2 (hpl v2)
#

ifndef MPICH_PREFIX
export MPICH_PREFIX=$(shell . ./select_mpi 2>/dev/null; echo $$MPICH_PREFIX)
endif

# set MPICC to our own mpicc warpper that will change the real mpicc to use RPATH
# so that our MPI Apps will stick with the mpi we selected during build.
# if you want the default RUNPATH, you can set MPICC before calling the Makefile
ifndef MPICC
export REAL_MPICC=$(MPICH_PREFIX)/bin/mpicc
export MPICC=$(PWD)/mpicc
endif
ifndef MPIF77
export REAL_MPIF77=$(MPICH_PREFIX)/bin/mpif77
export MPIF77=$(PWD)/mpif77
endif
ifndef MPI_INCLUDE_DIR
export MPI_INCLUDE_DIR=$(MPICH_PREFIX)/include
endif
ifndef MPI_LIB_DIR
export MPI_LIB_DIR=/lib
endif

all:: INCLUDES LIBS CMDS
.PHONY: all

CHECK: SHOWMPI
	@echo "Building MPI Check..."
	export HOME_DIR=$(PWD); \
	make -C mpicheck
	@echo
.PHONY: CHECK

GROUPSTRESS: SHOWMPI
	@echo "Building groupstress..."
	export HOME_DIR=$(PWD); \
	make -C groupstress
	@echo
.PHONY: GROUPSTRESS
DEVIATION: SHOWMPI
	@echo "Building deviation..."
	export HOME_DIR=$(PWD); \
	make -C deviation
	@echo
.PHONY: DEVIATION

NVIDIA: SHOWMPI
	@echo "Building nvidia test apps..."
	export HOME_DIR=$(PWD); \
	make -C nvidia
	@echo
.PHONY: NVIDIA

LAT: SHOWMPI
	@echo "Building OSU latency..."
	cd latency;\
	$(MPICC) -I$(MPI_INCLUDE_DIR) -o latency latency.c;
	@echo
.PHONY: LAT

BW: SHOWMPI
	@echo "Building OSU bandwidth..."
	cd bandwidth;\
	$(MPICC) -I$(MPI_INCLUDE_DIR) -o bw bw.c;
	@echo
.PHONY: BW

MULTIBW: SHOWMPI
	@echo "Building multi bandwidth..."
	cd mpi_multibw;\
	$(MPICC) -I$(MPI_INCLUDE_DIR) -o mpi_multibw mpi_multibw.c;
	@echo
.PHONY: MUTLIBW

OSU2: SHOWMPI
	@echo "Building OSU 2.0 benchmarks..."
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_latency osu_latency.c
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_bw osu_bw.c
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_bcast osu_bcast.c
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_bibw osu_bibw.c
	@echo
.PHONY: OSU2

OSU38: SHOWMPI
	@echo "Building OSU 3.8 benchmarks..."
	cd osu-micro-benchmarks-3.8-July12; ./configure CC=$(MPICC); make
	@echo
.PHONY: OSU38

OSU2_MPI2: SHOWMPI
	@echo "Building OSU 2.0 benchmarks for MPI2..."
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_acc_latency osu_acc_latency.c
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_get_latency osu_get_latency.c
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_put_latency osu_put_latency.c
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_get_bw osu_get_bw.c
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_put_bw osu_put_bw.c
	cd osu2; $(MPICC) -I$(MPI_INCLUDE_DIR) -o osu_put_bibw osu_put_bibw.c
	@echo
.PHONY: OSU2_MPI2

IMB: SHOWMPI
	@echo "Building Intel Micro Benchmarks 4.0.2..."
	cd imb/src; make MPI_HOME=$(MPICH_PREFIX) CC=$(MPICC) -f make_mpich
	@echo
.PHONY: IMB

XHPL2: SHOWMPI
	@echo "Building HPL 2.2 (Linpack)..."
	export HPL_HOME_DIR=$(PWD)/hpl-2.2;\
	make -C hpl-2.2 arch=ICS.`uname -s`.`./get_mpi_cc.sh`
	@echo
.PHONY: XHPL2

# PGFILE_TEST is not included in the stock mpi_apps package.
PGFILE: SHOWMPI
	@echo "Building pgfile test..."
	export HOME_DIR=$(PWD); make -C pgfile_test;
	@echo
.PHONY: PGFILE

# TACHYON is not included in the stock mpi_apps package.
TACHYON: SHOWMPI
	@echo "Building Tachyon demo..."
	rm -rf tachyon/compile/*
	if [ -f $(MPICH_PREFIX)/lib/libmpich.a -o -f $(MPICH_PREFIX)/lib/shared/libmpich.so ] ; then export MPICH_LIB='-lmpich'; fi 
	make -C tachyon/unix linux-vapi
	cp tachyon/compile/linux-vapi/tachyon tachyon/scenes
	@echo
.PHONY: TACHYON

# MANDEL is not included in the stock mpi_apps package.
MANDEL: SHOWMPI
	@echo "Building Mandel demo..."
	make -C mandel clean
	make -C mandel
	@echo
.PHONY: MANDEL

cleandepend clean:: clobber
.PHONY: cleandepend clean

clobber::
	rm -f latency/*.o latency/*.d latency/latency
	rm -f bandwidth/*.o bandwidth/*.d bandwidth/bw
	if [ -d "PMB2.2.1" ]; then make -C PMB2.2.1/SRC_PMB clean; fi
	if [ -f "imb/src/make_mpich" ]; then cd imb/src; make MPI_HOME=$(MPICH_PREFIX) -f make_mpich clean; fi
	if [ -d hpl-2.2 ]; then find hpl-2.2 -name ICS.`uname -s`.* | xargs rm -rf; rm -rf hpl-2.2/bin hpl-2.2/lib; fi
	if [ -d hpl-2.2 ]; then find hpl-2.2 -name xerbla.o | xargs rm -rf; fi
	if [ -d pgfile_test ]; then make -C pgfile_test clean; fi
	if [ -d tachyon ]; then rm -rf tachyon/compile/*; fi
	if [ -d mandel ]; then make -C mandel clean; rm -f mandel/*.d; fi
	make -C mpicheck clean;
	make -C deviation clean;
	make -C groupstress clean;
	rm -f mpi_multibw/mpi_multibw mpi_multibw/*.o
	rm -f osu2/*.o
	rm -f osu2/osu_latency osu2/osu_bw osu2/osu_bcast osu2/osu_bibw
	rm -f osu2/osu_acc_latency osu2/osu_get_latency osu2/osu_put_latency
	rm -f osu2/osu_get_bw osu2/osu_put_bw osu2/osu_put_bibw
	if [ -f "osu-micro-benchmarks-3.8-July12/Makefile" ]; then cd osu-micro-benchmarks-3.8-July12; make clean; fi
	rm -f .prefix
.PHONY: clobber

SHOWMPI:
	@echo "Using MPICH_PREFIX=$(MPICH_PREFIX)"
	echo "$(MPICH_PREFIX)" > .prefix
.PHONY: SHOWMPI

depend::
force::
INCLUDES::
# do the real work during LIBS
LIBS:: 
.PHONY: depend force INCLUDES LIBS

opa-base:: DEVIATION CHECK GROUPSTRESS
	@echo "build base sample applications"
.PHONY: opa-base

quick:: BW LAT MULTIBW OSU2 OSU38 IMB XHPL2 opa-base
	@echo "Built subset of sample applications"
.PHONY: quick

CMDS:: quick
	@echo "Built sample applications"
.PHONY: CMDS

full:: CMDS
	@echo "Built full set of sample applications"
.PHONY: full

STAGE::
INSTALL::

RUNTEST::
build_dsfiles::
clobber_dsfiles::
lint::
cflow::

.PHONY: STAGE INSTALL RUNTEST build_dsfiles clobber_dsfiles lint cflow