Skip to content

Commit

Permalink
some refactoring and logging for cpu_count
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller authored Dec 6, 2023
1 parent 9a31574 commit 257ca94
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions installation/routines/setup_jukebox_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,24 @@ _jukebox_core_configure_pulseaudio() {
_jukebox_core_build_libzmq_with_drafts() {
echo " Building libzmq with drafts support" | tee /dev/fd/3

local cpu_count=${CPU_COUNT:-$(python3 -c "import os; print(os.cpu_count())")}
echo "---- use cpu count: '${cpu_count}'"
LIBSODIUM_VERSION="1.0.18"
echo " Building libsodium v${LIBSODIUM_VERSION}" | tee /dev/fd/3

local cpu_count=$(python3 -c "import os; print(os.cpu_count())")

echo " Building libsodium v${LIBSODIUM_VERSION}" | tee /dev/fd/3
cd "${ZMQ_TMP_DIR}" || exit_on_error
wget --quiet https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}-RELEASE/libsodium-${LIBSODIUM_VERSION}.tar.gz
tar -zxvf libsodium-${LIBSODIUM_VERSION}.tar.gz
wget --quiet https://download.libsodium.org/libsodium/releases/libsodium-${LIBSODIUM_VERSION}.tar.gz
tar -zxf libsodium-${LIBSODIUM_VERSION}.tar.gz
cd libsodium-${LIBSODIUM_VERSION} || exit_on_error
./configure --prefix=${ZMQ_TMP_DIR}
make -j${cpu_count} && make install

echo " Building libzmq v${ZMQ_VERSION}" | tee /dev/fd/3
cd "${ZMQ_TMP_DIR}" || exit_on_error
wget https://github.com/zeromq/libzmq/releases/download/v${ZMQ_VERSION}/zeromq-${ZMQ_VERSION}.tar.gz -O libzmq.tar.gz
tar -xzf libzmq.tar.gz
./zeromq-${ZMQ_VERSION}/configure --prefix=${ZMQ_TMP_DIR} --enable-drafts --with-libsodium
wget --quiet https://github.com/zeromq/libzmq/releases/download/v${ZMQ_VERSION}/zeromq-${ZMQ_VERSION}.tar.gz
tar -xzf zeromq-${ZMQ_VERSION}.tar.gz
cd zeromq-${ZMQ_VERSION} || exit_on_error
./configure --prefix=${ZMQ_TMP_DIR} --enable-drafts --with-libsodium
make -j${cpu_count} && make install
}

Expand All @@ -95,8 +96,6 @@ _jukebox_core_build_and_install_pyzmq() {
echo " Install pyzmq with libzmq-drafts to support WebSockets" | tee /dev/fd/3

if ! pip list | grep -F pyzmq >> /dev/null; then
# Download pre-compiled libzmq from Google Drive because RPi has trouble compiling it
echo " Download pre-compiled libzmq from Google Drive because RPi has trouble compiling it"

# ARMv7 as default
LIBZMQ_GD_DOWNLOAD_ID=${GD_ID_COMPILED_LIBZMQ_ARMV7}
Expand Down

0 comments on commit 257ca94

Please sign in to comment.