zeromq / pyzmq

PyZMQ: Python bindings for zeromq
http://zguide.zeromq.org/py:all
BSD 3-Clause "New" or "Revised" License
3.73k stars 636 forks source link

ERROR: Failed building wheel for pyzmq on OpenBSD #2037

Open joyboy67 opened 1 month ago

joyboy67 commented 1 month ago

This is a pyzmq bug

What pyzmq version?

latest

What libzmq version?

none

Python version (and how it was installed)

3.10.13

OS

OpenBSD 7.3

What happened?

doas pip3 install pyzmq

Collecting pyzmq
  Using cached pyzmq-26.2.0.tar.gz (271 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyzmq
  Building wheel for pyzmq (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyzmq (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [43 lines of output]
      WARNING: Use build.targets instead of cmake.targets for scikit-build-core >= 0.10
      *** scikit-build-core 0.10.7 using CMake 3.25.2 (wheel)
      *** Configuring CMake...
      loading initial cache file /tmp/tmp9bs70ol9/build/CMakeInit.txt
      -- The C compiler identification is Clang 13.0.0
      -- The CXX compiler identification is Clang 13.0.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Python: /usr/local/bin/python3.10 (found version "3.10.13") found components: Interpreter Development.Module
      -- Looking for libzmq
      -- Looking for libzmq with pkg-config
      -- Checking for module 'libzmq'
      --   Found libzmq, version 4.3.4
      -- Looking for libzmq with pkg-config - found: -L/usr/local/lib -lzmq
      --   Adding /usr/local/lib to RPATH, set PYZMQ_LIBZMQ_RPATH=OFF if this is not what you want.
      -- Using Python Python /usr/local/bin/python3.10
      -- Building Cython backend
      -- Linking libzmq target PkgConfig::libzmq
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /tmp/tmp9bs70ol9/build
      *** Building project with Unix Makefiles...
      [ 33%] Generating _src/_zmq.c
      [ 66%] Building C object CMakeFiles/_zmq.dir/_src/_zmq.c.o
      In file included from /tmp/tmp9bs70ol9/build/_src/_zmq.c:1240:
      /tmp/pip-install-8yz0wy7h/pyzmq_418a850cf8ff44dd9884863ced0f6796/zmq/utils/zmq_compat.h:20:10: fatal error: 'zmq.h' file not found
      #include "zmq.h"
               ^~~~~~~
      1 error generated.
      gmake[3]: *** [CMakeFiles/_zmq.dir/build.make:80: CMakeFiles/_zmq.dir/_src/_zmq.c.o] Error 1
      gmake[2]: *** [CMakeFiles/Makefile2:84: CMakeFiles/_zmq.dir/all] Error 2
      gmake[1]: *** [CMakeFiles/Makefile2:117: CMakeFiles/pyzmq.dir/rule] Error 2
      gmake: *** [Makefile:182: pyzmq] Error 2

    *** CMake build failed
    [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyzmq
Failed to build pyzmq
ERROR: Could not build wheels for pyzmq, which is required to install pyproject.toml-based projects

Code to reproduce bug

No response

Traceback, if applicable

No response

More info

No response

minrk commented 1 month ago

Does /usr/local/include/zmq.h exist?

joyboy67 commented 1 month ago

Does /usr/local/include/zmq.h exist?

Yes !

minrk commented 1 month ago

Can you run a build with SKBUILD_CMAKE_VERBOSE=1 to show the compile commands?

minrk commented 1 month ago

and pkg-config --cflags libzmq?

minrk commented 1 month ago

(btw, if you need a short-term workaround, you can ignore the discovered libzmq with: ZMQ_PREFIX=bundled which will tell pyzmq to build libzmq as a static library)

joyboy67 commented 1 month ago

and pkg-config --cflags libzmq?

$ SKBUILD_CMAKE_VERBOSE=1
$ pkg-config --cflags libzmq
-I/usr/local/include

$ doas pip3 install pyzmq
Collecting pyzmq
  Using cached pyzmq-26.2.0.tar.gz (271 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyzmq
  Building wheel for pyzmq (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyzmq (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [43 lines of output]
      WARNING: Use build.targets instead of cmake.targets for scikit-build-core >= 0.10
      *** scikit-build-core 0.10.7 using CMake 3.25.2 (wheel)
      *** Configuring CMake...
      loading initial cache file /tmp/tmp3tnjvbzd/build/CMakeInit.txt
      -- The C compiler identification is Clang 13.0.0
      -- The CXX compiler identification is Clang 13.0.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Python: /usr/local/bin/python3.10 (found version "3.10.13") found components: Interpreter Development.Module
      -- Looking for libzmq
      -- Looking for libzmq with pkg-config
      -- Checking for module 'libzmq'
      --   Found libzmq, version 4.3.4
      -- Looking for libzmq with pkg-config - found: -L/usr/local/lib -lzmq
      --   Adding /usr/local/lib to RPATH, set PYZMQ_LIBZMQ_RPATH=OFF if this is not what you want.
      -- Using Python Python /usr/local/bin/python3.10
      -- Building Cython backend
      -- Linking libzmq target PkgConfig::libzmq
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /tmp/tmp3tnjvbzd/build
      *** Building project with Unix Makefiles...
      [ 33%] Generating _src/_zmq.c
      [ 66%] Building C object CMakeFiles/_zmq.dir/_src/_zmq.c.o
      In file included from /tmp/tmp3tnjvbzd/build/_src/_zmq.c:1240:
      /tmp/pip-install-u8yptueu/pyzmq_fab255e16eb94deba17bc6f1bdb7aafa/zmq/utils/zmq_compat.h:20:10: fatal error: 'zmq.h' file not found
      #include "zmq.h"
               ^~~~~~~
      1 error generated.
      gmake[3]: *** [CMakeFiles/_zmq.dir/build.make:80: CMakeFiles/_zmq.dir/_src/_zmq.c.o] Error 1
      gmake[2]: *** [CMakeFiles/Makefile2:84: CMakeFiles/_zmq.dir/all] Error 2
      gmake[1]: *** [CMakeFiles/Makefile2:117: CMakeFiles/pyzmq.dir/rule] Error 2
      gmake: *** [Makefile:182: pyzmq] Error 2

      *** CMake build failed
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyzmq
Failed to build pyzmq
ERROR: Could not build wheels for pyzmq, which is required to install pyproject.toml-based projects
joyboy67 commented 1 month ago

(btw, if you need a short-term workaround, you can ignore the discovered libzmq with: ZMQ_PREFIX=bundled which will tell pyzmq to build libzmq as a static library)

Ok 👍 I need pyzmq as dependency for install @basicswap

minrk commented 1 month ago

How did you install libzmq?

Can you run one more time after

export CMAKE_ARGS="-DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_EXECUTE_PROCESS_COMMAND_ECHO=STDOUT"

?

I just setup a fresh openbsd 7.6 vm with pkg_add zeromq and it successfully found libzmq and worked fine, so I'm not sure why it's not finding your zmq.h.

joyboy67 commented 1 month ago

How did you install libzmq?

Can you run one more time after

export CMAKE_ARGS="-DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_EXECUTE_PROCESS_COMMAND_ECHO=STDOUT"

?

same error :/

I just setup a fresh openbsd 7.6 vm with pkg_add zeromq and it successfully found libzmq and worked fine, so I'm not sure why it's not finding your zmq.h.

Oh ok, I'm on 7.3 and I have also zeromq :

$ pkg_info -Q zeromq
zeromq-4.3.4p0 (installed)
$ pkg_info -Q libzmq 
p5-ZMQ-LibZMQ3-1.19p2 (installed)
minrk commented 1 month ago

Sorry, that last command was supposed to produce more output for debugging, not fix anything. Can you share the output?

minrk commented 1 month ago

How did you install Python, as well?