-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
112 lines (94 loc) · 2.5 KB
/
Makefile
File metadata and controls
112 lines (94 loc) · 2.5 KB
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
# This Makefile demonstrates the recommended way to build simple UPC++ programs.
# Note this uses some GNU make extensions for conciseness.
#
# To use this makefile, set the UPCXX_INSTALL variable to the upcxx install directory, e.g.
# make UPCXX_INSTALL=<myinstalldir> hello-world
# or (for bash)
# export UPCXX_INSTALL=<myinstalldir>; make hello-world
ifeq ($(UPCXX_INSTALL),)
$(warning UPCXX_INSTALL environment variable is not set, assuming upcxx is in the PATH)
UPCXX=upcxx
UPCXXRUN=upcxx-run
else
ifeq ($(wildcard $(UPCXX_INSTALL)/bin/upcxx),)
$(error Please set UPCXX_INSTALL=/path/to/upcxx/install)
else
UPCXX=$(UPCXX_INSTALL)/bin/upcxx
UPCXXRUN=$(UPCXX_INSTALL)/bin/upcxx-run
endif
endif
UPCXX_THREADMODE ?= seq
export UPCXX_THREADMODE
UPCXX_CODEMODE ?= debug
export UPCXX_CODEMODE
CXX = $(UPCXX)
CXXFLAGS = # optional command-line override
# Programs to build, assuming each has a corresponding *.cpp file
EXAMPLES = \
broadcast-example \
dmap-async-find-test \
dmap-async-insert-test \
dmap-atomics-test \
dmap-conjoined-test \
dmap-promises-test \
dmap-quiescence-test \
dmap-test \
hello-world \
local-team \
non-contig-example \
persona-example \
persona-example-rputs \
rb1d \
rb1d-rpc \
rb1d-rpcinit \
reduce-complex-minloc \
rput-rpc \
serial-custom \
serial-fields \
serial-recursive \
serial-values \
team_advanced \
team_create_sub \
team_simple \
view-accumulate \
view-histogram1 \
view-histogram2 \
view-matrix-tasks
CUDA_EXAMPLES = \
h-d \
h-d-remote
OPENMP_EXAMPLES = \
rpc-omp \
rput-omp
all: $(EXAMPLES)
cuda: $(CUDA_EXAMPLES)
openmp: $(OPENMP_EXAMPLES)
# The rule for building any example.
%: %.cpp $(wildcard *.h) $(wildcard *.hpp)
$(CXX) $@.cpp $(CXXFLAGS) -o $@
# Example-specific variable specializations.
PAR_EXAMPLES = \
persona-example \
persona-example-rputs \
view-matrix-tasks
$(PAR_EXAMPLES): UPCXX_THREADMODE=par
$(OPENMP_EXAMPLES): UPCXX_THREADMODE=par
$(OPENMP_EXAMPLES): CXXFLAGS+=-fopenmp
clean:
rm -Rf $(EXAMPLES) $(EXAMPLES:=.dSYM)
rm -Rf $(CUDA_EXAMPLES) $(CUDA_EXAMPLES:=.dSYM)
rm -Rf $(OPENMP_EXAMPLES) $(OPENMP_EXAMPLES:=.dSYM)
.PHONY: clean all run
PROCS ?= 4
ARGS ?=
LINE = =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
run:
@for file in $(EXAMPLES) ; do \
if test -x $$file ; then \
echo $(LINE) ; \
( set -x ; \
$(UPCXXRUN) -n $(PROCS) $$file $(ARGS) ; \
) ; \
echo $(LINE) ; \
fi ; \
done