Update install.sh
Added more efficient option to detect number of cores on running system via nproc
This commit is contained in:
parent
085df7e8af
commit
5312827480
15
install.sh
15
install.sh
@ -47,16 +47,21 @@ function python_finder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function num_cores {
|
function num_cores {
|
||||||
num_cpus=1
|
if [[ -e /bin/nproc ]]; then
|
||||||
if [[ `uname -s` == "Linux" ]]; then
|
num_cpus=$(nproc)
|
||||||
num_cpus=$(grep -c ^processor /proc/cpuinfo)
|
|
||||||
else
|
else
|
||||||
# Works on Mac and FreeBSD
|
num_cpus=1
|
||||||
num_cpus=$(sysctl -n hw.ncpu)
|
if [[ `uname -s` == "Linux" ]]; then
|
||||||
|
num_cpus=$(grep -c ^processor /proc/cpuinfo)
|
||||||
|
else
|
||||||
|
# Works on Mac and FreeBSD
|
||||||
|
num_cpus=$(sysctl -n hw.ncpu)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo $num_cpus
|
echo $num_cpus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function install {
|
function install {
|
||||||
ycm_dir=`pwd`
|
ycm_dir=`pwd`
|
||||||
build_dir=`mktemp -d -t ycm_build.XXXXXX`
|
build_dir=`mktemp -d -t ycm_build.XXXXXX`
|
||||||
|
Loading…
Reference in New Issue
Block a user