Skip to content

Commit

Permalink
Trac #32828: pyzmq: Fix build errors; zeromq, pyzmq: Update; setuptoo…
Browse files Browse the repository at this point in the history
…ls: upgrade to 59.2.0

`pyzmq` fails to build on some platforms. We fix it by
- upgrading `setuptools` to a version that includes
pypa/distutils#65
- correcting the `pyzmq` build configuration

We also upgrade `pyzmq` and `zeromq` to the latest versions.

For example on `opensuse-tumbleweed-minimal`
(https://github.com/mkoeppe/sage/runs/4085305194?check_suite_focus=true)
{{{
Setting up build directory for pyzmq-22.2.1
Finished extraction
No patch files found in ../patches
****************************************************
Host system:
Linux dd2167ea4425 5.11.0-1020-azure #21~20.04.1-Ubuntu SMP Mon Oct 11
18:54:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
****************************************************
C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,ada,go,d,jit --enable-
offload-targets=nvptx-none,amdgcn-amdhsa, --without-cuda-driver
--enable-host-shared --enable-checking=release --disable-werror --with-
gxx-include-dir=/usr/include/c++/11 --enable-ssp --disable-libssp
--disable-libvtv --enable-cet=auto --disable-libcc1 --enable-plugin
--with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-
allocator=new --disable-libstdcxx-pch --enable-libphobos --enable-
version-specific-runtime-libs --with-gcc-major-version-only --enable-
linker-build-id --enable-linux-futex --enable-gnu-indirect-function
--program-suffix=-11 --without-system-libunwind --enable-multilib
--with-arch-32=x86-64 --with-tune=generic --with-build-config=bootstrap-
lto-lean --enable-link-mutex --build=x86_64-suse-linux --host=x86_64
-suse-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.1 20210816 [revision
056e324ce46a7924b5cf10f61010cf9dd2ca10e9] (SUSE Linux)
****************************************************
Package 'pyzmq' is currently not installed
No legacy uninstaller found for 'pyzmq'; nothing to do
Installing pyzmq-22.2.1
Processing /sage/local/var/lib/sage/venv-
python3.9.7/var/tmp/sage/build/pyzmq-22.2.1/src
    Preparing wheel metadata: started
    Running command /sage/local/var/lib/sage/venv-
python3.9.7/bin/python3 /sage/local/var/lib/sage/venv-
python3.9.7/lib/python3.9/site-
packages/pip/_vendor/pep517/in_process/_in_process.py
prepare_metadata_for_build_wheel /tmp/tmpn08jd7qu
    INFO: Disabling color, you really want to install colorlog.
    Disabling color, you really want to install colorlog.
    running dist_info
    creating /tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-info
    writing /tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-modern-metadata-oxt25qia/pyzmq
.egg-info/dependency_links.txt
    writing requirements to /tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-
info/requires.txt
    writing top-level names to /tmp/pip-modern-metadata-oxt25qia/pyzmq
.egg-info/top_level.txt
    writing manifest file '/tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-
info/SOURCES.txt'
    running configure
    Settings obtained from pkg-config: {'library_dirs': [],
'include_dirs': [], 'libraries': ['zmq']}
    {'libraries': ['zmq'], 'include_dirs': [], 'library_dirs': [],
'runtime_library_dirs': [], 'extra_link_args': []}
    C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g
-fwrapv -O3 -Wall -Wno-unused -g -O2 -g -O2 -fPIC

    compile options: '-c'
    gcc: build/temp.linux-x86_64-3.9/scratch/check_sys_un.c
    gcc build/temp.linux-x86_64-3.9/scratch/check_sys_un.o -o build/temp
.linux-x86_64-3.9/scratch/check_sys_un
    Configure: Autodetecting ZMQ settings...
        Custom ZMQ dir:
    Checking for timer_create
    ** Errors about missing timer_create are a normal part of this
process **
    ************************************************
    C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g
-fwrapv -O3 -Wall -Wno-unused -g -O2 -g -O2 -fPIC

    creating build/temp.linux-x86_64-3.9/scratch/tmp
    compile options: '-c'
    gcc: /tmp/timer_create7kgvq7_0.c
    /tmp/timer_create7kgvq7_0.c: In function 'main':
    /tmp/timer_create7kgvq7_0.c:2:5: warning: implicit declaration of
function 'timer_create' [-Wimplicit-function-declaration]
        2 |     timer_create();
          |     ^~~~~~~~~~~~
    gcc build/temp.linux-x86_64-3.9/scratch/tmp/timer_create7kgvq7_0.o
-o build/temp.linux-x86_64-3.9/scratch/a.out

    error: [Errno 2] No such file or directory: 'a.out'
    Failed with default libzmq, trying again with /usr/local
    {'libraries': ['zmq'], 'include_dirs': ['/usr/local/include'],
'library_dirs': ['/usr/local/lib'], 'runtime_library_dirs':
['/usr/local/lib'], 'extra_link_args': []}
    Configure: Autodetecting ZMQ settings...
        Custom ZMQ dir:       /usr/local
    Checking for timer_create
    ** Errors about missing timer_create are a normal part of this
process **
    ************************************************
    C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g
-fwrapv -O3 -Wall -Wno-unused -g -O2 -g -O2 -fPIC

    compile options: '-c'
    gcc: /tmp/timer_createl5aoyxgr.c
    /tmp/timer_createl5aoyxgr.c: In function 'main':
    /tmp/timer_createl5aoyxgr.c:2:5: warning: implicit declaration of
function 'timer_create' [-Wimplicit-function-declaration]
        2 |     timer_create();
          |     ^~~~~~~~~~~~
    Assembler messages:
    Fatal error: can't create build/temp.linux-
x86_64-3.9/scratch/tmp/timer_createl5aoyxgr.o: No such file or directory
    ** The above error about timer_create is normal and not a problem!
**
    no timer_create, linking librt
    C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g
-fwrapv -O3 -Wall -Wno-unused -g -O2 -g -O2 -fPIC

    compile options: '-I/usr/local/include -Izmq/utils -c'
    gcc: build/temp.linux-x86_64-3.9/scratch/vers.c
    gcc build/temp.linux-x86_64-3.9/scratch/vers.o -L/usr/local/lib -Wl
,--enable-new-dtags,-R/usr/local/lib -lzmq -lrt -o build/temp.linux-
x86_64-3.9/scratch/vers
    Error running version detection script:

    build/temp.linux-x86_64-3.9/scratch/vers: error while loading shared
libraries: libzmq.so.5: cannot open shared object file: No such file or
directory

    error: Error running version detection script:

    build/temp.linux-x86_64-3.9/scratch/vers: error while loading shared
libraries: libzmq.so.5: cannot open shared object file: No such file or
directory

    Warning: Couldn't find an acceptable libzmq on the system.

    If you expected pyzmq to link against an installed libzmq, please
check to make sure:

        * You have a C compiler installed
        * A development version of Python is installed (including
headers)
        * A development version of ZMQ >= 3.2 is installed (including
headers)
        * If ZMQ is not in a default location, supply the argument
--zmq=<path>
        * If you did recently install ZMQ to a default location,
          try rebuilding the ld cache with `sudo ldconfig`
          or specify zmq's location with `--zmq=/usr/local`

    You can skip all this detection/waiting nonsense if you know
    you want pyzmq to bundle libzmq as an extension by passing:

        `--zmq=bundled`

    I will now try to build libzmq as a Python extension
    unless you interrupt me (^C) in the next 10 seconds...

    ************************************************

    10...
     9...
     8...
     7...
     6...
     5...
     4...
     3...
     2...
     1...
    Using bundled libzmq
    already have bundled/zeromq
    attempting ./configure to generate platform.hpp
    Warning: failed to configure libzmq:
    [Errno 2] No such file or directory: './configure'
    staging platform.hpp from: /sage/local/var/lib/sage/venv-
python3.9.7/var/tmp/sage/build/pyzmq-22.2.1/src/buildutils/include_linux
    checking for timer_create
}}}

Also reported in ticket:31855#comment:22

URL: https://trac.sagemath.org/32828
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Nov 20, 2021
2 parents e2196f8 + b430bcf commit e12c3ec
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 64 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/pyzmq/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=pyzmq-VERSION.tar.gz
sha1=50abf6482a6395f15dce0b2774021e12c9f4faad
md5=f261acf884460e93d30f7113c8e9242e
cksum=1661206741
sha1=d8bb8cb345c0bfd9e67a95ac796bf4b10354dde6
md5=ecf13c72fbea05ba5ddc771295409d48
cksum=1680251717
upstream_url=https://pypi.io/packages/source/p/pyzmq/pyzmq-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/pyzmq/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.2.1
22.3.0
20 changes: 7 additions & 13 deletions build/pkgs/pyzmq/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# Since we use environment vars we have to generate setup.cfg

echo "[build_ext]" > src/setup.cfg

# (I tried putting quotes around $SAGE_LOCAL to allow for spaces in
# the path---which is never used but is a good habit to support---but
# that simply does not work. Sorry.)

echo "library_dirs = $SAGE_LOCAL/lib/" >> src/setup.cfg
echo "include_dirs = $SAGE_LOCAL/include/" >> src/setup.cfg

echo "[configure]" >> src/setup.cfg

cd src

# Generate setup.cfg
cat > setup.cfg <<EOF
[global]
zmq_prefix = $SAGE_LOCAL
no_libzmq_extension = True
EOF

# Configure and install
sdh_pip_install .
6 changes: 3 additions & 3 deletions build/pkgs/setuptools/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=setuptools-VERSION.tar.gz
sha1=5d97de0e774b2269c85685a4aa8fd5956bcfd2bb
md5=ff20ab7e0d51c5ad0a9438c50e598c06
cksum=3564252314
sha1=cd4e5d1f7c47f86354fc89d040d869cde244da3b
md5=79b36f59270a6f2e45d6a9a0c6dc68c1
cksum=430889097
upstream_url=https://pypi.io/packages/source/s/setuptools/setuptools-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/setuptools/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
58.2.0
59.2.0
7 changes: 4 additions & 3 deletions build/pkgs/zeromq/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tarball=zeromq-VERSION.tar.gz
sha1=1132f839d703486c4ee1cf22f056585dfbb329c2
md5=a1c95b34384257e986842f4d006957b8
cksum=136261411
sha1=47277a64749049123d1401600e8cfbab10a3ae28
md5=c897d4005a3f0b8276b00b7921412379
cksum=1500782345
upstream_url=https://github.com/zeromq/libzmq/releases/download/vVERSION/zeromq-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/zeromq/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.5
4.3.4
39 changes: 0 additions & 39 deletions build/pkgs/zeromq/patches/getrandom.patch

This file was deleted.

0 comments on commit e12c3ec

Please sign in to comment.