Permalink
Browse files

Compatibility with Mac OS X: choose dynamic library extension by

platform.
  • Loading branch information...
smira committed May 30, 2011
1 parent 5d3690e commit c8c8419360fff79fe3f2043bdffd96dec6e10c9f
Showing with 2 additions and 1 deletion.
  1. +2 −1 zmq/_zmq.py
View
@@ -25,6 +25,7 @@
# <http://www.gnu.org/licenses/>.
import random
+import platform
# hack to avoid twisted tests failure
import py
@@ -93,7 +94,7 @@ def _check_zmq_errno(result, func, arguments):
raise ZMQError(errno)
return result
-libzmq = CDLL("libzmq.so", use_errno=True)
+libzmq = CDLL("libzmq" + (".dylib" if platform.system() == "Darwin" else ".so"), use_errno=True)
libzmq.zmq_version.restype = None
libzmq.zmq_version.argtypes = [POINTER(c_int)]*3

4 comments on commit c8c8419

@dholth

This comment has been minimized.

Show comment Hide comment
@dholth

dholth Jun 2, 2011

I believe ctypes has a find library function that takes 'zmq' and prepends, appends lib, .dylib, .so as necessary.

I believe ctypes has a find library function that takes 'zmq' and prepends, appends lib, .dylib, .so as necessary.

@smira

This comment has been minimized.

Show comment Hide comment
@smira

smira Jun 7, 2011

Collaborator

@dholth, it doesn't seem to work for me on Python 2.7 and Mac OS X:

E OSError: dlopen(zmq, 6): no suitable image found. Did find:
E zmq: not a file

Collaborator

smira replied Jun 7, 2011

@dholth, it doesn't seem to work for me on Python 2.7 and Mac OS X:

E OSError: dlopen(zmq, 6): no suitable image found. Did find:
E zmq: not a file

@dholth

This comment has been minimized.

Show comment Hide comment
@smira

This comment has been minimized.

Show comment Hide comment
@smira

smira Jul 5, 2011

Collaborator

Thanks, fixed in: 808c9ba

Collaborator

smira replied Jul 5, 2011

Thanks, fixed in: 808c9ba

Please sign in to comment.