From: Cédric Aguerre Date: Tue, 18 Oct 2016 09:03:31 +0000 (+0200) Subject: Add -j build option X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=193d90418011670f38a977d1b85b3bb3c646a039;p=tools%2Fpvdeliv.git Add -j build option --- diff --git a/scripts/BuildSalomeMini.py b/scripts/BuildSalomeMini.py index f5c4e5c..bc75460 100755 --- a/scripts/BuildSalomeMini.py +++ b/scripts/BuildSalomeMini.py @@ -13,7 +13,7 @@ from salome_environ import accumulateEnv, generateFileEnv current_directory=os.path.dirname(os.path.abspath(__file__)) -def __init(envAcc={}, paraview_version=None, use_pleiade_mirrors=False): +def __init(envAcc={}, paraview_version=None, use_pleiade_mirrors=False, nb_jobs=None): # Read configuration filename=os.path.join(current_directory, "SalomeMiniConfig.cfg") config=read_config_file(filename) @@ -26,6 +26,9 @@ def __init(envAcc={}, paraview_version=None, use_pleiade_mirrors=False): config["use_pleiade_mirrors"] = use_pleiade_mirrors #update_config_file(filename, {"use_pleiade_mirrors": "yes"}) pass + if nb_jobs: + config["make_nb_jobs"] = nb_jobs + pass # Check system prerequisites check_gcc_version(config["gcc_version_min"], envAcc) # Download archives @@ -72,9 +75,9 @@ ENDIF() return os.path.abspath(destReal) #################### -def __let_us_go(paraview_version=None, use_pleiade_mirrors=False): +def __let_us_go(paraview_version=None, use_pleiade_mirrors=False, nb_jobs=None): envAcc={} - config=__init(paraview_version=paraview_version, use_pleiade_mirrors=use_pleiade_mirrors) + config=__init(paraview_version=paraview_version, use_pleiade_mirrors=use_pleiade_mirrors, nb_jobs=nb_jobs) # Prepare build rootDir="SalomeMini" @@ -162,6 +165,8 @@ def __parse_options(): parser = OptionParser() parser.add_option("--with-paraview-version", dest="paraview_version", help="Build a specific paraview version. Give the version number (e.g. 5.1) and a git sha1.", metavar="number,sha1") + parser.add_option("-j", dest="nb_jobs", + help="Specify the number of jobs to run simultaneously.", metavar="nb_jobs") parser.add_option("--pleiade", action="store_true", dest="pleiade", default=False, help="Use PLEIADE mirrors (for EDF).") @@ -175,6 +180,10 @@ if __name__ == "__main__": print "Unrecognized argument(s):", ",".join(args) sys.exit(1) + nb_jobs = None + if options.nb_jobs: + nb_jobs = int(options.nb_jobs) + paraview_version = None if options.paraview_version: try: @@ -184,4 +193,4 @@ if __name__ == "__main__": print "Syntax error in paraview version" sys.exit(1) - __let_us_go(paraview_version=paraview_version, use_pleiade_mirrors=options.pleiade) + __let_us_go(paraview_version=paraview_version, use_pleiade_mirrors=options.pleiade, nb_jobs=nb_jobs)