Skip to content

Commit

Permalink
win32*.sh: Use nproc for CPU count when targeting win32
Browse files Browse the repository at this point in the history
When building in chroot jail, /proc/cpuinfo may not be available. Switch to
nproc which should be widely available, and does not rely on /proc/cpuinfo.

Signed-off-by: Mike Latimer <[email protected]>
  • Loading branch information
ml8mr authored and petrutlucian94 committed Dec 9, 2020
1 parent 95ccc1c commit 6c57f6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion win32_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -o pipefail
SCRIPT_DIR="$(dirname "$BASH_SOURCE")"
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"

num_vcpus=$(( $(lscpu -p | tail -1 | cut -d "," -f 1) + 1 ))
num_vcpus=$(nproc)

CEPH_DIR="${CEPH_DIR:-$SCRIPT_DIR}"
BUILD_DIR="${BUILD_DIR:-${CEPH_DIR}/build}"
Expand Down
2 changes: 1 addition & 1 deletion win32_deps_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR="$(dirname "$BASH_SOURCE")"
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"

num_vcpus=$(( $(lscpu -p | tail -1 | cut -d "," -f 1) + 1 ))
num_vcpus=$(nproc)
NUM_WORKERS=${NUM_WORKERS:-$num_vcpus}

DEPS_DIR="${DEPS_DIR:-$SCRIPT_DIR/build.deps}"
Expand Down

0 comments on commit 6c57f6b

Please sign in to comment.