Skip to content

Commit

Permalink
Add the -j option to diy
Browse files Browse the repository at this point in the history
  • Loading branch information
krafczyk committed Jan 7, 2017
1 parent fbcb722 commit a1681f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/spack/spack/cmd/diy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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.")
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a1681f8

Please sign in to comment.