Skip to content

Commit

Permalink
DEV: allow parallel build in runtests.py
Browse files Browse the repository at this point in the history
Add a '-j' / '--parallel' option to runtests.py, to run the compilation step
using multiple processes.  This could later be enhanced to allow parallel
testing.
  • Loading branch information
pitrou committed Sep 2, 2015
1 parent 1bd6c31 commit da54c08
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtests.py
Expand Up @@ -99,6 +99,8 @@ def main(argv):
help="Start Unix shell with PYTHONPATH set")
parser.add_argument("--debug", "-g", action="store_true",
help="Debug build")
parser.add_argument("--parallel", "-j", type=int, default=0,
help="Number of parallel jobs during build")
parser.add_argument("--show-build-log", action="store_true",
help="Show build output rather than using a log file")
parser.add_argument("--bench", action="store_true",
Expand Down Expand Up @@ -337,8 +339,10 @@ def build_project(args):
env['F90'] = 'gfortran --coverage '
env['LDSHARED'] = cvars['LDSHARED'] + ' --coverage'
env['LDFLAGS'] = " ".join(cvars['LDSHARED'].split()[1:]) + ' --coverage'
cmd += ["build"]

cmd += ["build"]
if args.parallel > 1:
cmd += ["-j", str(args.parallel)]
cmd += ['install', '--prefix=' + dst_dir]

log_filename = os.path.join(ROOT_DIR, 'build.log')
Expand Down

0 comments on commit da54c08

Please sign in to comment.