Skip to content

Commit

Permalink
update and simplify pyzmq draft example script
Browse files Browse the repository at this point in the history
- use bundled libzmq, now that we run a fully cmake build
- use --no-cache to avoid installing previous local builds
  • Loading branch information
minrk committed Aug 19, 2024
1 parent f6dd539 commit 5090bd4
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions examples/draft/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,19 @@

# example script for installing libzmq and pyzmq with draft support

# 1. install libzmq with draft enabled
ZMQ_VERSION=4.3.4
PREFIX=${PREFIX:-/usr/local}
PYZMQ=${PYZMQ:-pyzmq}
CPU_COUNT=${CPU_COUNT:-$(python3 -c "import os; print(os.cpu_count())")}
# tell pyzmq to build bundled libzmq with cmake
# (alternately, install and build libzmq with drafts enabled)
export ZMQ_PREFIX=bundled

set -ex
echo "installing libzmq to $PREFIX"
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
cd zeromq-${ZMQ_VERSION}
./configure --prefix=${PREFIX} --enable-drafts
make -j${CPU_COUNT} && make install
# tell pyzmq to build libzmq with draft support
export ZMQ_DRAFT_API=1

# install pyzmq with drafts enabled
# install pyzmq
# By specifying ``--no-binary pyzmq``, pip knows to not install wheels, and will compile pyzmq from source.
# --no-cache prevents installing a previously cached local build of pyzmq

echo "installing ${PYZMQ}"
export ZMQ_PREFIX=${PREFIX}
export ZMQ_DRAFT_API=1

pip install -v --no-binary pyzmq --pre ${PYZMQ}
echo "installing pyzmq"
pip install -v --no-cache --no-binary pyzmq pyzmq

cat << END | python3
import sys
Expand Down

0 comments on commit 5090bd4

Please sign in to comment.