Browse Source

Call num_cores() only after deps_install()

There may be no Python available before that.
master
Kristaps Kaupe 3 years ago
parent
commit
63d74bc0f1
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 24
      install.sh

24
install.sh

@ -2,13 +2,13 @@
cd "$(dirname "$0")" || exit
check_exists() {
check_exists()
{
command -v "$1" > /dev/null
}
num_cores() {
python -c 'import multiprocessing as mp; print(mp.cpu_count())'
}
# This may be overriden by --python/-p option.
python="python3"
# This is needed for systems where GNU is not the default make, like FreeBSD.
if check_exists gmake; then
@ -17,6 +17,11 @@ else
make="make"
fi
num_cores()
{
${python} -c 'import multiprocessing as mp; print(mp.cpu_count())'
}
sha256_verify ()
{
if [[ "$(uname)" == "Darwin" ]]; then
@ -574,7 +579,6 @@ install_get_os ()
main ()
{
# flags
python='python3'
build_local_tor=''
no_gpg_validation=''
use_os_deps_check='1'
@ -590,13 +594,12 @@ main ()
jm_source="$PWD"
if [ "$with_jmvenv" == 1 ]; then
jm_root="${jm_source}/jmvenv"
else
jm_root=""
fi
export PKG_CONFIG_PATH="${jm_root}/lib/pkgconfig:${PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH="${jm_root}/lib:${LD_LIBRARY_PATH}"
export C_INCLUDE_PATH="${jm_root}/include:${C_INCLUDE_PATH}"
MAKEFLAGS="-j $(num_cores)" && export MAKEFLAGS
else
jm_root=""
fi
# os check
install_os="$( install_get_os )"
@ -605,6 +608,9 @@ main ()
echo "Dependecies could not be installed. Exiting."
return 1
fi
MAKEFLAGS="-j $(num_cores)" && export MAKEFLAGS
if [ "$with_jmvenv" == 1 ]; then
if ! venv_setup; then
echo "Joinmarket Python virtual environment could not be setup. Exiting."

Loading…
Cancel
Save