Commit 13870542 authored by rich prohaska's avatar rich prohaska

get the build script get_ncpus function to work on more systems

parent b7b688de
...@@ -102,12 +102,17 @@ function git_tree() { ...@@ -102,12 +102,17 @@ function git_tree() {
# compute the number of cpus in this system. used to parallelize the build. # compute the number of cpus in this system. used to parallelize the build.
function get_ncpus() { function get_ncpus() {
if [ -f /proc/cpuinfo ]; then local n
grep bogomips /proc/cpuinfo | wc -l n=$(grep processor /proc/cpuinfo 2>/dev/null)
elif [ $system = darwin ] ; then if [ $? = 0 ] ; then
sysctl -n hw.ncpu echo "$n" | wc -l
else else
echo 1 n=$(sysctl -n hw.ncpu 2>/dev/null)
if [ $? = 0 ] ; then
echo $n
else
echo 1 # default is 1 cpu
fi
fi fi
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment