Reduce number of parallel builds 02/9402/1
authorDamjan Marion <damarion@cisco.com>
Mon, 13 Nov 2017 19:09:21 +0000 (20:09 +0100)
committerDamjan Marion <damarion@cisco.com>
Mon, 13 Nov 2017 19:09:23 +0000 (20:09 +0100)
With recent introduction of C++ code required memory for each compiler
instance has significantly increased causing build issues.

Currently build system spins 2 compiler instances per logical CPU core.

As CPU can hardly execute more than one thread at a time, it should be
pretty safe to change that formula so it doesn't multiply number of cpu
cores by 2 and such change will signifucantly reduce amount of memory
needed.

Change-Id: Ic829fff6e45f4caf98a6d9c1c98c53ed003039ef
Signed-off-by: Damjan Marion <damarion@cisco.com>
build-root/Makefile
dpdk/Makefile

index 6298ea1..dd24b4c 100644 (file)
@@ -644,7 +644,7 @@ configure_check_timestamp =                                         \
 # NB: GNU Make 4.2 will let us use '$(file </proc/cpuinfo)' to both test
 # for file presence and content; for now this will have to do.
 MAKE_PARALLEL_JOBS = -j $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo), \
-       $(shell expr 2 '*' $$(grep -c ^processor /proc/cpuinfo)), 2)
+       $(shell grep -c ^processor /proc/cpuinfo), 2)
 MAKE_PARALLEL_FLAGS = $(if $($(PACKAGE)_make_parallel_fails),,$(MAKE_PARALLEL_JOBS))
 
 # Make command shorthand for packages & tools.
index 9c9708c..0f6cbce 100644 (file)
@@ -148,7 +148,7 @@ endif
 # NB: GNU Make 4.2 will let us use '$(file </proc/cpuinfo)' to both test
 # for file presence and content; for now this will have to do.
 JOBS := $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo),\
-       $(shell expr 2 '*' $$(grep -c ^processor /proc/cpuinfo)), 2)
+       $(shell grep -c ^processor /proc/cpuinfo), 2)
 
 # compiler/linker custom arguments
 DPDK_CPU_CFLAGS := -pie -fPIC