From b70e39d4258d08bda7a1a57dd4422ff710f2fb69 Mon Sep 17 00:00:00 2001 From: slowriot Date: Sat, 6 Mar 2021 17:55:46 +0000 Subject: [PATCH] update all compile scripts to use available cores rather than a hardcoded value (#2425) * fix typos, spelling * add two V8 firing orders * use the available number of CPU cores, not just 4 * add new firing orders to config * updating generated files to include new v8 firing orders * reverting update of auto-generated files * correct firing order labels for new firing orders * update all compile scripts to use available cores rather than a hardcoded value --- firmware/bootloader/compile_bootloader.sh | 2 +- firmware/config/boards/common_make.sh | 2 +- simulator/compile.sh | 2 +- unit_tests/compile.sh | 2 +- unit_tests/run_clean_gcov.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 simulator/compile.sh diff --git a/firmware/bootloader/compile_bootloader.sh b/firmware/bootloader/compile_bootloader.sh index a374a38472..251623949d 100644 --- a/firmware/bootloader/compile_bootloader.sh +++ b/firmware/bootloader/compile_bootloader.sh @@ -9,7 +9,7 @@ echo "Entering $SCRIPT_NAME" BOOTLOADER_CODE_DESTINATION_FILE=$BOOTLOADER_CODE_DESTINATION_PATH/bootloader_generated.hxx echo "$SCRIPT_NAME: Starting bootloader compilation..." -make -j4 -f src/Makefile $1 $2 $3 +make -j$(nproc) -f src/Makefile $1 $2 $3 # downstream scripts detect error condition by checking if the output file exists so we need to make sure we remove it [ $? -eq 0 ] || { echo "ERROR: bootloader compilation failed"; rm -f blbuild/$BOOTLOADER_CODE_DESTINATION_FILE ; exit 1; } diff --git a/firmware/config/boards/common_make.sh b/firmware/config/boards/common_make.sh index 934ba95af8..4887c30bc0 100644 --- a/firmware/config/boards/common_make.sh +++ b/firmware/config/boards/common_make.sh @@ -7,7 +7,7 @@ cd ../../.. mkdir .dep # todo: start using env variable for number of threads or for '-r' -make -j4 -r +make -j$(nproc) -r [ -e build/rusefi.hex ] || { echo "FAILED to compile by $SCRIPT_NAME with $PROJECT_BOARD $DEBUG_LEVEL_OPT and $EXTRA_PARAMS"; exit 1; } mkdir -p deliver diff --git a/simulator/compile.sh b/simulator/compile.sh old mode 100644 new mode 100755 index 7858d49289..b463e48b55 --- a/simulator/compile.sh +++ b/simulator/compile.sh @@ -1,5 +1,5 @@ rm -f build/rusefi_simulator.exe -make -j4 -r +make -j$(nproc) -r [ $? -eq 0 ] || { echo "Simulator compilation failed"; exit 1; } file build/rusefi_simulator echo "TIMESTAMP $(date "+%D %T.%2N") just compiled rusefi simulator" diff --git a/unit_tests/compile.sh b/unit_tests/compile.sh index 9386e5d6fb..515778f6ce 100644 --- a/unit_tests/compile.sh +++ b/unit_tests/compile.sh @@ -3,4 +3,4 @@ echo "Compiling unit tests" rm -rf .dep/ rm -rf build/ -make -j4 +make -j$(nproc) diff --git a/unit_tests/run_clean_gcov.sh b/unit_tests/run_clean_gcov.sh index 96b176cf49..92a4433013 100644 --- a/unit_tests/run_clean_gcov.sh +++ b/unit_tests/run_clean_gcov.sh @@ -1,6 +1,6 @@ #!/bin/bash make clean -make -j4 +make -j$(nproc) build/rusefi_test bash ci_gcov.sh "$RUSEFI_DOXYGEN_FTP_USER" "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER"