]> SALOME platform Git repositories - tools/pvdeliv.git/commitdiff
Salome HOME
Add -j build option
authorCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 18 Oct 2016 09:03:31 +0000 (11:03 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 18 Oct 2016 09:03:31 +0000 (11:03 +0200)
scripts/BuildSalomeMini.py

index f5c4e5c09ce8c2ae1be2b0e8884d571708ec1c26..bc75460c7cc90b677b7e90268a60c059b556ea33 100755 (executable)
@@ -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)