aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2016-09-15 16:10:44 +0300
committerDiana Picus <diana.picus@linaro.org>2016-09-15 18:47:28 +0300
commit0df000143b9e24ea3c50b4fd3bf2ccfaf181206d (patch)
tree2a2e5bc025c9cd58d2291764e3f283dca8d304fa
parentdb4c6a1b5dcd3fe3e0f8c02c1454cc8fbd6f1cd0 (diff)
downloadlinaro-scripts-0df000143b9e24ea3c50b4fd3bf2ccfaf181206d.tar.gz
[llvm-build] Force lit tests to run in parallel
This is achieved by setting the CMake option LLVM_LIT_ARGS. If we don't do this, lit may decide that it only needs to run on one core. While we're at it, also update the run.sh that we use for bisects to force ninja to use the right number of cores while building. Change-Id: I099697f4a377541f907d8f13f8f807c2a4f901d6
-rwxr-xr-xbisect/run.sh7
-rwxr-xr-xhelpers/llvm-build13
-rwxr-xr-xstress/build-llvm-forever.sh1
3 files changed, 13 insertions, 8 deletions
diff --git a/bisect/run.sh b/bisect/run.sh
index 6219248..0ff1d0c 100755
--- a/bisect/run.sh
+++ b/bisect/run.sh
@@ -21,6 +21,8 @@ else
CORE=''
fi fi fi fi fi
+PARALLEL=-j`grep -c proc /proc/cpuinfo`
+
selfhost=false
check=false
cflags=$CORE
@@ -79,8 +81,9 @@ build() {
-DCMAKE_CXX_FLAGS="$cflags" \
-DLLVM_TARGETS_TO_BUILD="ARM;AArch64" \
-DLLVM_BUILD_TESTS=True \
- -DLLVM_ENABLE_ASSERTIONS=True
- safe_run ninja
+ -DLLVM_ENABLE_ASSERTIONS=True \
+ -DLLVM_LIT_ARGS="-sv $PARALLEL"
+ safe_run ninja $PARALLEL
if $check; then
safe_run ninja check-all
fi
diff --git a/helpers/llvm-build b/helpers/llvm-build
index d38cf1d..0cef8a0 100755
--- a/helpers/llvm-build
+++ b/helpers/llvm-build
@@ -50,6 +50,12 @@ if [ ! -d $build_dir ]; then
fi
cd $build_dir
+## Allow the user to override the number of CPUs used with -jN
+if [[ $1 =~ -j[0-9]+ ]]; then
+ PARALLEL=$1
+ shift
+fi
+
## Re-run CMake if files are damaged / not there
if [ ! -f build.ninja ] && [ ! -f Makefile ]; then
echo " + Configuring Build"
@@ -59,15 +65,10 @@ if [ ! -f build.ninja ] && [ ! -f Makefile ]; then
-DLLVM_ENABLE_ASSERTIONS=True \
-DPYTHON_EXECUTABLE=/usr/bin/python2 \
-DCMAKE_INSTALL_PREFIX=$install_dir \
+ -DLLVM_LIT_ARGS="-sv -j$PARALLEL" \
$LLVM_CMAKE_FLAGS $targets $shared
fi
-## Allow the user to override the number of CPUs used with -jN
-if [[ $1 =~ -j[0-9]+ ]]; then
- PARALLEL=$1
- shift
-fi
-
## Build
if [ "$1" == "" ]; then
echo " + Building LLVM"
diff --git a/stress/build-llvm-forever.sh b/stress/build-llvm-forever.sh
index 178a00b..5fc4096 100755
--- a/stress/build-llvm-forever.sh
+++ b/stress/build-llvm-forever.sh
@@ -47,6 +47,7 @@ if [ ! -f Makefile ]; then
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_TESTS=True \
-DLLVM_ENABLE_ASSERTIONS=True \
+ -DLLVM_LIT_ARGS="-sv -j$CPUS" \
$LINK_JOBS
fi