# Error building with new ZMQ

**URL:** <https://www.ruby-forum.com/t/error-building-with-new-zmq/241218>\
**Category:** GNU Radio\
**Created:** [May 19, 2014, 6:27pm UTC](https://www.ruby-forum.com/t/error-building-with-new-zmq/241218 "2014-05-19T18:27:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [May 19, 2014, 6:27pm UTC](https://www.ruby-forum.com/t/error-building-with-new-zmq/241218/1 "2014-05-19T18:27:20Z")

</div>

In MacPorts, the header is installed as “zmq.h”, not “zmq.hpp”. I can  
easily fix this if somebody else doesn’t want to / if I need to, but I  
have a lot on my queue right now. I’m just disabling ZMQ in the  
MacPorts install for now. - MLD

{{{  
:info:build In file included from  
/opt/local/var/macports/build/\_opt\_MacPorts\_trunk\_dports\_science\_gnuradio/gnuradio-devel/work/gnuradio-cb0bc7f070c41825ab7aee7f093dc326e62e2fdb/gr-zeromq/lib/pub\_sink\_impl.cc:28:  
:info:build  
/opt/local/var/macports/build/\_opt\_MacPorts\_trunk\_dports\_science\_gnuradio/gnuradio-devel/work/gnuradio-cb0bc7f070c41825ab7aee7f093dc326e62e2fdb/gr-zeromq/lib/pub\_sink\_impl.h:27:10:  
fatal error: ‘zmq.hpp’ file not found  
:info:build #include \<zmq.hpp\>  
}}}

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [May 19, 2014, 10:00pm UTC](https://www.ruby-forum.com/t/error-building-with-new-zmq/241218/2 "2014-05-19T22:00:39Z")

</div>

If I look through the tarball for zmq 3.2.4 or 4.0.4, I find only zmq.h,  
no zmq.hpp. From the look of it, zmq is written as mixed C/C++, and the  
API header is purely C (wrapped with extern “C” if included as C++).  
Hence, I think the CMake Find file needs to check for both zmq.hpp and  
zmq.h as the header, then somehow get that info into the gr-zeromq  
sources. - MLD

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [May 19, 2014, 6:38pm UTC](https://www.ruby-forum.com/t/error-building-with-new-zmq/241218/3 "2014-05-19T18:38:26Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [May 20, 2014, 4:28am UTC](https://www.ruby-forum.com/t/error-building-with-new-zmq/241218/4 "2014-05-20T04:28:21Z")

</div>

If I change all of the “zmq.hpp” #include lines to be instead “zmq.h”,  
then I get the following errors:  
{{{  
:info:build In file included from  
/opt/local/var/macports/build/\_opt\_MacPorts\_trunk\_dports\_science\_gnuradio/gnuradio-devel/work/gnuradio-cb0bc7f070c41825ab7aee7f093dc326e62e2fdb/gr-zeromq/lib/sub\_source\_impl.cc:28:  
:info:build  
/opt/local/var/macports/build/\_opt\_MacPorts\_trunk\_dports\_science\_gnuradio/gnuradio-devel/work/gnuradio-cb0bc7f070c41825ab7aee7f093dc326e62e2fdb/gr-zeromq/lib/sub\_source\_impl.h:38:7:  
error: use of undeclared identifier ‘zmq’  
:info:build zmq::context\_t \*d\_context;  
:info:build ^  
:info:build  
/opt/local/var/macports/build/\_opt\_MacPorts\_trunk\_dports\_science\_gnuradio/gnuradio-devel/work/gnuradio-cb0bc7f070c41825ab7aee7f093dc326e62e2fdb/gr-zeromq/lib/sub\_source\_impl.h:39:7:  
error: use of undeclared identifier ‘zmq’  
:info:build zmq::socket\_t \*d\_socket;  
:info:build ^  
}}}

So … it seems like unless there’s some standard way to get zmq.hpp  
then we won’t be using gr-zeromq on OSX. Any ideas? Can someone send  
me that file? - MLD

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [May 21, 2014, 7:40am UTC](https://www.ruby-forum.com/t/error-building-with-new-zmq/241218/5 "2014-05-21T07:40:06Z")

</div>

Yes, that’s what the issue is: YA dependency! Thanks for your prompt  
feedback! I’ll look into creating a cppzmq port, since one does not  
currently exist. We’ll need to add CMake support for checking for this  
dependency, too. - MLD

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [May 20, 2014, 5:14am UTC](https://www.ruby-forum.com/t/error-building-with-new-zmq/241218/6 "2014-05-20T05:14:37Z")

</div>

> <https://github.com/zeromq/cppzmq/blob/master/zmq.hpp>

On Tue, May 20, 2014 at 12:27 PM, Michael D.  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [May 22, 2014, 3:33pm UTC](https://www.ruby-forum.com/t/error-building-with-new-zmq/241218/7 "2014-05-22T15:33:52Z")

</div>

I added a “cppzmq” port that installs this header, which depends on one  
of the various zmq\* ports (2.0, 2.2, 3.2, 4.0). All is happy now within  
MacPorts, but the FindZeroMQ.cmake file needs to be updated to look for  
this header (it just looks for zmq.h and libzmq).

-Sometimes- the test “qa\_zeromq\_pub” fails with the appended error.  
Otherwise, everything seems to be compiling and passing make test. One  
step forward … - MLD

{{{  
test 187  
Start 187: qa\_zeromq\_pub

# 187: Test command: /bin/sh “/opt/local/var/macports/build/\_opt\_MacPorts\_trunk\_dports\_science\_gnuradio/gnuradio-devel/work/build/gr-zeromq/python/zeromq/qa\_zeromq\_pub\_test.sh” 187: Test timeout computed to be: 9.99988e+06 187: E 187:

## 187: ERROR: test\_001 ( **main**.qa\_zeromq\_pub) 187:

187: Traceback (most recent call last):  
187: File  
“/opt/local/var/macports/build/\_opt\_MacPorts\_trunk\_dports\_science\_gnuradio/gnuradio-devel/work/gnuradio-cba2d184e2abb8a52353929a34b562ea4f9bd031/gr-zeromq/python/zeromq/qa\_zeromq\_pub.py”,  
line 47, in test\_001  
187: self.assertFloatTuplesAlmostEqual(self.rx\_data, src\_data)  
187: File  
“/opt/local/var/macports/build/\_opt\_MacPorts\_trunk\_dports\_science\_gnuradio/gnuradio-devel/work/gnuradio-cba2d184e2abb8a52353929a34b562ea4f9bd031/gnuradio-runtime/python/gnuradio/gr\_unittest.py”,  
line 88, in assertFloatTuplesAlmostEqual  
187: self.assertEqual (len(a), len(b))  
187: TypeError: object of type ‘NoneType’ has no len()  
}}}
