From de94bf7c3b6adf1809e091c5ca1b3f00ff69b0a4 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Sat, 15 Nov 2014 11:16:09 -0700 Subject: [PATCH] build: Introduce CONCURRENCY_MAKE_FACTOR It is often useful to apply a factor to N_CPUs when calculating the best -j option for make. eg. N_CPUs*2.5 is usally good if your sources sit on an SSD. --- config/options | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/options b/config/options index 45540588e9..4a0137a127 100644 --- a/config/options +++ b/config/options @@ -66,7 +66,10 @@ LINUX_DEPENDS="$PROJECT_DIR/$PROJECT/linux/linux.$TARGET_ARCH.conf $ROOT/package # Try value 1 (default) to 4 on single CPU computer, or more on # multi-processor computer (like hyperthreading SMP CPU) if test -z "${CONCURRENCY_MAKE_LEVEL}"; then - CONCURRENCY_MAKE_LEVEL=`cat /proc/cpuinfo | grep -c '^processor[[:cntrl:]]*:'` + if test -z "${CONCURRENCY_MAKE_FACTOR}"; then + CONCURRENCY_MAKE_FACTOR=1.0 + fi + CONCURRENCY_MAKE_LEVEL=`echo "$(grep -c '^processor[[:cntrl:]]*:' /proc/cpuinfo) * ${CONCURRENCY_MAKE_FACTOR}" | bc | cut -d'.' -f1` fi # cache size for ccache