[zorg] r239191 - jenkins: Make LLVM_PARALLEL_LINK_JOBS configurable
Justin Bogner
mail at justinbogner.com
Fri Jun 5 14:30:44 PDT 2015
Author: bogner
Date: Fri Jun 5 16:30:44 2015
New Revision: 239191
URL: http://llvm.org/viewvc/llvm-project?rev=239191&view=rev
Log:
jenkins: Make LLVM_PARALLEL_LINK_JOBS configurable
We hardcoded LLVM_PARALLEL_LINK_JOBS to 1 for LTO builds since we'll
generally run out of memory trying to link things concurrently
otherwise, but in some cases we may want to be more specific. Add a
flag for that.
This also fixes another cmake config test to actually run, since it
wasn't failing after my change even though I needed to change it.
Modified:
zorg/trunk/test/jenkins/test_build.py
zorg/trunk/zorg/jenkins/build.py
Modified: zorg/trunk/test/jenkins/test_build.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/test/jenkins/test_build.py?rev=239191&r1=239190&r2=239191&view=diff
==============================================================================
--- zorg/trunk/test/jenkins/test_build.py (original)
+++ zorg/trunk/test/jenkins/test_build.py Fri Jun 5 16:30:44 2015
@@ -114,12 +114,18 @@
# RUN: cd %t.SANDBOX; python %{src_root}/zorg/jenkins/build.py derive-llvm+clang
# RUN: cd %t.SANDBOX; python %{src_root}/zorg/jenkins/build.py derive-llvm
-# RUN: python %{src_root}/zorg/jenkins/build.py cmake all --lto > %t-cmake-lto.log
-# RUN: FileCheck --check-prefix CHECK-CMAKE < %t-cmake.log %s
+# RUN: python %{src_root}/zorg/jenkins/build.py cmake all --lto | FileCheck --check-prefix CHECK-CMAKELTO %s
# CHECK-CMAKELTO: '/usr/local/bin/cmake' '-G' 'Ninja'
# CHECK-CMAKELTO: '-DCMAKE_C_FLAGS=-flto' '-DCMAKE_CXX_FLAGS=-flto'
-# CHECK-CMAKELTO: '-DLLVM_PARALLEL_LINK_JOBS=1'
# CHECK-CMAKELTO: '-DLLVM_BUILD_EXAMPLES=Off'
+# CHECK-CMAKELTO: '-DLLVM_PARALLEL_LINK_JOBS=1'
# CHECK-CMAKELTO: '-DCMAKE_BUILD_TYPE=Release'
+# RUN: env MAX_PARALLEL_LINKS=2 python %{src_root}/zorg/jenkins/build.py cmake all --lto | FileCheck --check-prefix CHECK-CMAKE-PAR-LTO %s
+# CHECK-CMAKE-PAR-LTO: '/usr/local/bin/cmake' '-G' 'Ninja'
+# CHECK-CMAKE-PAR-LTO: '-DCMAKE_C_FLAGS=-flto' '-DCMAKE_CXX_FLAGS=-flto'
+# CHECK-CMAKE-PAR-LTO: '-DLLVM_BUILD_EXAMPLES=Off'
+# CHECK-CMAKE-PAR-LTO: '-DLLVM_PARALLEL_LINK_JOBS=2'
+# CHECK-CMAKE-PAR-LTO: '-DCMAKE_BUILD_TYPE=Release'
+
# RUN: python %{src_root}/zorg/jenkins/build.py cmake all --cmake-type=RelWithDebugInfo
Modified: zorg/trunk/zorg/jenkins/build.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/build.py?rev=239191&r1=239190&r2=239191&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/build.py (original)
+++ zorg/trunk/zorg/jenkins/build.py Fri Jun 5 16:30:44 2015
@@ -51,6 +51,7 @@ class Configuration(object):
self._lldb_build_dir = os.environ.get('LLDB_BUILD_DIR', 'lldb-build')
self._install_dir = os.environ.get('BUILD_DIR', 'clang-install')
self.j_level = os.environ.get('J_LEVEL', None)
+ self.max_parallel_links = os.environ.get('MAX_PARALLEL_LINKS', None)
self.host_compiler_url = os.environ.get('HOST_URL',
'http://labmaster2.local/artifacts/')
self.artifact_url = os.environ.get('ARTIFACT', 'NONE')
@@ -119,14 +120,19 @@ def cmake_builder(target):
cmake_cmd = env + ["/usr/local/bin/cmake", "-G", "Ninja",
"-DCMAKE_INSTALL_PREFIX=" + conf.installdir(),
conf.srcdir()]
+
+ max_parallel_links = conf.max_parallel_links
if conf.lto:
cmake_cmd += ["-DCMAKE_C_FLAGS=-flto", "-DCMAKE_CXX_FLAGS=-flto"]
- # TODO: We limit LTO links to 1. Should this be configurable?
- cmake_cmd += ["-DLLVM_PARALLEL_LINK_JOBS=1"]
cmake_cmd += ['-DLLVM_BUILD_EXAMPLES=Off']
+ if not max_parallel_links:
+ max_parallel_links = 1
else:
cmake_cmd += ['-DLLVM_BUILD_EXAMPLES=On']
+ if max_parallel_links is not None:
+ cmake_cmd += ["-DLLVM_PARALLEL_LINK_JOBS={}".format(max_parallel_links)]
+
if conf.CC():
cmake_cmd += ['-DCMAKE_C_COMPILER=' + conf.CC(),
'-DCMAKE_CXX_COMPILER=' + conf.CC() + "++"]
More information about the llvm-commits
mailing list