diff --git a/lib/spack/spack/cmd/diy.py b/lib/spack/spack/cmd/diy.py index 5a8ec255e2ea44..1e5de1b7b99a2b 100644 --- a/lib/spack/spack/cmd/diy.py +++ b/lib/spack/spack/cmd/diy.py @@ -38,6 +38,9 @@ def setup_parser(subparser): + subparser.add_argument( + '-j', '--jobs', action='store', type=int, + help="Explicitly set number of make jobs. Default is #cpus.") subparser.add_argument( '-d', '--source-path', dest='source_path', help="Path to the source directory. Defaults to the current directory") @@ -65,6 +68,10 @@ def diy(self, args): if not args.spec: tty.die("spack diy requires a package spec argument.") + if args.jobs is not None: + if args.jobs <= 0: + tty.die("The -j option must be a positive integer!") + specs = spack.cmd.parse_specs(args.spec) if len(specs) > 1: tty.die("spack diy only takes one spec.") @@ -108,6 +115,7 @@ def diy(self, args): spack.do_checksum = False package.do_install( + make_jobs=args.jobs, keep_prefix=args.keep_prefix, install_deps=not args.ignore_deps, verbose=not args.quiet,