From da15a2daf2959fb9d7c84ae88ec0e72b512e24e5 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Wed, 21 Jan 2015 12:32:39 -0800 Subject: [PATCH] Check for PyZMQ at runtime instead of compile time to support cross-compiling. --- CMakeLists.txt | 8 ++++---- python/__init__.py | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36c2078..5ede330 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,10 +82,10 @@ endif() # Find PyZMQ bindings ######################################################################## include(GrPython) -GR_PYTHON_CHECK_MODULE("PyZMQ" "zmq" "int(zmq.__version__.split('.')[0]) >= 13" PYZMQ_FOUND) -if(NOT PYZMQ_FOUND) - message(FATAL_ERROR "Python ZMQ bindings not found.") -endif() +#GR_PYTHON_CHECK_MODULE("PyZMQ" "zmq" "int(zmq.__version__.split('.')[0]) >= 13" PYZMQ_FOUND) +#if(NOT PYZMQ_FOUND) +# message(FATAL_ERROR "Python ZMQ bindings not found.") +#endif() ######################################################################## # Setup the include and linker paths diff --git a/python/__init__.py b/python/__init__.py index 29e0475..77441bf 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -51,6 +51,12 @@ from air_modes_swig import * # import any pure python here # + +try: + import zmq +except ImportError: + raise RuntimeError("PyZMQ not found! Please install libzmq and PyZMQ to run gr-air-modes") + from rx_path import rx_path from zmq_socket import zmq_pubsub_iface from parse import *