Commit 45414b54 authored by Martin Sustrik's avatar Martin Sustrik

python binding removed

parent efefa069
......@@ -2,14 +2,10 @@ if BUILD_JAVA
DIR_J = java
endif
if BUILD_PYTHON
DIR_P = python
endif
if BUILD_RUBY
DIR_R = ruby
endif
SUBDIRS = $(DIR_J) $(DIR_P) $(DIR_R)
DIST_SUBDIRS = java python ruby
SUBDIRS = $(DIR_J) $(DIR_R)
DIST_SUBDIRS = java ruby
INCLUDES = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/libzmq \
-I$(top_builddir)/libzmq $(PYTHON_INCLUDES)
pyexec_LTLIBRARIES = libpyzmq.la
libpyzmq_la_SOURCES = pyzmq.cpp
libpyzmq_la_LIBADD = $(top_builddir)/src/libzmq.la
libpyzmq_la_LDFLAGS = -avoid-version
This diff is collapsed.
from distutils.core import setup, Extension
module1 = Extension('libpyzmq',
libraries = ['zmq'],
library_dirs = ['@prefix@/lib'],
include_dirs = ['@PYTHON_SETUP_INCLUDES@','@prefix@/include'],
sources = ['pyzmq.cpp'])
setup (name = 'libyzmq',
version = '@VERSION@',
description = '0MQ Python library',
ext_modules = [module1])
......@@ -313,46 +313,6 @@ if test "x$cpp" != "xno"; then
cppzmq="yes"
fi
# Python
pyzmq="no"
AC_ARG_WITH(python_headersdir,
AS_HELP_STRING([--with-python-headersdir], [Python.h header file location]),
[python_headersdir="$withval"], [python_headersdir="no"])
AC_ARG_WITH([python], [AS_HELP_STRING([--with-python], [build Python language binding [default=no]])], [with_python=yes], [with_python=no])
if test "x$with_python" != "xno"; then
AM_PATH_PYTHON([2.4], , [:])
if test "x$PYTHON" = "x:"; then
AC_MSG_ERROR([the --with-python option requires that python be installled.]);
fi
if test "x$python_headersdir" != "xno"; then
PYTHON_INCLUDES="-I${python_headersdir}"
PYTHON_SETUP_INCLUDES="${python_headersdir}"
AC_CHECK_HEADERS($python_headersdir/Python.h, [] ,
[AC_MSG_ERROR([cannot find a usable Python.h in ${python_headersdir}.])])
else
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
PYTHON_SETUP_INCLUDES="${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="${PYTHON_INCLUDES} -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
AC_CHECK_HEADERS($py_prefix/include/python${PYTHON_VERSION}/Python.h, [] ,
[AC_MSG_ERROR([cannot find a usable Python.h in $py_prefix/include/python${PYTHON_VERSION}.])])
fi
AC_SUBST(PYTHON_INCLUDES)
AC_SUBST(PYTHON_SETUP_INCLUDES)
pyzmq="yes"
fi
# RUBY
rbzmq="no"
AC_ARG_WITH(ruby_headersdir,
......@@ -394,13 +354,6 @@ fi
RUBYDIR="$rubydir"
AC_SUBST([RUBYDIR])
if test "x$pyzmq" = "xyes"; then
AC_CHECK_PROG(have_python, python, yes, no)
if test "x$have_python" != "xyes"; then
AC_MSG_ERROR([the --with-python option requires that python be installed.])
fi
fi
# Java language binding
jzmq="no"
......@@ -523,11 +476,9 @@ if test "x$with_pgm_ext" != "xno"; then
if test "x$have_perl" != "xyes"; then
AC_MSG_ERROR([perl is required for building the PGM extension.])
fi
if test "x$pyzmq" != "xyes"; then
AC_CHECK_PROG(have_python, python, yes, no)
if test "x$have_python" != "xyes"; then
AC_MSG_ERROR([python is required for building the PGM extension.])
fi
AC_CHECK_PROG(have_python, python, yes, no)
if test "x$have_python" != "xyes"; then
AC_MSG_ERROR([python is required for building the PGM extension.])
fi
# Unpack libpgm
......@@ -586,7 +537,7 @@ AC_ARG_WITH([perf], [AS_HELP_STRING([--with-perf],
if test "x$with_perf" != "xno"; then
perf="yes"
if test "x$czmq" = "xno" -a "x$cppzmq" = "xno" -a "x$pyzmq" = "xno" -a \
if test "x$czmq" = "xno" -a "x$cppzmq" = "xno" -a \
"x$jzmq" = "xno" -a "x$rbzmq" = "xno"; then
AC_MSG_ERROR([the --with-perf option requires at least one language binding.]);
fi
......@@ -596,9 +547,7 @@ if test "x$with_perf" = "xno" -a "x$with_pgm_examples" = "xyes"; then
AC_MSG_ERROR([cannot configure --with-pgm-examples without --with-perf.]);
fi
AM_CONDITIONAL(BUILD_PYTHON, test "x$pyzmq" = "xyes")
AM_CONDITIONAL(BUILD_JAVA, test "x$jzmq" = "xyes")
AM_CONDITIONAL(BUILD_PYTHON, test "x$pyzmq" = "xyes")
AM_CONDITIONAL(BUILD_RUBY, test "x$rbzmq" = "xyes")
AM_CONDITIONAL(BUILD_C, test "x$czmq" = "xyes")
AM_CONDITIONAL(BUILD_CPP, test "x$cppzmq" = "xyes")
......@@ -625,10 +574,9 @@ AC_SUBST(LIBZMQ_EXTRA_LDFLAGS)
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(perror gettimeofday memset socket getifaddrs freeifaddrs)
AC_OUTPUT(Makefile src/Makefile doc/Makefile bindings/python/Makefile \
bindings/python/setup.py bindings/ruby/Makefile \
AC_OUTPUT(Makefile src/Makefile doc/Makefile bindings/ruby/Makefile \
bindings/java/Makefile perf/Makefile perf/c/Makefile perf/cpp/Makefile \
perf/python/Makefile perf/ruby/Makefile perf/java/Makefile src/libzmq.pc \
perf/ruby/Makefile perf/java/Makefile src/libzmq.pc \
devices/Makefile devices/zmq_forwarder/Makefile \
devices/zmq_streamer/Makefile devices/zmq_queue/Makefile bindings/Makefile)
......@@ -657,7 +605,6 @@ AC_MSG_RESULT([ Language bindings:])
AC_MSG_RESULT([ C: $czmq])
AC_MSG_RESULT([ C++: $cppzmq])
AC_MSG_RESULT([ Java: $jzmq])
AC_MSG_RESULT([ Python: $pyzmq])
AC_MSG_RESULT([ Ruby: $rbzmq])
if test "x$rbzmq" = "xyes"; then
AC_MSG_RESULT([ Ruby library install dir: $rubydir])
......
......@@ -5,7 +5,7 @@ MAN3 = zmq_bind.3 zmq_close.3 zmq_connect.3 zmq_flush.3 zmq_init.3 \
zmq_poll.3 zmq_recv.3 zmq_send.3 zmq_setsockopt.3 zmq_socket.3 \
zmq_strerror.3 zmq_term.3 zmq_version.3
MAN7 = zmq.7 zmq_tcp.7 zmq_udp.7 zmq_pgm.7 zmq_inproc.7 zmq_ipc.7 \
zmq_cpp.7 zmq_java.7 zmq_python.7
zmq_cpp.7 zmq_java.7
MAN_DOC = $(MAN1) $(MAN3) $(MAN7)
MAN_TXT = $(MAN1:%.1=%.txt)
......
......@@ -166,9 +166,6 @@ $$C++$$::
Java::
linkzmq:zmq_java[7]
Python::
linkzmq:zmq_python[7]
AUTHOR
------
......
zmq_python(7)
=============
NAME
----
zmq_python - interface between 0MQ and Python applications
SYNOPSIS
--------
*
DESCRIPTION
-----------
*
SEE ALSO
--------
*
AUTHOR
------
Martin Sustrik <sustrik at 250bpm dot com>
......@@ -6,10 +6,6 @@ if BUILD_CPP
PERF_DIR_CPP = cpp
endif
if BUILD_PYTHON
PERF_DIR_P = python
endif
if BUILD_JAVA
PERF_DIR_J = java
endif
......@@ -18,6 +14,5 @@ if BUILD_RUBY
PERF_DIR_R = ruby
endif
SUBDIRS = $(PERF_DIR_C) $(PERF_DIR_CPP) $(PERF_DIR_P) \
$(PERF_DIR_J) $(PERF_DIR_R)
DIST_SUBDIRS = c cpp python java ruby
SUBDIRS = $(PERF_DIR_C) $(PERF_DIR_CPP) $(PERF_DIR_J) $(PERF_DIR_R)
DIST_SUBDIRS = c cpp java ruby
#
# Copyright (c) 2007-2010 iMatix Corporation
#
# This file is part of 0MQ.
#
# 0MQ is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# 0MQ is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Lesser GNU General Public License for more details.
#
# You should have received a copy of the Lesser GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import sys
import time
import libpyzmq
def main ():
if len (sys.argv) != 4:
print 'usage: local_lat <bind-to> <message-size> <roundtrip-count>'
sys.exit (1)
try:
bind_to = sys.argv [1]
message_size = int (sys.argv [2])
roundtrip_count = int (sys.argv [3])
except (ValueError, OverflowError), e:
print 'message-size and roundtrip-count must be integers'
sys.exit (1)
ctx = libpyzmq.Context (1, 1);
s = libpyzmq.Socket (ctx, libpyzmq.REP)
s.bind (bind_to)
for i in range (0, roundtrip_count):
msg = s.recv ()
assert len (msg) == message_size
s.send (msg)
time.sleep (1)
if __name__ == "__main__":
main ()
#
# Copyright (c) 2007-2010 iMatix Corporation
#
# This file is part of 0MQ.
#
# 0MQ is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# 0MQ is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Lesser GNU General Public License for more details.
#
# You should have received a copy of the Lesser GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import sys
import time
import libpyzmq
def main ():
if len (sys.argv) != 4:
print 'usage: local_thr <bind-to> <message-size> <message-count>'
sys.exit (1)
try:
bind_to = sys.argv [1]
message_size = int (sys.argv [2])
message_count = int (sys.argv [3])
except (ValueError, OverflowError), e:
print 'message-size and message-count must be integers'
sys.exit (1)
ctx = libpyzmq.Context (1, 1);
s = libpyzmq.Socket (ctx, libpyzmq.SUB)
s.setsockopt (libpyzmq.SUBSCRIBE , "");
# Add your socket options here.
# For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM.
s.bind (bind_to)
msg = s.recv ()
assert len (msg) == message_size
start = time.clock ()
for i in range (1, message_count):
msg = s.recv ()
assert len (msg) == message_size
end = time.clock ()
elapsed = (end - start) * 1000000
if elapsed == 0:
elapsed = 1
throughput = (1000000.0 * float (message_count)) / float (elapsed)
megabits = float (throughput * message_size * 8) / 1000000
print "message size: %.0f [B]" % (message_size, )
print "message count: %.0f" % (message_count, )
print "mean throughput: %.0f [msg/s]" % (throughput, )
print "mean throughput: %.3f [Mb/s]" % (megabits, )
if __name__ == "__main__":
main ()
#
# Copyright (c) 2007-2010 iMatix Corporation
#
# This file is part of 0MQ.
#
# 0MQ is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# 0MQ is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Lesser GNU General Public License for more details.
#
# You should have received a copy of the Lesser GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import sys
import time
import libpyzmq
def main ():
if len(sys.argv) != 4:
print 'usage: remote_lat <connect-to> <message-size> <roundtrip-count>'
sys.exit (1)
try:
connect_to = sys.argv [1]
message_size = int (sys.argv [2])
roundtrip_count = int (sys.argv [3])
except (ValueError, OverflowError), e:
print 'message-size and message-count must be integers'
sys.exit (1)
ctx = libpyzmq.Context (1, 1);
s = libpyzmq.Socket (ctx, libpyzmq.REQ)
s.connect (connect_to)
msg = ''.join ([' ' for n in range (0, message_size)])
start = time.clock ()
for i in range (0, roundtrip_count):
s.send (msg)
msg = s.recv ()
assert len (msg) == message_size
end = time.clock ()
elapsed = (end - start) * 1000000
latency = elapsed / roundtrip_count / 2
print "message size: %.0f [B]" % (message_size, )
print "roundtrip count: %.0f" % (roundtrip_count, )
print "mean latency: %.3f [us]" % (latency, )
if __name__ == "__main__":
main ()
#
# Copyright (c) 2007-2010 iMatix Corporation
#
# This file is part of 0MQ.
#
# 0MQ is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# 0MQ is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Lesser GNU General Public License for more details.
#
# You should have received a copy of the Lesser GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import sys
import libpyzmq
import time
def main ():
if len (sys.argv) != 4:
print 'usage: remote_thr <connect-to> <message-size> <message-count>'
sys.exit (1)
try:
connect_to = sys.argv [1]
message_size = int (sys.argv [2])
message_count = int (sys.argv [3])
except (ValueError, OverflowError), e:
print 'message-size and message-count must be integers'
sys.exit (1)
ctx = libpyzmq.Context (1, 1);
s = libpyzmq.Socket (ctx, libpyzmq.PUB)
# Add your socket options here.
# For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM.
s.connect (connect_to)
msg = ''.join ([' ' for n in range (0, message_size)])
for i in range (0, message_count):
s.send (msg)
time.sleep (10)
if __name__ == "__main__":
main ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment