zeromq / pyzmq

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

Impossible to use on Windows with msys #1117

Closed iongion closed 6 years ago

iongion commented 6 years ago

I think it is rather very close to be able to compile on msys (from http://www.msys2.org/), some int type problems, any tips to monkey patch this ?

W:\SDKs\msys2\mingw64\bin/x86_64-w64-mingw32-c++.exe -shared -Wl,--enable-auto-image-base -pipe -s -s build/temp.mingw-2.7/buildutils/initlibzmq.o build/temp.mingw-2.7/bundled/zeromq/src/address.o build/temp.mingw-2.7/bundled/zeromq/src/clock.o build/temp.mingw-2.7/bundled/zeromq/src/ctx.o build/temp.mingw-2.7/bundled/zeromq/src/curve_client.o build/temp.mingw-2.7/bundled/zeromq/src/curve_server.o build/temp.mingw-2.7/bundled/zeromq/src/dealer.o build/temp.mingw-2.7/bundled/zeromq/src/devpoll.o build/temp.mingw-2.7/bundled/zeromq/src/dist.o build/temp.mingw-2.7/bundled/zeromq/src/epoll.o build/temp.mingw-2.7/bundled/zeromq/src/err.o build/temp.mingw-2.7/bundled/zeromq/src/fq.o build/temp.mingw-2.7/bundled/zeromq/src/gssapi_client.o build/temp.mingw-2.7/bundled/zeromq/src/gssapi_mechanism_base.o build/temp.mingw-2.7/bundled/zeromq/src/gssapi_server.o build/temp.mingw-2.7/bundled/zeromq/src/io_object.o build/temp.mingw-2.7/bundled/zeromq/src/io_thread.o build/temp.mingw-2.7/bundled/zeromq/src/ip.o build/temp.mingw-2.7/bundled/zeromq/src/ipc_address.o build/temp.mingw-2.7/bundled/zeromq/src/ipc_connecter.o build/temp.mingw-2.7/bundled/zeromq/src/ipc_listener.o build/temp.mingw-2.7/bundled/zeromq/src/kqueue.o build/temp.mingw-2.7/bundled/zeromq/src/lb.o build/temp.mingw-2.7/bundled/zeromq/src/mailbox.o build/temp.mingw-2.7/bundled/zeromq/src/mechanism.o build/temp.mingw-2.7/bundled/zeromq/src/metadata.o build/temp.mingw-2.7/bundled/zeromq/src/msg.o build/temp.mingw-2.7/bundled/zeromq/src/mtrie.o build/temp.mingw-2.7/bundled/zeromq/src/norm_engine.o build/temp.mingw-2.7/bundled/zeromq/src/null_mechanism.o build/temp.mingw-2.7/bundled/zeromq/src/object.o build/temp.mingw-2.7/bundled/zeromq/src/options.o build/temp.mingw-2.7/bundled/zeromq/src/own.o build/temp.mingw-2.7/bundled/zeromq/src/pair.o build/temp.mingw-2.7/bundled/zeromq/src/pgm_receiver.o build/temp.mingw-2.7/bundled/zeromq/src/pgm_sender.o build/temp.mingw-2.7/bundled/zeromq/src/pgm_socket.o build/temp.mingw-2.7/bundled/zeromq/src/pipe.o build/temp.mingw-2.7/bundled/zeromq/src/plain_client.o build/temp.mingw-2.7/bundled/zeromq/src/plain_server.o build/temp.mingw-2.7/bundled/zeromq/src/poll.o build/temp.mingw-2.7/bundled/zeromq/src/poller_base.o build/temp.mingw-2.7/bundled/zeromq/src/precompiled.o build/temp.mingw-2.7/bundled/zeromq/src/proxy.o build/temp.mingw-2.7/bundled/zeromq/src/pub.o build/temp.mingw-2.7/bundled/zeromq/src/pull.o build/temp.mingw-2.7/bundled/zeromq/src/push.o build/temp.mingw-2.7/bundled/zeromq/src/random.o build/temp.mingw-2.7/bundled/zeromq/src/raw_decoder.o build/temp.mingw-2.7/bundled/zeromq/src/raw_encoder.o build/temp.mingw-2.7/bundled/zeromq/src/reaper.o build/temp.mingw-2.7/bundled/zeromq/src/rep.o build/temp.mingw-2.7/bundled/zeromq/src/req.o build/temp.mingw-2.7/bundled/zeromq/src/router.o build/temp.mingw-2.7/bundled/zeromq/src/select.o build/temp.mingw-2.7/bundled/zeromq/src/session_base.o build/temp.mingw-2.7/bundled/zeromq/src/signaler.o build/temp.mingw-2.7/bundled/zeromq/src/socket_base.o build/temp.mingw-2.7/bundled/zeromq/src/socks.o build/temp.mingw-2.7/bundled/zeromq/src/socks_connecter.o build/temp.mingw-2.7/bundled/zeromq/src/stream.o build/temp.mingw-2.7/bundled/zeromq/src/stream_engine.o build/temp.mingw-2.7/bundled/zeromq/src/sub.o build/temp.mingw-2.7/bundled/zeromq/src/tcp.o build/temp.mingw-2.7/bundled/zeromq/src/tcp_address.o build/temp.mingw-2.7/bundled/zeromq/src/tcp_connecter.o build/temp.mingw-2.7/bundled/zeromq/src/tcp_listener.o build/temp.mingw-2.7/bundled/zeromq/src/thread.o build/temp.mingw-2.7/bundled/zeromq/src/tipc_address.o build/temp.mingw-2.7/bundled/zeromq/src/tipc_connecter.o build/temp.mingw-2.7/bundled/zeromq/src/tipc_listener.o build/temp.mingw-2.7/bundled/zeromq/src/trie.o build/temp.mingw-2.7/bundled/zeromq/src/v1_decoder.o build/temp.mingw-2.7/bundled/zeromq/src/v1_encoder.o build/temp.mingw-2.7/bundled/zeromq/src/v2_decoder.o build/temp.mingw-2.7/bundled/zeromq/src/v2_encoder.o build/temp.mingw-2.7/bundled/zeromq/src/xpub.o build/temp.mingw-2.7/bundled/zeromq/src/xsub.o build/temp.mingw-2.7/bundled/zeromq/src/zmq.o build/temp.mingw-2.7/bundled/zeromq/src/zmq_utils.o build/temp.mingw-2.7/bundled/zeromq/tweetnacl/src/tweetnacl.o build/temp.mingw-2.7/bundled/zeromq/tweetnacl/contrib/randombytes/winrandom.o build/temp.mingw-2.7/buildutils/libzmq.def -LW:/SDKs/msys2/mingw64/lib/python2.7/config -LW:/SDKs/msys2/mingw64/lib -lrpcrt4 -lws2_32 -ladvapi32 -lpython2.7 -o build/lib.mingw-2.7/zmq/libzmq.pyd
    building 'zmq.devices.monitoredqueue' extension
    creating build/temp.mingw-2.7/zmq
    creating build/temp.mingw-2.7/zmq/devices
    W:\SDKs\msys2\mingw64\bin/x86_64-w64-mingw32-gcc.exe -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -DNDEBUG -DNDEBUG -Ibuildutils/include_win32 -Ibundled/zeromq/include -Izmq/utils -Izmq/backend/cython -Izmq/devices -IW:/SDKs/msys2/mingw64/include/python2.7 -c zmq/devices/monitoredqueue.c -o build/temp.mingw-2.7/zmq/devices/monitoredqueue.o
    In file included from W:/SDKs/msys2/mingw64/include/python2.7/pyport.h:9:0,
                     from W:/SDKs/msys2/mingw64/include/python2.7/Python.h:58,
                     from zmq/devices/monitoredqueue.c:4:
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:21:2: error: unknown type name 'intmax_t'
      intmax_t quot;
      ^~~~~~~~
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:22:2: error: unknown type name 'intmax_t'
      intmax_t rem;
      ^~~~~~~~
    In file included from W:/SDKs/msys2/mingw64/include/python2.7/pyport.h:9:0,
                     from W:/SDKs/msys2/mingw64/include/python2.7/Python.h:58,
                     from zmq/devices/monitoredqueue.c:4:
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:279:18: error: expected ',' or ';' before 'imaxabs'
     intmax_t __cdecl imaxabs (intmax_t j);
                      ^~~~~~~
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:281:31: error: expected ',' or ';' before 'imaxabs'
     __CRT_INLINE intmax_t __cdecl imaxabs (intmax_t j)
                                   ^~~~~~~
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:284:28: error: expected declaration specifiers or '...' before 'intmax_t'
     imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom);
                                ^~~~~~~~
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:284:44: error: expected declaration specifiers or '...' before 'intmax_t'
     imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom);
                                                ^~~~~~~~
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:288:18: error: expected ',' or ';' before 'strtoimax'
     intmax_t __cdecl strtoimax (const char* __restrict__ nptr,
                      ^~~~~~~~~
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:290:19: error: expected ',' or ';' before 'strtoumax'
     uintmax_t __cdecl strtoumax (const char* __restrict__ nptr,
                       ^~~~~~~~~
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:293:18: error: expected ',' or ';' before 'wcstoimax'
     intmax_t __cdecl wcstoimax (const wchar_t* __restrict__ nptr,
                      ^~~~~~~~~
    W:/SDKs/msys2/mingw64/x86_64-w64-mingw32/include/inttypes.h:295:19: error: expected ',' or ';' before 'wcstoumax'
     uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr,
                       ^~~~~~~~~
    In file included from W:/SDKs/msys2/mingw64/include/python2.7/Python.h:58:0,
                     from zmq/devices/monitoredqueue.c:4:
    W:/SDKs/msys2/mingw64/include/python2.7/pyport.h:117:21: error: unknown type name 'uint32_t'
     #define PY_UINT32_T uint32_t
                         ^
    W:/SDKs/msys2/mingw64/include/python2.7/longintrepr.h:45:9: note: in expansion of macro 'PY_UINT32_T'
     typedef PY_UINT32_T digit;
             ^~~~~~~~~~~
    W:/SDKs/msys2/mingw64/include/python2.7/pyport.h:141:20: error: unknown type name 'int32_t'
     #define PY_INT32_T int32_t
                        ^
    W:/SDKs/msys2/mingw64/include/python2.7/longintrepr.h:46:9: note: in expansion of macro 'PY_INT32_T'
     typedef PY_INT32_T sdigit; /* signed variant of digit */
             ^~~~~~~~~~
    W:/SDKs/msys2/mingw64/include/python2.7/pyport.h:130:21: error: unknown type name 'uint64_t'
     #define PY_UINT64_T uint64_t
                         ^
    W:/SDKs/msys2/mingw64/include/python2.7/longintrepr.h:47:9: note: in expansion of macro 'PY_UINT64_T'
     typedef PY_UINT64_T twodigits;
             ^~~~~~~~~~~
    W:/SDKs/msys2/mingw64/include/python2.7/pyport.h:151:20: error: unknown type name 'int64_t'
     #define PY_INT64_T int64_t
                        ^
    W:/SDKs/msys2/mingw64/include/python2.7/longintrepr.h:48:9: note: in expansion of macro 'PY_INT64_T'
     typedef PY_INT64_T stwodigits; /* signed variant of twodigits */
             ^~~~~~~~~~
    In file included from zmq/utils/zmq_compat.h:16:0,
                     from zmq/devices/monitoredqueue.c:523:
    bundled/zeromq/include/zmq.h:439:52: error: unknown type name 'uint8_t'
     ZMQ_EXPORT char *zmq_z85_encode (char *dest, const uint8_t *data, size_t size);
                                                        ^~~~~~~
    bundled/zeromq/include/zmq.h:442:12: error: unknown type name 'uint8_t'
     ZMQ_EXPORT uint8_t *zmq_z85_decode (uint8_t *dest, const char *string);
                ^~~~~~~
    bundled/zeromq/include/zmq.h:442:37: error: unknown type name 'uint8_t'; did you mean 'wint_t'?
     ZMQ_EXPORT uint8_t *zmq_z85_decode (uint8_t *dest, const char *string);
                                         ^~~~~~~
                                         wint_t
    In file included from zmq/devices/monitoredqueue.c:523:0:
    zmq/devices/monitoredqueue.c: In function '__pyx_f_3zmq_7devices_14monitoredqueue__relay':
    zmq/utils/zmq_compat.h:12:23: error: unknown type name 'int64_t'; did you mean 'ino_t'?
     #define pyzmq_int64_t int64_t
                           ^
    zmq/devices/monitoredqueue.c:1920:3: note: in expansion of macro 'pyzmq_int64_t'
       pyzmq_int64_t __pyx_v_flag_2;
       ^
    zmq/utils/zmq_compat.h:12:23: error: 'int64_t' undeclared (first use in this function); did you mean 'intmax_t'?
     #define pyzmq_int64_t int64_t
                           ^
    zmq/devices/monitoredqueue.c:1945:30: note: in expansion of macro 'pyzmq_int64_t'
         __pyx_v_flagsz = (sizeof(pyzmq_int64_t));
                                  ^
    zmq/utils/zmq_compat.h:12:23: note: each undeclared identifier is reported only once for each function it appears in
     #define pyzmq_int64_t int64_t
                           ^
    zmq/devices/monitoredqueue.c:1945:30: note: in expansion of macro 'pyzmq_int64_t'
         __pyx_v_flagsz = (sizeof(pyzmq_int64_t));
                                  ^
    error: command 'W:\\SDKs\\msys2\\mingw64\\bin/x86_64-w64-mingw32-gcc.exe' failed with exit status 1

    ----------------------------------------
Command "W:/SDKs/msys2/mingw64/bin/python2.exe -u -c "import setuptools, tokenize;__file__='w:/sdks/msys2/tmp/pip-build-udcysk/pyzmq/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record w:/sdks/msys2/tmp/pip-xchc60-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in w:/sdks/msys2/tmp/pip-build-udcysk/pyzmq/
fpn commented 6 years ago

pacman -S mingw64/mingw-w64-x86_64-zeromq mingw64/mingw-w64-x86_64-python2-pyzmq

iongion commented 6 years ago

@fpn Awesome, hopefully a python 3 package will also be added!