New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python binding installation fails under cygwin #113

Closed
jtmoon79 opened this Issue May 28, 2011 · 28 comments

Comments

Projects
None yet
6 participants
@jtmoon79
Copy link

jtmoon79 commented May 28, 2011

Compiling the python binding under cygwin fails.
This may be a problem with zeromq linking to libraries. However, pyzmq brings out the problem.

$ uname -a
    CYGWIN_NT-6.1 TMOON-DEV2 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin
$ mkdir /tmp/tmp1
$ cd /tmp/tmp1
$ wget 'http://download.zeromq.org/zeromq-2.1.7.zip'
$ unzip zeromq-2.1.7.zip
$ cd zeromq-2.1.7
$ ./configure
$ make 
    ... succeeds...
$ make install
    
    ... notable output...
    libtool: install: ranlib /usr/local/lib/libzmq.a
    ----------------------------------------------------------------------
    Libraries have been installed in:
       /usr/local/lib
    
    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the `-LLIBDIR'
    flag during linking and do at least one of the following:
       - add LIBDIR to the `PATH' environment variable
         during execution
       - add LIBDIR to the `LD_RUN_PATH' environment variable
         during linking
       - use the `-LLIBDIR' linker flag
    
    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ----------------------------------------------------------------------
    ... succeeds ...
$ cd ../
$ wget --no-check-certificate 'https://github.com/downloads/zeromq/pyzmq/pyzmq-2.1.7.zip'
$ unzip pyzmq-2.1.7.zip
$ cd pyzmq-2.1.7
$ which python && python --version
    /usr/bin/python
    Python 2.6.5
$ python setup.py configure --zmq=/usr/local
    running configure
    ******************************************
    Configure: Autodetecting ZMQ settings...
        Custom ZMQ dir:       /usr/local
    cc -I/usr/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o
    cc detect/vers.o -L/usr/local/lib -Wl,-R/usr/local/lib -lzmq -o detect/vers.exe
    /usr/local/lib/libzmq.a(libzmq_la-zmq.o): In function `zmq_init':
    /tmp/tmp1/zeromq-2.1.7/src/zmq.cpp:280: undefined reference to `std::nothrow'
    /tmp/tmp1/zeromq-2.1.7/src/zmq.cpp:280: undefined reference to `std::nothrow'
    /usr/local/lib/libzmq.a(libzmq_la-zmq.o):zmq.cpp:(.eh_frame+0x12): undefined reference to `___gxx_personality_v0'
    /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function `_ZNSt17_Rb_tree_iteratorISt4pairIKSsN3zmq10endpoint_tEEEppEv':
    /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_tree.h:182: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
    /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_tree.h:182: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
    /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function `_ZNSt8_Rb_treeISsSt4pairIKSsN3zmq10endpoint_tEESt10_Select1stIS4_ESt4lessISsESaIS4_EE5eraseESt17_Rb_tree_iteratorIS4_E':
    ...error continue for a long time...

The undefined references are to many different libraries. I may re-post this error at zeromq.

-J_Tom_Moon_79

@jtmoon79

This comment has been minimized.

Copy link
Author

jtmoon79 commented May 28, 2011

also reported at https://zeromq.jira.com/browse/LIBZMQ-219
this appears to be a duplicate of #99

@jtmoon79 jtmoon79 closed this May 28, 2011

@jtmoon79 jtmoon79 reopened this May 28, 2011

@minrk

This comment has been minimized.

Copy link
Member

minrk commented May 28, 2011

I should note that the configure step that failed hasn't done anything Python related yet, it's just trying to build and run the simplest pure-C program to print the libzmq version. See here for the contents of the program that's failing to link.

I think libzmq is not built properly if such a simple program doesn't work.

@sustrik

This comment has been minimized.

Copy link
Member

sustrik commented May 28, 2011

It looks like the program is not linked with libstdc++ which it should be.

@minrk

This comment has been minimized.

Copy link
Member

minrk commented May 30, 2011

@sustrik Is this a problem with the libzmq build itself, or should programs linking against libzmq have to explicitly include libstdc++?

This appears unique to cygwin.

@sustrik

This comment has been minimized.

Copy link
Member

sustrik commented May 30, 2011

The problem is with C programs linking with libzmq. C doesn't link in C++ runtime (libstdc++) automatically, so you have to link it by hand (-lstdc++). No idea what the actual problem here is, but the errors point to not having C++ runtime available.

@minrk

This comment has been minimized.

Copy link
Member

minrk commented May 30, 2011

Okay, so this is only an issue when libzmq is a static library, as the dynamic library links libstc++ explicitly. Apparently nobody uses pyzmq with static libzmq, or this would have come up sooner.

I removed my dynamic library, and after specifying that just the detect program be linked to libstdc++, the rest of pyzmq still built and ran fine. That would suggest that l don't need to add stdc++ to libraries for each individual Python extension, rather just the little test program, but I don't know if that's quite accurate.

@jtmoon I have done this in my stdc++ branch (here), so if you can test it, that would be great. If you get past detect, and then see the same errors when you actually try to use pyzmq, I will add stdc++ to the libraries to link on the actual extensions.

@jtmoon79

This comment has been minimized.

Copy link
Author

jtmoon79 commented May 31, 2011

@minrk FAILED with a different error. Instead of a long list of reference errors there was 4 reference errors to _uuid functions.

$ wget --no-check-certificate https://download.github.com/minrk-pyzmq-e7b1562.zip
$ unzip minrk-pyzmq-e7b1562.zip
$ cd minrk-pyzmq-e7b1562/
$ python setup.py configure --zmq=/usr/local
running configure
******************************************
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir: /usr/local
cc -I/usr/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o
cc detect/vers.o -L/usr/local/lib -Wl,-R/usr/local/lib -lzmq -lstdc++ -o detect/vers.exe
/usr/local/lib/libzmq.a(libzmq_la-uuid.o): In function 'uuid_t':
/tmp/tmp1/zeromq-2.1.7/src/uuid.cpp:80: undefined reference to '_uuid_generate'
/tmp/tmp1/zeromq-2.1.7/src/uuid.cpp:81: undefined reference to '_uuid_unparse'
/tmp/tmp1/zeromq-2.1.7/src/uuid.cpp:80: undefined reference to '_uuid_generate'
/tmp/tmp1/zeromq-2.1.7/src/uuid.cpp:81: undefined reference to '_uuid_unparse'
collect2: ld returned 1 exit status
Fatal:
Failed to link ZMQ test program. Please check to make sure:
* You have a C compiler installed
* A development version of Python is installed (including header files)
* A development version of ZMQ >= 2.1.0 is installed (including header files)
* If ZMQ is not in a default location, supply the argument --zmq=
* 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'

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

-J_Tom_Moon_79

@minrk

This comment has been minimized.

Copy link
Member

minrk commented May 31, 2011

@jtmoon79, right - there are other libraries that it needs besides stdc++ when it's static, silly me for testing on OSX. It will need uuid and pthread as well, presumably.

There seems to be a general problem with using static libraries, so it shouldn't be a cygwin-specific fix (though cygwin does appear to be the only place that people are trying to use a static libzmq with pyzmq).

@sustrik - is there a good way to detect ahead of time whether a library will be linked as static or dynamic?

@sustrik

This comment has been minimized.

Copy link
Member

sustrik commented May 31, 2011

When you link with static libzmq.a, all the dependencies are static as well. If you link with dynamic libzmq.so the dependencies are dynamic as well.

@minrk

This comment has been minimized.

Copy link
Member

minrk commented May 31, 2011

Yes, but what I need is a way to find out whether libzmq is static before linking against it, because I need to pass different arguments to the linker if it is. Essentially I want a command that returns the answer to the question: 'if I pass -lfoo to gcc, what file will it use for libfoo?'

@minrk

This comment has been minimized.

Copy link
Member

minrk commented Jun 1, 2011

@jtmoon79 Just out of curiosity, are you deliberately choosing statlic libzmq, or did the zeromq installer not build the dynamic libraries?

@jtmoon79

This comment has been minimized.

Copy link
Author

jtmoon79 commented Jun 1, 2011

@minrk The libzmq installed using the default configuration from package zeromq-2.1.7.zip (see the original posted reproduction steps above). So however zeromq-2.1.7 normally builds and installs under cygwin, that's what happened. If you need, I can post more output captured from the build and installation of libmzq.

@minrk

This comment has been minimized.

Copy link
Member

minrk commented Jun 3, 2011

@sustrik - do you know why libzmq doesn't build dynamic libraries by default on Cygwin unlike everywhere else?

@sustrik

This comment has been minimized.

Copy link
Member

sustrik commented Jun 3, 2011

No idea. This is more a question for build system maintainers, Mikko Koppanen and Martin Lucina. What about complaining on the mailing list?

@minrk

This comment has been minimized.

Copy link
Member

minrk commented Jun 3, 2011

@sustrik - I setup a simple cygwin environment, and it looks like just about everything is static, so maybe that's why.

I tweaked the detection so it builds a shared-lib instead of an executable. The result is that general config (like LDFLAGS) should now affect the detect program the same as extensions.

@jtmoon79 Can you get my detect branch, and try export LDFLAGS='-lpthread -lstdc++ -luuid' prior to building libzmq?

@jtmoon79

This comment has been minimized.

Copy link
Author

jtmoon79 commented Jun 7, 2011

@minrk Failed. I re-compiled everything just to verify. Output below.
$ python --version Python 2.6.5 $ wget 'http://download.zeromq.org/zeromq-2.1.7.zip' $ unzip zeromq-2.1.7.zip $ cd zeromq-2.1.7/ $ ./configure $ make $ make install $ cd .. $ wget --no-check-certificate 'https://github.com/minrk/pyzmq/zipball/detect' $ unzip minrk-pyzmq-3fbd336.zip $ cd minrk-pyzmq-3fbd336/ $ python setup.py configure --zmq=/usr/local running configure Configure: Autodetecting ZMQ settings... Custom ZMQ dir: /usr/local gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o gcc -shared -Wl,--enable-auto-image-base detect/vers.o -L/usr/local/lib -Wl,-R/usr/local/lib -lzmq -o detect/libvers.dll /usr/local/lib/libzmq.a(libzmq_la-zmq.o): In function 'zmq_init': /tmp/tmp2/zeromq-2.1.7/src/zmq.cpp:280: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/zmq.cpp:280: undefined reference to 'std::nothrow' /usr/local/lib/libzmq.a(libzmq_la-zmq.o):zmq.cpp:(.eh_frame+0x12): undefined reference to '___gxx_personality_v0' /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function '_ZNSt17_Rb_tree_iteratorISt4pairIKSsN3zmq10endpoint_tEEEppEv': /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_tree.h:182: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base*)' /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_tree.h:182: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base*)' /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function '_ZNSt8_Rb_treeISsSt4pairIKSsN3zmq10endpoint_tEESt10_Select1stIS4_ESt4lessISsESaIS4_EE5eraseESt17_Rb_tree_iteratorIS4_E': /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_tree.h:1318: undefined reference to 'std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)' /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function '_ZNSs4_Rep10_M_disposeERKSaIcE': /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/basic_string.h:232: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)' /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function 'ctx_t': /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:54: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:61: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:61: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:54: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:61: undefined reference to 'std::nothrow' /usr/local/lib/libzmq.a(libzmq_la-ctx.o):/tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:61: more undefined references to 'std::nothrow' follow ... ... errors continue for a long time ... ... $ export LDFLAGS='-lpthread -lstdc++ -luuid' $ python setup.py configure --zmq=/usr/local running configure Configure: Autodetecting ZMQ settings... Custom ZMQ dir: /usr/local gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o gcc -shared -Wl,--enable-auto-image-base -lpthread -lstdc++ -luuid detect/vers.o -L/usr/local/lib -Wl,-R/usr/local/lib -lzmq -o detect/libvers.dll /usr/local/lib/libzmq.a(libzmq_la-zmq.o): In function 'zmq_init': /tmp/tmp2/zeromq-2.1.7/src/zmq.cpp:280: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/zmq.cpp:280: undefined reference to 'std::nothrow' /usr/local/lib/libzmq.a(libzmq_la-zmq.o):zmq.cpp:(.eh_frame+0x12): undefined reference to '___gxx_personality_v0' /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function '_ZNSt17_Rb_tree_iteratorISt4pairIKSsN3zmq10endpoint_tEEEppEv': /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_tree.h:182: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base*)' /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_tree.h:182: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base*)' /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function '_ZNSt8_Rb_treeISsSt4pairIKSsN3zmq10endpoint_tEESt10_Select1stIS4_ESt4lessISsESaIS4_EE5eraseESt17_Rb_tree_iteratorIS4_E': /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_tree.h:1318: undefined reference to 'std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)' /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function '_ZNSs4_Rep10_M_disposeERKSaIcE': /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/basic_string.h:232: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)' /usr/local/lib/libzmq.a(libzmq_la-ctx.o): In function 'ctx_t': /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:54: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:61: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:61: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:54: undefined reference to 'std::nothrow' /tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:61: undefined reference to 'std::nothrow' /usr/local/lib/libzmq.a(libzmq_la-ctx.o):/tmp/tmp2/zeromq-2.1.7/src/ctx.cpp:61: more undefined references to 'std::nothrow' follow ... ... errors continue for a long time ... ...

-J_Tom_Moon_79

@minrk

This comment has been minimized.

Copy link
Member

minrk commented Jun 20, 2011

I just noticed that my last commend never got posted.

Those symbols are in stdc++, I have no idea why they wouldn't be found when explicitly linking against it.

If you succeed in compiling/running a simple c-program (not c++) with libzmq, please post flags/etc. here.

For now, I am officially punting, and saying that pyzmq requires a dynamic libzmq, at least on cygwin.

@sustrik

This comment has been minimized.

Copy link
Member

sustrik commented Jun 20, 2011

I have no idea how to help here. Mikko or Mato may be able to figure out what's going on here better than I do.

@jtmoon79

This comment has been minimized.

Copy link
Author

jtmoon79 commented Jun 21, 2011

Those symbols are in stdc++, I have no idea why they wouldn't be found when explicitly linking against it.
@minrk Maybe it's something unusual in my Cygwin setup. If I ever test it out on a new Cygwin install I'll post the results. Thanks for investigating this.

-J_Tom_Moon_79

@cyrilh

This comment has been minimized.

Copy link
Contributor

cyrilh commented Jun 12, 2012

I did manage to build against a static lib (target is Android), using CC="xxxx-g++" and the libraries available in the same folder as libzmq so that the -L with the path to libstdc++ is in the search path.

I am stuck though with passing -luuid as (at least for my cross compilation scenario) LDFLAGS and LDSHARED do not affect the flags and I need to pass in -luuid after the already included -lzmq to be able to link. I tried to compile vers.c manually and did succeed that way => the next step is to tweak pyzmp setup.py to link against uuid.

Edit:
Gotcha, that was easy, now added 'uuid' to the list of libraries in setup.py. Thank you minrk for the idea about tweaking. Now the detection fails as it can't execute the file, off course since I cross compile!

@minrk

This comment has been minimized.

Copy link
Member

minrk commented Jun 12, 2012

cyrilh - If you are cross compiling, you can just skip the detect step. There isn't a flag for it, but you can just comment it out / return from the function immediately.

@cyrilh

This comment has been minimized.

Copy link
Contributor

cyrilh commented Jun 27, 2012

I have some hints for linking to libstdc++ issue, probably from most relevant to least relevant

  • have a properly installed standalone toolchain (that did the main trick on android)
  • make sure you link against the proper libstdc++.so file using -L/path or --verbose
  • what about the order of -l options: put -lstdc++ to the end
  • for me it was also possible to remove this and link with g++ instead of gcc, even though I tried to avoid that and found the two above solutions

minrk - Thanks, I did manage with very little tweaking to import zmq from python-for-android. I will create my issue to try to have it pulled on git and documented.

@Jawabiscuit

This comment has been minimized.

Copy link

Jawabiscuit commented Feb 9, 2013

Hi, Just throwing this out there... Does any cygwin users out there have any hints as to why this is happening? Is the build missing headers? I've had unsuccessful attempts at building, running setup.py, and easy_install on cygwin windows 7 machine. Thanks.

(5:52pm)Loc: /cygdrive/c/Users/Jonas/setup_
files/pyzmq $ python setup.py install

running install
running build
running build_py
running build_ext
running configure


Configure: Autodetecting ZMQ settings...
Custom ZMQ dir:
gcc -fno-strict-aliasing -g -O2 -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Izmq/utils -Izmq/core -Izmq/devices -c build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.c -o build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.o
build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.c:4:17: zmq.h: No such file or directory
build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.c: In function main': build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.c:8: warning: implicit declaration of functionzmq_version'

error: command 'gcc' failed with exit status 1

Failed with default libzmq, trying again with /usr/local


Configure: Autodetecting ZMQ settings...
Custom ZMQ dir: /usr/local
gcc -fno-strict-aliasing -g -O2 -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -Izmq/utils -Izmq/core -Izmq/devices -c build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.c -o build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.o
build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.c:4:17: zmq.h: No such file or directory
build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.c: In function main': build/temp.cygwin-1.7.17-i686-2.6/scratch/vers.c:8: warning: implicit declaration of functionzmq_version'

error: command 'gcc' failed with exit status 1


Failed to build or run libzmq detection test.

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 >= 2.1.4 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...

1...


Using bundled libzmq
already have bundled/zeromq
attempting ./configure to generate platform.hpp


Fatal: Cython-generated file 'zmq/core/_device.c' not found.
Cython is required to compile pyzmq from a development branch.
Please install Cython or download a release package of pyzmq.

@ahmadia

This comment has been minimized.

Copy link

ahmadia commented Sep 26, 2013

Here are my notes from a successful Cygwin64 build using hashstack:

I've seen other tools in this space working with libtool, but I wasn't able to get it working with some fiddling, so I just bailed out and built the shared library by hand from the resulting static compile. Set ARTIFACT to wherever you'd like to install things.

0mq install

# ask for whatever you want here, you're going to get a static library from libtool
./configure
make

# shared libraries broken with 0MQ on Cygwin64
# manual shared library link and install from static library

gcc -shared -o cygzmq.dll -Wl,--out-implib=libzmq.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive src/.libs/libzmq.a -Wl,--no-whole-archive -lstdc++

mkdir -p $ARTIFACT/include
install include/zmq.h  $ARTIFACT/include
install include/zmq_utils.h  $ARTIFACT/include

mkdir -p $ARTIFACT/bin
install cygzmq.dll $ARTIFACT/bin

mkdir -p $ARTIFACT/lib
install libzmq.dll.a $ARTIFACT/lib
ZEROMQ=ARTIFACT

pyzmq install

# inplace-build to test
PATH=$PATH:$ZEROMQ/bin $PYTHON/bin/python setup.py build_ext --zmq=$ZEROMQ --inplace

# test, need PATH to include the 0MQ cygzmq.dll file
PATH=$PATH:$ZEROMQ/bin $PYTHON/bin/python setup.py test --zmq=$ZEROMQ

# okay real install
PATH=$PATH:$ZEROMQ/bin $PYTHON/bin/python setup.py install --zmq=$ZEROMQ --prefix=$ARTIFACT

PYZMQ=ARTIFACT
@minrk

This comment has been minimized.

Copy link
Member

minrk commented Sep 26, 2013

Thanks, that sounds like I can close this. Unless you see something that pyzmq should be doing differently?

@ahmadia

This comment has been minimized.

Copy link

ahmadia commented Sep 27, 2013

@minrk I don't have any patches for pyzmq.

You may want to update documentation pointing out that a Cygwin install is doable (with some hacking around the ZeroMQ shared library build).

Thanks for your help.

@minrk

This comment has been minimized.

Copy link
Member

minrk commented Sep 27, 2013

Thanks, I'll try to point people here.

@minrk minrk closed this Sep 27, 2013

@ahmadia

This comment has been minimized.

Copy link

ahmadia commented Oct 1, 2013

Just a note that UUID is currently broken on Cygwin64 Python. This will bite you if you are trying to install a usable IPython stack. Some more information here: http://permalink.gmane.org/gmane.comp.python.ipython.devel/11239

vbraun added a commit to vbraun/sage that referenced this issue Nov 26, 2014

Trac #17333: Update zeromq to 4.0.5
The update itself is trivial.
Upstream tarball at:
* http://download.zeromq.org/zeromq-4.0.5.tar.gz

This also fixes a C++ linking issue:
* zeromq/pyzmq#113
* zeromq/libzmq#1236
and ensure that -no-undefined is passed to libtool to build a shared lib
(or later on pyzmq will fail to build...) on Cygwin.

URL: http://trac.sagemath.org/17333
Reported by: jpflori
Ticket author(s): Jean-Pierre Flori
Reviewer(s): Volker Braun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment