Skip to content

Commit

Permalink
[cross] set make job num to CPU + 1
Browse files Browse the repository at this point in the history
  • Loading branch information
sktometometo committed Oct 13, 2023
1 parent 8f2f3d3 commit 909c9ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion jsk_unitree_robot/cross/build_ros1.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash

# From https://qiita.com/ymdymd/items/312c9f554d4ffb1f8dc6
JOBS=$(($(grep cpu.cores /proc/cpuinfo | sort -u | sed 's/[^0-9]//g') + 1))

TARGET_MACHINE="${TARGET_MACHINE:-arm64v8}"
HOST_INSTALL_ROOT="${BASE_ROOT:-${PWD}}/"${TARGET_MACHINE}_System
INSTALL_ROOT=System
SOURCE_ROOT=${TARGET_MACHINE}_ws_system
MAKEFLAGS=${MAKEFLAGS:-'-j4'}
MAKEFLAGS=${MAKEFLAGS:-'-j'}${JOBS}

UPDATE_SOURCE_ROOT=1 # TRUE
if [ -e "${SOURCE_ROOT}" ]; then
Expand Down
5 changes: 4 additions & 1 deletion jsk_unitree_robot/cross/build_ros1_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash

# From https://qiita.com/ymdymd/items/312c9f554d4ffb1f8dc6
JOBS=$(($(grep cpu.cores /proc/cpuinfo | sort -u | sed 's/[^0-9]//g') + 1))

TARGET_MACHINE="${TARGET_MACHINE:-arm64v8}"
HOST_INSTALL_ROOT="${BASE_ROOT:-${PWD}}/"${TARGET_MACHINE}_System
INSTALL_ROOT=System
SOURCE_ROOT=${TARGET_MACHINE}_ws_ros1_dependencies_sources
MAKEFLAGS=${MAKEFLAGS:-'-j4'}
MAKEFLAGS=${MAKEFLAGS:-'-j'}${JOBS}

if [ -e "${SOURCE_ROOT}" ]; then
echo "WARNING: Source directory is found ${SOURCE_ROOT}" 1>&2
Expand Down

0 comments on commit 909c9ef

Please sign in to comment.