To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

build.xml 18.1 KB
Newer Older
1
2
3
4
5
6
7
8
<!--
 * Copyright (c) 2009 The Australian National University.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Apache License v2.0.
 * You may obtain the license at
 * 
 *    http://www.opensource.org/licenses/apache2.0.php
 -->
9
<project name="DacapoBenchmarks" default="dist" basedir=".">
john's avatar
john committed
10
11
    <property name="toolsdir" location="../tools"/>
    <property name="log.dir" value="${basedir}/log"/>
John Zhang's avatar
John Zhang committed
12
    <property environment="env"/>
john's avatar
john committed
13
14
15
16
    <tstamp>
        <format property="build.time" pattern="yyyyMMdd-hhmm"/>
    </tstamp>
    <description>
jzigman's avatar
jzigman committed
17
            The DaCapo Benchmark Suite
18

steveb-oss's avatar
steveb-oss committed
19
DEPENDENCIES:
jzigman's avatar
jzigman committed
20
        
21
22
   - javacc (http://javacc.dev.java.net/)
   - maven  (http://maven.apache.org/)
Rui  Chen's avatar
Rui Chen committed
23
24
25
   - ant1.9 (http://ant.apache.org)   # note that builds will fail if ant 1.10 or later are used
   - csv (http:/www.nongnu.org/cvs/)
   - svn (http://subversion.apache.org)
26
27

For convinience, javacc and maven are included in the tools directory:
jzigman's avatar
jzigman committed
28
    ${toolsdir}
29

jzigman's avatar
jzigman committed
30
        
steveb-oss's avatar
steveb-oss committed
31
BUILDING:
32

Rui  Chen's avatar
Rui Chen committed
33
34
35
36
37
38
39
40
41
42
43
44
        1. Set your JAVA_HOME environment variable appropriately:
             On Mac OS X something like:
                  export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/
             On Ubuntu 16.04 something like:
                   export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_151/

        2. Set ant and maven environment variables if necessary.  In particular,
        for some jvms it is necessary to explicitly request a larger heap size.
        It is necessary to set the maven options because the trade benchmarks
        are built by maven (called by ant).  As another example, you may wish
        for ant to use a proxy when downloading (there is a lot to be
        downloaded).   Some examples:
45
46
            export ANT_OPTS="-Xms512M -Xmx512M"
            export MAVEN_OPTS="-Xms512M -Xmx512M"
Rui  Chen's avatar
Rui Chen committed
47
        or
48
49
            export ANT_OPTS="-Dhttp.proxyHost=xxx.xxx.xxx.xxx -Dhttp.proxyPort=3128"

Rui  Chen's avatar
Rui Chen committed
50
51
52
        3. Copy default.properties to local.properties and edit local.properties
        for your environment.

53
        4. Run ant:
Rui  Chen's avatar
Rui Chen committed
54
55
56
57
58
        ant         [builds all benchmarks]
        ant dist    [builds all benchmarks, this is the default]
        ant source  [builds a source distribution including benchmarks and tools]
        ant bm      [builds a specific benchmark, bm]

59
        5. A log of each directory is created under this benchmark directory
Rui  Chen's avatar
Rui Chen committed
60
61
62
63
64
65
66
67
68
        for benchmark build status and build success or failure files
        to be stored.  The directory log directory is normally of the
        form
        ${basedir}/log/${build.time}
        and contains status.txt where each benchmark build status is recorded,
        and either pass.txt if all benchmarks build, or fail.txt if one or
        more benchmarks fail to build. Note: that either fail.txt or pass.txt
        is created when a full build is performed.

steveb-oss's avatar
steveb-oss committed
69
</description>
70

john's avatar
john committed
71
72
73
74
75
76
77
78
    <property file="local.properties"/>
    <property file="default.properties"/>
    <property file="dacapo.properties"/>
    <property name="log.build.dir" value="${log.dir}/${build.time}"/>
    <property name="log.build.report" value="${log.dir}/${build.time}/status.txt"/>
    <property name="log.build.pass" value="${log.dir}/${build.time}/pass.txt"/>
    <property name="log.build.fail" value="${log.dir}/${build.time}/fail.txt"/>

79
    <property name="dacapo.build.dir" value="${basedir}/build"/>
80
81
82
	<property name="dacapo.build.doc.dir" value="${dacapo.build.dir}/doc"/>
	<property name="dacapo.doc.dir" value="${basedir}/doc"/>
	<property name="dacapo.src.dir" value="${basedir}/src"/>
83

John Zhang's avatar
John Zhang committed
84
85
86
    <target name="check-git-present">
        <available property="git.present" file="../.git" type="dir"/>
        <property name="git.exe" value="git"/>
john's avatar
john committed
87
88
    </target>

John Zhang's avatar
John Zhang committed
89
90
91
    <target name="extract-git-revision" depends="check-git-present" if="git.present">
        <exec executable="${git.exe}" failonerror="no" failifexecutionfails="no">
            <arg line="show --abbrev-commit HEAD"/>
John Zhang's avatar
John Zhang committed
92
            <redirector outputproperty="git.hash">
john's avatar
john committed
93
                <outputfilterchain>
John Zhang's avatar
John Zhang committed
94
95
96
                    <linecontainsregexp>
                        <regexp pattern="^commit [a-z0-9]+$"/>
                    </linecontainsregexp>
john's avatar
john committed
97
                    <tokenfilter>
John Zhang's avatar
John Zhang committed
98
                        <replacestring from="commit " to=""/>
john's avatar
john committed
99
100
101
102
103
104
                    </tokenfilter>
                </outputfilterchain>
            </redirector>
        </exec>
    </target>

John Zhang's avatar
John Zhang committed
105
    <target name="get-git-revision" depends="extract-git-revision" unless="git.hash">
john's avatar
john committed
106
        <!-- set property if not already set -->
John Zhang's avatar
John Zhang committed
107
        <property name="git.hash" value="unknown"/>
john's avatar
john committed
108
109
    </target>

John Zhang's avatar
John Zhang committed
110
    <target name="set-build-version-info" depends="get-git-revision">
John Zhang's avatar
John Zhang committed
111
        <property name="build.nickname" value="${dacapo.nickname}"/>
112
113
114
115
116
117
        <!-- overwritable with -Dbuild.is-official=true on commandline-->
        <condition property="build.version"
                    value="${dacapo.version}"
                    else="${dacapo.version}+${git.hash}">
            <isset property="build.is-official"/>
        </condition>
John Zhang's avatar
John Zhang committed
118
119
        <!-- set target jar name -->
        <property name="build.target-jar" value="dacapo-${build.version}.jar"/>
john's avatar
john committed
120
121
    </target>

122
123
124
125
126
127
128
129
130
131
132
133
134
135
    <target name="init" depends="set-build-version-info">
        <!-- Create the time stamp -->
        <tstamp/>
        <delete dir="${log.build.dir}" />
        <delete dir="${dacapo.build.doc.dir}"/>
        <delete dir="${dacapo.build.dir}" />

        <mkdir dir="${log.build.dir}" />
        <mkdir dir="${dacapo.build.dir}" />
        <mkdir dir="${dacapo.build.doc.dir}"/>
    	
        <echo>build.nickname=${build.nickname}</echo>
        <echo>build.version=${build.version}</echo>
    </target>
john's avatar
john committed
136
137
138
139

    <!-- BEGIN PUBLIC TARGETS -->

    <!-- =================================
140
141
         target: source
         ================================= -->
john's avatar
john committed
142
143
144
145
146
147
148
149
    <target name="source" depends="set-build-version-info">
        <echo file="SOURCE_VERSION.txt">This source distribution was built from DaCapo release ${build.version} "${build.nickname}"${line.separator}</echo>

        <zip destfile="dacapo-src.zip" level="9" whenempty="create">
            <zipfileset dir="${basedir}/.." defaultexcludes="yes" filemode="755">
                <include name="tools/*/bin/**"/>
            </zipfileset>
            <zipfileset dir="${basedir}/.." defaultexcludes="yes">
Rui  Chen's avatar
Rui Chen committed
150
151
152
153
154
155
                <!-- add readme etc -->
               <include name="README.md"/>
               <include name="LICENSE"/>
               <include name="benchmarks/doc/*"/>
               <include name="benchmarks/bms/*/doc/*"/>

john's avatar
john committed
156
157
158
159
160
161
162
163
164
165
                <!-- add source readme indicating where this is from -->
                <include name="benchmarks/SOURCE_VERSION.txt"/>

                <!-- benchmark top level source -->
                <include name="benchmarks/*.xml"/>
                <include name="benchmarks/dacapo.properties"/>
                <include name="benchmarks/default.properties"/>
                <include name="benchmarks/RELEASE_NOTES.txt"/>

                <!-- benchmark harness source -->
Rui  Chen's avatar
Rui Chen committed
166
167
                <include name="benchmarks/src/**"/>
                <include name="benchmarks/bms/*/harness/src/**"/>
john's avatar
john committed
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
                <include name="benchmarks/harness/*.xml"/>
                <include name="benchmarks/harness/downloads/**.MD5"/>
                <include name="benchmarks/harness/src/**"/>

                <!-- libs source -->
                <include name="benchmarks/libs/*.xml"/>
                <include name="benchmarks/libs/*/*.xml"/>
                <include name="benchmarks/libs/*/*.patch"/>
                <include name="benchmarks/libs/*/*.pl"/>
                <include name="benchmarks/libs/*/data/**"/>
                <include name="benchmarks/libs/*/downloads/**.MD5"/>
                <include name="benchmarks/libs/*/src/**"/>

                <!-- add benchmark xml -->
                <include name="benchmarks/bms/*.xml"/>

                <!-- add each benchmark -->
                <include name="benchmarks/bms/*/*.cnf"/>
                <include name="benchmarks/bms/*/*.patch"/>
                <include name="benchmarks/bms/*/*.xml"/>
                <include name="benchmarks/bms/*/*.properties"/>
                <include name="benchmarks/bms/*/META-INF/**"/>
                <include name="benchmarks/bms/*/data/**"/>
                <include name="benchmarks/bms/*/downloads/**.MD5"/>
                <include name="benchmarks/bms/*/src/**"/>

                <!-- add eclipse's plugin -->
                <include name="benchmarks/bms/eclipse/plugin/META-INF/**"/>
                <include name="benchmarks/bms/eclipse/plugin/src/**"/>
                <include name="benchmarks/bms/eclipse/plugin/*.xml"/>
                <include name="benchmarks/bms/eclipse/plugin/build.properties"/>
                <include name="benchmarks/bms/eclipse/plugin/javaCompiler...args"/>
                <include name="benchmarks/bms/eclipse/bundles-default.lst"/>
                <include name="benchmarks/bms/eclipse/bundles-required.lst"/>
                <include name="benchmarks/bms/eclipse/bundles-stub-required.lst"/>

Rui  Chen's avatar
Rui Chen committed
204
205
206
207
               <!-- add daytrader plugin -->
                <include name="benchmarks/libs/daytrader/plugins/**"/>
                <include name="benchmarks/libs/daytrader/daytrader/**"/>

john's avatar
john committed
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
                <!-- add tools -->
                <include name="tools/**"/>

                <!-- exclude svn -->
                <exclude name="benchmarks/**/.svn"/>

                <!-- exclude defunct benchmarks -->
                <exclude name="benchmarks/bms/antlr/**"/>
                <exclude name="benchmarks/bms/bloat/**"/>
                <exclude name="benchmarks/bms/chart/**"/>
                <exclude name="benchmarks/bms/hsqldb/**"/>
                <exclude name="tools/*/bin/**"/>
            </zipfileset>
        </zip>
    </target>

    <!-- ================================= 
225
226
         target: dist              
         ================================= -->
john's avatar
john committed
227
    <target name="dist" depends="harness,compile">
John Zhang's avatar
John Zhang committed
228
        <move file="${build.target-jar}" tofile="dacapo-${DSTAMP}.jar"/>
john's avatar
john committed
229
    </target>
230

231
232
233
    <target name="doc" depends="init,bootstrap,harness" description="make the top level documentation">
    	
    	<jar /> 
john's avatar
john committed
234
    </target>
235

236
	
237
238
239
240
    <!-- =================================
         target: bootstrap for running harness
         ================================= -->
    <target name="bootstrap" depends="init">
241
    	<!-- construct the bootstrap -->
242
243
        <javac srcdir="${dacapo.src.dir}" destdir="${dacapo.build.dir}"/>

244
245
246
247
248
249
    	<!-- set the manifest for the jar -->
        <copy file="${dacapo.src.dir}/META-INF/MANIFEST.MF" todir="${dacapo.build.dir}"/>
        <echo file="${dacapo.build.dir}/MANIFEST.MF" append="yes">Specification-Version: ${build.nickname}${line.separator}</echo>
        <echo file="${dacapo.build.dir}/MANIFEST.MF" append="yes">Implementation-Version: ${build.version}${line.separator}</echo>

    	<!-- form the top level info -->
John Zhang's avatar
John Zhang committed
250
251
        <copy file="${basedir}/../LICENSE" todir="${dacapo.build.dir}"/>
        <copy file="${basedir}/../README.md" todir="${dacapo.build.dir}"/>
252
253
        <copy file="${basedir}/RELEASE_NOTES.txt" todir="${dacapo.build.dir}"/>

254
    	<!-- this forms the base document section -->
John Zhang's avatar
John Zhang committed
255
256
        <copy file="${basedir}/../LICENSE" todir="${dacapo.build.dir}"/>
        <copy file="${basedir}/../README.md" todir="${dacapo.build.dir}"/>
257
258
259
260
261
		<copy file="${basedir}/RELEASE_NOTES.txt" todir="${dacapo.build.doc.dir}" />

		<copy todir="${dacapo.build.doc.dir}">
			<fileset dir="${dacapo.doc.dir}"/>
		</copy>
262

263
    	<!-- construct the base jar -->
John Zhang's avatar
John Zhang committed
264
        <jar jarfile="${build.target-jar}" basedir="${dacapo.build.dir}" update="false" manifest="${dacapo.build.dir}/MANIFEST.MF" excludes="MANIFEST.MF"/>
265
266
267
    </target>

    <target name="clean-bootstrap" depends="init">
268
        <delete dir="${dacpao.build.doc.dir}"/>
269
270
271
        <delete dir="${dacpao.build.dir}"/>
    </target>

john's avatar
john committed
272
    <!-- ================================= 
273
274
         target: compile  all sources
         ================================= -->
275
    <target name="compile" depends="avrora,batik,h2,eclipse,fop,jython,luindex,lusearch,lusearch-fix,pmd,sunflow,tradebeans,tradesoap,tomcat,xalan">
john's avatar
john committed
276
277
278
        <antcall target="build.status.fail" />
        <antcall target="build.status.pass" />
    </target>
279
	
john's avatar
john committed
280
    <!-- ================================= 
281
282
         target: harness           
         ================================= -->
283
    <target name="harness" depends="init,bootstrap" description="compile the source ">
john's avatar
john committed
284
285
        <ant antfile="harness/build.xml"/>
    </target>
286
	
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
    <target name="clean-harness" depends="init">
        <ant antfile="harness/build.xml" target="clean"/>
    </target>

    <!-- *************************************************************************** -->
    <!--                            Clean                                            -->
    <!-- *************************************************************************** -->

    <macrodef name="clean.bm">
        <attribute name="benchmark"/>
        <sequential>
            <exec executable="ant" failifexecutionfails="no" failonerror="no" resultproperty="clean-@{benchmark}-status">
                <arg value="-Dtoolsdir=${toolsdir}"/>
                <arg value="-Dbuild.time=${build.time}"/>
                <arg value="-Dlog.build.dir=${log.build.dir}"/>
                <arg value="-buildfile"/>
                <arg value="bms/@{benchmark}/build.xml"/>
                <arg value="clean"/>
            </exec>
        </sequential>
    </macrodef>
 
    <target name="clean-benchmarks" depends="init">
        <clean.bm benchmark="avrora"/>
        <clean.bm benchmark="batik"/>
        <clean.bm benchmark="h2"/>
        <clean.bm benchmark="eclipse"/>
        <clean.bm benchmark="fop"/>
        <clean.bm benchmark="jython"/>
        <clean.bm benchmark="luindex"/>
        <clean.bm benchmark="lusearch"/>
318
        <clean.bm benchmark="lusearch-fix"/>
319
320
321
322
323
324
325
326
327
328
        <clean.bm benchmark="pmd"/>
        <clean.bm benchmark="sunflow"/>
        <clean.bm benchmark="tomcat"/>
        <clean.bm benchmark="tradebeans"/>
        <clean.bm benchmark="tradesoap"/>
        <clean.bm benchmark="xalan"/>
    </target>

    <target name="clean" depends="clean-benchmarks,clean-harness,clean-bootstrap"/>
  
john's avatar
john committed
329
330
331
332
333
    <!-- *************************************************************************** -->
    <!--                            Build                                            -->
    <!-- *************************************************************************** -->
    <target name="build.status.fail" if="build.failed">
        <echo level="error">
334
335
build: FAIL
See ${log.build.report} for a summary of benchmark build status.
john's avatar
john committed
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
    </echo>
        <echo file="${log.build.fail}" level="error" message="build: FAIL${line.separator}"/>
    </target>

    <target name="build.status.pass" unless="build.failed">
        <echo level="error" message="build: PASS${line.separator}"/>
        <echo file="${log.build.pass}" level="error" message="build: PASS${line.separator}"/>
    </target>

    <macrodef name="build.bm">
        <attribute name="benchmark"/>
        <sequential>
            <exec executable="ant" failifexecutionfails="no" failonerror="no" resultproperty="@{benchmark}-status">
                <arg value="-Dtoolsdir=${toolsdir}"/>
                <arg value="-Dbuild.time=${build.time}"/>
                <arg value="-Dlog.build.dir=${log.build.dir}"/>
John Zhang's avatar
John Zhang committed
352
                <arg value="-Dbuild.target-jar=${build.target-jar}"/>
john's avatar
john committed
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
                <arg value="-buildfile"/>
                <arg value="bms/@{benchmark}/build.xml"/>
                <arg value="incremental"/>
            </exec>
            <condition property="@{benchmark}.failed">
                <isfailure code="${@{benchmark}-status}"/>
            </condition>
            <condition property="@{benchmark}.message" value="FAIL" else="PASS">
                <isset property="@{benchmark}.failed"/>
            </condition>
            <condition property="build.failed">
                <and>
                    <not>
                        <isset property="build.failed"/>
                    </not>
                    <isset property="@{benchmark}.failed"/>
                </and>
            </condition>
            <echo level="error" message="@{benchmark}: ${@{benchmark}.message}${line.separator}"/>
            <echo file="${log.build.report}" append="true" level="error" message="@{benchmark}: ${@{benchmark}.message}${line.separator}"/>
            <fail message="@{benchmark}: FAIL">
                <condition>
                    <and>
                        <istrue value="${build.failonerror}"/>
                        <isset property="@{benchmark}.failed"/>
                    </and>
                </condition>
            </fail>
        </sequential>
    </macrodef>

    <target name="avrora" depends="init,harness">
        <build.bm benchmark="avrora"/>
    </target>
    <target name="batik" depends="init,harness">
        <build.bm benchmark="batik"/>
    </target>
    <target name="h2" depends="init,harness">
        <build.bm benchmark="h2"/>
    </target>
    <target name="eclipse" depends="init,harness">
        <build.bm benchmark="eclipse"/>
    </target>
    <target name="fop" depends="init,harness">
        <build.bm benchmark="fop"/>
    </target>
    <target name="jython" depends="init,harness">
        <build.bm benchmark="jython"/>
    </target>
    <target name="luindex" depends="init,harness">
        <build.bm benchmark="luindex"/>
    </target>
    <target name="lusearch" depends="init,harness">
        <build.bm benchmark="lusearch"/>
    </target>
408
409
410
    <target name="lusearch-fix" depends="init,harness">
        <build.bm benchmark="lusearch-fix"/>
    </target>
john's avatar
john committed
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
    <target name="pmd" depends="init,harness">
        <build.bm benchmark="pmd"/>
    </target>
    <target name="sunflow" depends="init,harness">
        <build.bm benchmark="sunflow"/>
    </target>
    <target name="tomcat" depends="init,harness">
        <build.bm benchmark="tomcat"/>
    </target>
    <target name="tradebeans" depends="init,harness">
        <build.bm benchmark="tradebeans"/>
    </target>
    <target name="tradesoap" depends="init,harness">
        <build.bm benchmark="tradesoap"/>
    </target>
    <target name="xalan" depends="init,harness">
        <build.bm benchmark="xalan"/>
    </target>
429
</project>