Chromium Code Reviews| Index: pydir/szbuild_spec2k.py |
| diff --git a/pydir/szbuild_spec2k.py b/pydir/szbuild_spec2k.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..7d65d072c8c569bb4fe271b99ac65801eabd0276 |
| --- /dev/null |
| +++ b/pydir/szbuild_spec2k.py |
| @@ -0,0 +1,43 @@ |
| +#!/usr/bin/env python2 |
| + |
| +import argparse |
| +import os |
| + |
| +import szbuild |
| + |
| +from utils import FindBaseNaCl |
| + |
| +def main(): |
| + """Build native gcc-style executables for one or all Spec2K components. |
| + |
| + Afterwards, the executables can be run from the |
| + native_client/tests/spec2k/ directory as: |
| + './run_all.sh RunBenchmarks SetupGccX8632Opt {train|ref} ...' |
| + """ |
| + nacl_root = FindBaseNaCl() |
| + components = [ '164.gzip', '175.vpr', '176.gcc', '177.mesa', '179.art', |
| + '181.mcf', '183.equake', '186.crafty', '188.ammp', |
| + '197.parser', '252.eon', '253.perlbmk', '254.gap', |
| + '255.vortex', '256.bzip2', '300.twolf' ] |
| + |
| + argparser = argparse.ArgumentParser(description=main.__doc__) |
| + szbuild.AddOptionalArgs(argparser) |
| + argparser.add_argument('comps', nargs='*', default=components) |
| + args = argparser.parse_args() |
| + for comp in args.comps: |
| + if comp not in components: |
| + print 'Ignoring unknown component ' + comp |
|
jvoung (off chromium)
2014/09/17 15:29:09
If it's useful, could make this a strict error?
Jim Stichnoth
2014/09/17 16:18:21
Done. It now computes the complete set of unknown
|
| + continue |
| + name = os.path.splitext(comp)[1] or comp |
| + if name[0] == '.': |
| + name = name[1:] |
| + szbuild.ProcessPexe(args, |
| + ('{root}/tests/spec2k/{comp}/' + |
| + '{name}.opt.stripped.pexe' |
| + ).format(root=nacl_root, comp=comp, name=name), |
| + ('{root}/tests/spec2k/{comp}/' + |
| + '{name}.gcc.opt.x8632' |
| + ).format(root=nacl_root, comp=comp, name=name)) |
| + |
| +if __name__ == '__main__': |
| + main() |