[cmake] Use more cores in building nncc-package (#9324)
author이상규/On-Device Lab(SR)/Principal Engineer/삼성전자 <sg5.lee@samsung.com>
Mon, 2 Dec 2019 07:50:33 +0000 (16:50 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 2 Dec 2019 07:50:33 +0000 (16:50 +0900)
Currently it does not use parallel build in build nncc-package. It is so slow.
It will use half of cores that is available in build machine.
It uses half of core since we don't want to allocate all cores in CI machine.

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
infra/packaging/build

index 33c1638..a0c96fe 100644 (file)
@@ -92,9 +92,9 @@ cmake \
   ${EXTRA_OPTIONS[@]} \
   "${NNAS_PROJECT_PATH}/infra/nncc"
 
-cmake --build . -- all
+NPROC=$(cat /proc/cpuinfo | grep -c processor)
+cmake --build . -- -j$((NPROC/2)) all
 cmake --build . -- install
-
 # Install NN Package tools
 NNPKG_INSTALL_PREFIX="${NNAS_INSTALL_PREFIX}"