6d4be320ba474e5c41d54ccefa304ca216ec4662
[IRC.git] / Robust / src / Benchmarks / oooJava / master-makefile
1 ##########################################################################
2 #
3 #  This master makefile shoudl be included in each local makefile of a
4 #  benchmark directory.  The local makefile should define PROGRAM as
5 #  the name of the class with the main method, which also becomes the
6 #  name of the output binary.  The local makefile should also declare
7 #  SOURCE_FILES with whatever Java files should be compiled
8 #
9 ##########################################################################
10
11
12 BUILDSCRIPT=../../../buildscript
13
14
15 COREPROFOVERFLOW= #-coreprof-checkoverflow
16 USECOREPROF= #-coreprof $(COREPROFOVERFLOW) \
17         -coreprof-eventwords 1024*1024*128 \
18         -coreprof-enable cpe_main \
19         -coreprof-enable cpe_taskexecute \
20         -coreprof-enable cpe_taskdispatch \
21         -coreprof-enable cpe_rcr_traverse
22 #       -coreprof-enable cpe_runmalloc \
23 #       -coreprof-enable cpe_taskretire \
24         -coreprof-enable cpe_workschedsubmit \
25         -coreprof-enable cpe_workschedgrab \
26         -coreprof-enable cpe_poolalloc \
27         -coreprof-enable cpe_preparememq \
28         -coreprof-enable cpe_runfree \
29         -coreprof-enable cpe_count_poolalloc \
30         -coreprof-enable cpe_count_poolreuse \
31         -coreprof-enable cpe_taskstallvar \
32         -coreprof-enable cpe_taskstallmem
33
34
35 USEOOO= -ooojava $(NUM_OOO_WORKERS) 2      -squeue #-ooodebug-disable-task-mem-pool
36 USERCR= -ooojava $(NUM_RCR_WORKERS) 2 -rcr -squeue -ooodebug
37 OOODEBUG= -ooodebug -printlinenum
38 RCRDEBUG= -rcr_debug -printlinenum
39 RCRDEBUGV= -rcr_debug_verbose -printlinenum
40 BSFLAGS= -64bit -mainclass $(PROGRAM)  -heapsize-mb 5000 -garbagestats -joptimize -noloop -optimize -nolock -debug #-nooptimize #src-after-pp
41
42
43 CHECKPOINTSTO= -printlinenum -pointsto-check-v-runtime -debug
44
45
46 DRELEASEMODE=-disjoint-release-mode -disjoint-dvisit-stack-callees-on-top -disjoint-alias-file aliases.txt tabbed
47 DISJOINT= -disjoint -disjoint-k 1 -enable-assertions $(DRELEASEMODE) #-disjoint-desire-determinism 
48
49
50 #####################################
51 #
52 #  There are a lot of options for
53 #  output and debugging disjoint
54 #  reachability analysis:
55 #
56 #####################################
57
58 # -disjoint-write-dots final (get the final reach graph for each method, or use "all" instead of "final" to get every updated result)
59 # -disjoint-write-ihms       (get the initial heap model (IHM) for callees to see what the analysis started with, and which call sites contributed)
60 # -disjoint-debug-scheduling (use to get messages about WHY a method is rescheduled for analysis)
61
62 # to use -disjoint-debug-callsite flag, arguments are:
63 # 1. callee symbol, ex: MainClass.foo() has symbol "foo"
64 # 2. caller symbol
65 # 3. numCallSiteVisitsToSkip, the analysis sometimes revisits a call site many, MANY times, but usually use 1
66 # 4. numCallSiteVisitsToCapture, if you choose a really high number you'll get every visit, could be a lot
67 # 5. true/false, whether to immediately halt compiler after number of visits specified have been captured
68 # EX:
69 # -disjoint-debug-callsite foo main 1 1 true
70
71 # to use -disjoint-debug-snap-method, arguments are:
72 # 1. method symbol to take program point snapshots of
73 # 2. numVisitsToSkip, sometimes the early visits tell you nothing, context is too empty
74 # 3. numVisitsToCapture
75 # 4. true/false, halt compiler after number of specified visits are captured
76 # EX: (skip first 10 visits, capture the next 3, then halt)
77 # -disjoint-debug-snap-method Remove 10 3 true
78
79 DISJOINTDEBUG= -disjoint -disjoint-k 1 -enable-assertions
80 #       -disjoint-debug-callsite RayTracer.trace RayTracer.shade 10000 1 true
81 #       -disjoint-write-dots final \
82 #       -flatirusermethods \
83 #       -disjoint-write-ihms \
84 #       -disjoint-write-initial-contexts \
85 #       -disjoint-debug-snap-method RayTracer.shade 300 999 true
86 #       -disjoint-debug-snap-method String.indexOf 1 1000 true
87 #       -disjoint-debug-callsite String.concat2 FileInputStream.readLine 1 1000 true \
88 #       -disjoint-debug-snap-method String.concat2 1 1000 true
89 #       -disjoint-debug-snap-method FileInputStream.readLine 1 1000 true
90 #       -disjoint-write-all-node-graphs
91 #
92 #       -justanalyze \
93 #       -disjoint-debug-callsite String.toString String.valueOf 1 1000 true \
94 #       -disjoint-debug-scheduling \
95 #       -disjoint-desire-determinism
96 #       -disjoint-debug-callsite Demand.add Lateral.compute 1 1000 true
97 #       -disjoint-debug-snap-method ComputeCenterOfMass 6 2 true
98
99
100
101
102 default:
103         $(BUILDSCRIPT) -nojava $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(DISJOINT) -o $(PROGRAM)p -builddir par  $(SOURCE_FILES)
104
105 single-remake-c:
106         $(BUILDSCRIPT) -nojava -thread $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) -o $(PROGRAM)s -builddir sing $(SOURCE_FILES) 
107
108 rcr-remake-c:
109         $(BUILDSCRIPT) -nojava $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
110
111 check-remake-c:
112         $(BUILDSCRIPT) -nojava $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(DISJOINTDEBUG) $(CHECKPOINTSTO) -o $(PROGRAM)c -builddir chk $(SOURCE_FILES)
113
114
115
116 single: $(PROGRAM)s.bin
117
118 $(PROGRAM)s.bin: $(SOURCE_FILES) ../master-makefile
119         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) -o $(PROGRAM)s -builddir sing $(SOURCE_FILES)
120
121
122 check-pointsto: $(PROGRAM)c.bin
123
124 $(PROGRAM)c.bin: $(SOURCE_FILES) ../master-makefile
125         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(DISJOINTDEBUG) $(CHECKPOINTSTO) -o $(PROGRAM)c -builddir chk $(SOURCE_FILES)
126
127
128
129 ooo: $(PROGRAM)p.bin
130
131 $(PROGRAM)p.bin: $(SOURCE_FILES) ../master-makefile
132         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(DISJOINT) -o $(PROGRAM)p -builddir par  $(SOURCE_FILES) 
133
134 ooo-debug: $(SOURCE_FILES) ../master-makefile
135         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(OOODEBUG) $(DISJOINT) -o $(PROGRAM)p -builddir par  $(SOURCE_FILES) 
136
137
138 disjoint-debug: $(SOURCE_FILES) ../master-makefile
139         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(DISJOINTDEBUG) -o $(PROGRAM)p -builddir par  $(SOURCE_FILES)
140
141 rcr: $(SOURCE_FILES) ../master-makefile
142         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
143
144
145 rcrpointer: $(SOURCE_FILES) ../master-makefile
146         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USERCR) -pointer $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
147
148 rcr-debug: $(SOURCE_FILES) ../master-makefile
149         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(OOODEBUG) $(RCRDEBUG) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
150
151 rcrpointer-debug: $(SOURCE_FILES) ../master-makefile
152         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USERCR) -pointer $(OOODEBUG) $(RCRDEBUG) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
153
154
155 rcr-debug-v: $(SOURCE_FILES) ../master-makefile
156         $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(RCRDEBUGV) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
157
158 clean:
159         rm -f  $(PROGRAM)p.bin $(PROGRAM)s.bin $(PROGRAM)r.bin $(PROGRAM)c.bin
160         rm -fr par sing rcr chk
161         rm -f tmp.c
162         rm -f  *~
163         rm -f  *.dot
164         rm -f  *.png
165         rm -f  *.txt
166         rm -f  aliases.txt
167         rm -f  mlpReport*txt
168         rm -f  results*txt
169         rm -f *log
170         rm -f coreprof.dat
171         rm -f trace.out