Re: [zeromq-dev] Limited UDP Message Size
Ah okay. I read some posts about MTU and fragmentation. So in theory 2^16= 65536 Bytes should be possible, but not all nodes will accept such large UDP packets and support the fragmentation of it? FYI: My use case is that of a local network (IOT + Autonomous Robots) and increasing the size would help me. :) On 12.01.20 13:25, Doron Somech wrote: We can increase it to around 65,000 bytes, however, large UDP packets would probably be dropped when traveling outside your local area network. The safe size for the UDP packet to travel outside of the local area network is around 500 bytes. If you do want to use large UDP packets on your local area network you might want to increase the network MTU (jumbo frames) for better delivery. For example, some AWS instances support 9001 bytes MTU for inter-instance communication. On Fri, Jan 10, 2020 at 3:25 PM Stephan Opfer <mailto:op...@vs.uni-kassel.de>> wrote: Hi all, since 2016 there is this issue (https://github.com/zeromq/libzmq/issues/2009) about some limitations of the udp_engine in libzmq. Is it possible that someone at least will increase the "#define MAX_UDP_MSG 8192" in libzmq/src/udp_engine.hpp to some reasonable value? For example "ZMQ_MAX_MSGSZ" from the zmq context option, which is MAX_INT. Maybe, someone could spare some time at the Hackathon... ;-) Greetings, Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6279 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org <mailto:zeromq-dev@lists.zeromq.org> https://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6279 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
[zeromq-dev] Limited UDP Message Size
Hi all, since 2016 there is this issue (https://github.com/zeromq/libzmq/issues/2009) about some limitations of the udp_engine in libzmq. Is it possible that someone at least will increase the "#define MAX_UDP_MSG 8192" in libzmq/src/udp_engine.hpp to some reasonable value? For example "ZMQ_MAX_MSGSZ" from the zmq context option, which is MAX_INT. Maybe, someone could spare some time at the Hackathon... ;-) Greetings, Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6279 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] UDP Multicast - Problem with large message sizes?
Found this one: https://github.com/zeromq/libzmq/issues/2009 Is it still not fixed? According to github it needs stacktraces. Should I post mine there? On 09.09.19 21:09, Stephan Opfer wrote: Hi all, when I try to send large messages (~65kB) via UDP Multicast (per draft API, RADIO/DISH), I instantly get Bad file descriptor (src/epoll.cpp:113) #0 0x7faad868ee90 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #1 0x7faad868e870 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #2 0x7faad86d72f0 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #3 0x7faad86d8740 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #4 0x7faad86d73d0 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #5 0x7faad8692370 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #6 0x7faad868e120 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #7 0x7faad86d3440 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #8 0x7faad75b46db in /lib/x86_64-linux-gnu/libpthread.so.0 (start_thread+0xdb) #9 0x7faad699e8c8 in /lib/x86_64-linux-gnu/libc.so.6 (clone+0x3f) Is it known, that the draft API has Problems with large message sizes? What does the assertion in line epoll.cpp:113 actually check and what could be the reason to make it fail? Do you need a MWE in order to investigate it? I probably can create a simple main, that reproduces this error. Last remark (not 100% sure about this): If I reduce the message size to ~2kB, it takes several of these message (~254) to get this error, but the number of messages seems to be always the same. Greetings Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
[zeromq-dev] UDP Multicast - Problem with large message sizes?
Hi all, when I try to send large messages (~65kB) via UDP Multicast (per draft API, RADIO/DISH), I instantly get Bad file descriptor (src/epoll.cpp:113) #0 0x7faad868ee90 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #1 0x7faad868e870 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #2 0x7faad86d72f0 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #3 0x7faad86d8740 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #4 0x7faad86d73d0 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #5 0x7faad8692370 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #6 0x7faad868e120 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #7 0x7faad86d3440 in /usr/lib/x86_64-linux-gnu/libzmq.so.5 (?+0x0) #8 0x7faad75b46db in /lib/x86_64-linux-gnu/libpthread.so.0 (start_thread+0xdb) #9 0x7faad699e8c8 in /lib/x86_64-linux-gnu/libc.so.6 (clone+0x3f) Is it known, that the draft API has Problems with large message sizes? What does the assertion in line epoll.cpp:113 actually check and what could be the reason to make it fail? Do you need a MWE in order to investigate it? I probably can create a simple main, that reproduces this error. Last remark (not 100% sure about this): If I reduce the message size to ~2kB, it takes several of these message (~254) to get this error, but the number of messages seems to be always the same. Greetings Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Memory pool for zmq_msg_t
On 04.07.19 14:29, Luca Boccassi wrote: How users make use of these primitives is up to them though, I don't think anything special was shared before, as far as I remember. Some example can be found here: https://github.com/dasys-lab/capnzero/tree/master/capnzero/src The classes Publisher and Subscriber should replace the publisher and subscriber in a former Robot-Operating-System-based System. I hope that the subscriber is actually using the method Luca is talking about on the receiving side. The message data here is a Cap'n Proto container that we "simply" serialize and send via ZeroMQ -> therefore the name Cap'nZero ;-) -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6279 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Revisited: Example for building against ZMQ with CMake + UDP Multicast Support
(zmq_msg_t*, void*, char const*, char const*)': Discovery.cpp:(.text+0x148): undefined reference to `zmq_msg_group' /tmp/ccUwelWs.o: In function `main': Discovery.cpp:(.text+0x30e): undefined reference to `zmq_leave' Discovery.cpp:(.text+0x37f): undefined reference to `zmq_join' Discovery.cpp:(.text+0x3c3): undefined reference to `zmq_join' Discovery.cpp:(.text+0x407): undefined reference to `zmq_join' Discovery.cpp:(.text+0x57c): undefined reference to `zmq_join' Discovery.cpp:(.text+0x668): undefined reference to `zmq_leave' collect2: error: ld returned 1 exit status Any help is welcome. :) Kind Regards Stephan ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org <mailto:zeromq-dev@ lists .zero mq.org> https://lists.zeromq.org/mailman/listinfo/zerom q-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org <mailto:zeromq-dev@li sts.z eromq .org> https://lists.zeromq.org/mailman/listinfo/zeromq- dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org <mailto:zeromq-dev@list s.zer omq.o rg> https://lists.zeromq.org/mailman/listinfo/zeromq-de v ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] CMakeLists.txt for ROS while using ZeroMQ
Hi, have a look at the capnzero ROS package: https://github.com/carpe-noctem-cassel/symrock/tree/zmq/capnzero CMakeLists works with FindZMQ.cmake file in the cmake folder. Greetings, Stephan On 24.11.2017 16:07, Ravi Joshi via zeromq-dev wrote: Hi, Hope you are having a great time. I am trying to use ZeroMQ in ROS C++. I am looking for CMakeLists.txt file for ZeroMQ. From the Google, I found that there is a ROS Package to do it (https://github.com/ethz-asl/zeromq_catkin). However, it seems that this package downloads and compiles ZeroMQ first. I already have ZeroMQ installed and working fine. Hence I don't want to install it again. I have written a standalone C++ ZeroMQ code, which works fine but I am not able to compile it with ROS. Since I don't know CMakeLists.txt. Please have a look at the following Pastebin links to see CMakeLists.txt [1] "[ROS]CMakeLists.txt": (https://pastebin.com/29AKZvmF) This is the ROS file, which I am looking for. Unfortunately, this is not working. [2] "[Standalone]CMakeLists.txt": (https://pastebin.com/TC1Bw4t5) This is standalone file and it is working properly. Please note that I am using ROS Indigo on Ubuntu 14.04 LTS PC. - Thanks Ravi ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Is shared ownership possible while sending with zero-copy?
Hi Patrik, it is very likely to be a premature optimization, but on the other hand we would like to replace the ROS Middleware with a combination of Cap'n Proto and ZeroMQ. So I actually don't know which kind of messages the following generations are trying to send. We, that is the Carpe Noctem Cassel RoboCup team (www.das-lab.net). We usually play with 5 robots connected over a local access point. Therefore, we use UDP Multicast. An "extrem" example would be the transfer of 2D laser scan data: 1080 * 8 byte = 8640 byte, 30 times per second = 253.125 KByte / sec. Or for debugging purpose the transfere of a live camera stream with roughly 900x900 pixels. The required amount of memory per transfered image depends on the compression. For raw images it is 46.35 MBytes / sec. Greetings, Stephan I'm just curious, how large are those sensor values, how many do you keep around, and to how many other robots do you intend to send them? Could it be premature optimization? Just asking because maybe it's not worth the extra effort to make it zero-copy. Just copy and pass ownership to ZMQ. Regards, Patrik On 31 Aug 2017, at 20:06, Thomas Rodgers wrote: Unfortunately that's not possible, libzmq exposes only a C API, and even though it is implemented in C++, it deliberately targets pre-C++11 compilers. Further to the 'mark and sweep' idea, or more generally, deferred reclamation. You could have the callback place the message to be freed on a (possibly lock free, Boost has a handy one) queue and signal a 'reaper' thread (waiting on a condition_variable). The reaper thread wakes up, reclaims all queued message buffers then returns to waiting. On Thu, Aug 31, 2017 at 10:55 AM Stephan Opfer wrote: > Another, more complicated way, would be to implement a mark > garbage collector of sorts: instead of freeing the buffer, the callback > you register with zmq_msg_init_data would mark the buffer as done (in a > thread safe way!). Then your application's garbage collector can sweep > it. It would be nice, if I could pass over a copy of (not reference or pointer to) a shared_ptr that owns the buffer, but with the call back and the "void * hint" this wasn't possible for me. -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev at lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev at lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev -- next part -- An HTML attachment was scrubbed... URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170831/1adcf6fa/attachment.html> -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Is shared ownership possible while sending with zero-copy?
Another, more complicated way, would be to implement a mark garbage collector of sorts: instead of freeing the buffer, the callback you register with zmq_msg_init_data would mark the buffer as done (in a thread safe way!). Then your application's garbage collector can sweep it. It would be nice, if I could pass over a copy of (not reference or pointer to) a shared_ptr that owns the buffer, but with the call back and the "void * hint" this wasn't possible for me. -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
[zeromq-dev] Is shared ownership possible while sending with zero-copy?
Hi all, I am trying to use zmq_msg_init_data in order to have the zero-copy advantage. Now it is required, that I either pass a function, that can deallocate the data after zmq sent it, or I pass NULL in order to keep the ownership. In the latter case: How do I know that zmq has done his work and I can deallocate the data? Another idea was to pass a lambda function (with a capture) to zmq, in order to make zmq send a signal by calling the lambda function. The problem is, that it is not allowed to pass lambda functions with captures as function pointers and without captures, I have no clue how zmq could pass the signal. Maybe somebody of you now already have an idea? The general idea is: My robotic application keeps some sensor values for a while and sends some of the values to other robots via zmq. Therefore I don't want the data to be copied and I don't want zmq to deallocate it. I want my own application to deallocate it, if it is not needed anymore and zmq did send everything. Greetings, Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] zmq_msg_send returns "Resource temporarily unavailable"
Hi Radek, can you sketch some lines for this. I also thought about passing a shared_ptr as capture of a lambda function, but captures are not allowed in lambdas when passing it as function pointers. I did write another message to the mailing list, as the topic now changed a little bit. Greetings, Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] zmq_msg_send returns "Resource temporarily unavailable"
Hi Luca, thank you for your hints. I am currently stuck with a little problem, that is probably related to your hin about cleaning up the messages to early. My current state is uploaded on gist: https://gist.github.com/StephanOpfer/98e32c13c822c33e06d56bc82956c7c2 The thing is, that the messages are transfered correctly, when my process waits for some time, before it ends. So my question is, what do I don't understand correctly here? My current impression, or explanation of this phenomenon, is that the zmq_msg_send method is working asynchronously and the process ended, before zmq can send everything correctly. If that is the case I am not sure, what the best way will be to manage the data in my real application. How do I know, that zmq has finished sending my data, so that it would be ok to delete it. If I would let zmq decide to delete the data (by passing a deallocator method to zmq_msg_init_data), it could happen that it deletes the data to early for other parts of my application. Greetings, Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
[zeromq-dev] zmq_msg_send returns "Resource temporarily unavailable"
Hi all, after the second sending over a RADIO socket, the send method always returns resource temporarily unavailable. Nevertheless the sockets is sending something every call. Here are the few lines of code I use: this->ctx = zmq_ctx_new(); this->socket = zmq_socket(ctx, ZMQ_RADIO); zmq_connect(socket, "udp://224.0.0.1:") zmq_msg_t msg; zmq_msg_init_data(, byteArray.begin(), byteArray.size(), NULL, NULL); zmq_msg_set_group(, "TestMCGroup"); zmq_msg_send(, this->socket, 0); // <-- return code is 11 - Resource temporarily unavailable zmq_msg_close(); I am sending in a while(true) loop. Is that too fast? Do I actually have problem at all? Greetings, Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Rare feature combination possible?
Note that multi-part does _not_ imply contiguous memory location on the receive end (it might happen but there's no guarantee anywhere). So if that's a requirement for your use case, then you need to use a single message anyway. No on the receiving site I think that I'll need to accept to copy the data anyway. -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Rare feature combination possible?
Hi Luca, the reason for me to use multi-part messages is, that I have the content of a message already in memory, but not in one continues memory sequence. So if I want to achieve zero-copy, I need to compose the message from several memory locations, that should not be copied. When I understand you right, I just need to send several messages (one for each memory location)? I think, that this would break my attempt to use Cap'n Proto (de)serialization. At least it could be tricky to recompose the Cap'n Proto message on the receiving side. My current workflow contained the following step: 1. Compose the Cap'n Proto message by let the message pointing to the different parts / memory locations. 2. Send the different parts of the Cap'n Proto message as multi-part message via ZMQ + UDP + Multicast. 3. Receive the Multi-Part message and reconstruct a Cap'n Proto message from it. Instead step 3. now would need to receive several messages (incl. handling missing messages) in order to recreate the Cap'n Proto message. My think that zero-copy isn't worth the hassle, in that case. So instead I tend to copy everything into one continuous memory sequence and send it as one message, which would just mean that I can compose the Cap'n Proto message without taking care of zero-copy. Any thoughts? Greetings, Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
[zeromq-dev] Does ZMQ help for determining the IP-Address of available interfaces?
Hi, I would like to know the names and IPs of all available interfaces of my machine. I am utilising Ubuntu 16.04 and asked myself, whether zmq could make things easier here? Greetings, Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Example for building against ZMQ with CMake + UDP Multicast Support
On 10.01.2017 23:04, Luca Boccassi wrote: Gh. Why, gcc, why!! You need to pass the source file BEFORE the linker flags. This works: g++ Discovery.cpp `pkg-config --libs --cflags libzmq` -o test This fails: g++ `pkg-config --libs --cflags libzmq` Discovery.cpp -o test Unbelievable. And I'm sure I've tripped over this a few times already... Thanks, that helped! Now I could compile it manually and know that I did install the zmq correctly. With the help of this CMake Module: https://github.com/Kitware/Remus/blob/master/CMake/FindZeroMQ.cmake I could make it work with my CMakeLists.txt. These are the critical lines: # Define where to find modules for ZeroMQ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake CACHE INTERNAL "" FORCE) add_definitions(-DZMQ_BUILD_DRAFT_API=1) find_package(ZeroMQ) The rest is just standard setting include dirs and linking libraries: include_directories(include ${ZeroMQ_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} ${ZeroMQ_LIBRARIES}) -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Example for building against ZMQ with CMake + UDP Multicast Support
On 10.01.2017 22:20, Luca Boccassi wrote: luca@luca-desktop:/tmp$ apt-cache policy libzmq3-dev libzmq3-dev: Installed: 1483950852.598befc Candidate: 1483950852.598befc Version table: *** 1483950852.598befc 0 500http://download.opensuse.org/repositories/home:/zeromq:/git-draft/Debian_8.0/ ./ Packages 100 /var/lib/dpkg/status 4.2.1-2 0 103http://httpredir.debian.org/debian/ sid/main amd64 Packages 4.2.0-2 0 104http://httpredir.debian.org/debian/ stretch/main amd64 Packages 4.0.5+dfsg-2+deb8u1 0 500http://httpredir.debian.org/debian/ jessie/main amd64 Packages 500http://security.debian.org/ jessie/updates/main amd64 Packages luca@luca-desktop:/tmp$ g++ `pkg-config --libs --cflags libzmq` Discovery.cpp -o test luca@luca-desktop:/tmp$ ./test Builds just fine (binary runs and never exits not sure if that's intended). I am honestly not sure why your linker is being picky. This is on Debian 8 with gcc 4.9.2 $ apt-cache policy libzmq3-dev libzmq3-dev: Installed: 1483950852.598befc Candidate: 1483950852.598befc Version table: *** 1483950852.598befc 500 500 http://download.opensuse.org/repositories/home:/zeromq:/git-draft/xUbuntu_16.04 ./ Packages 100 /var/lib/dpkg/status 4.1.4-7 500 500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages A little bit strang, that I don't see a Version named 4.2.x like you have. Nevertheless, this would only create a lack of the new UDP Multicast feature, but my linker complains about standard functions like zmq_ctx_new... I am using g++ version 5.4.0 on Ubuntu 16.04 LTS. I further guaranteed that there is only one libzmq. Its location is: /usr/lib/x86_64-linux-gnu/libzmq.so.5.1.2 And I checked that the wanted symbol is in there with: readelf -Ws /usr/lib/x86_64-linux-gnu/libzmq.so.5.1.2 Normally under this circumstances problems like mismatching architecture of the .so is the case, but I can't see any hints for that. -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Example for building against ZMQ with CMake + UDP Multicast Support
On 10.01.2017 22:10, Luca Boccassi wrote: Can you share the source of discovery.ccp in a gitst/pastebin, or another minimal example that reproduces the problem? Yes no problem: Discovery.cpp is basically copy past of https://github.com/zeromq/libzmq/blob/master/tests/test_radio_dish.cpp but I made some changes: https://gist.github.com/StephanOpfer/df1f589c69da6c2e264bddbd9afe730c -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Example for building against ZMQ with CMake + UDP Multicast Support
On 10.01.2017 17:28, Luca Boccassi wrote: As always on *NIX, use pkg-config and your life will be much easier. eg: g++ `pkg-config --cflags --libs libzmq` foo.cpp -o foo Ok, with pkg-config I can compile, but the linker is still complaining. Here is my command for compiling: g++ -DZMQ_BUILD_DRAFT_API=1 -I/usr/local/include -L/usr/local/lib -lzmq Discovery.cpp -o foo "pkg-config --cflags --libs libzmq" created "-DZMQ_BUILD_DRAFT_API=1 -I/usr/local/include -L/usr/local/lib -lzmq", which seems right as far as I can tell. Here some linker errors: /tmp/ccLV8vrk.o: In function `main': Discovery.cpp:(.text+0x24e): undefined reference to `zmq_ctx_new' Discovery.cpp:(.text+0x28c): undefined reference to `zmq_socket' Discovery.cpp:(.text+0x2a7): undefined reference to `zmq_socket' Discovery.cpp:(.text+0x2c2): undefined reference to `zmq_bind' Discovery.cpp:(.text+0x2fe): undefined reference to `zmq_leave' Discovery.cpp:(.text+0x369): undefined reference to `zmq_join' Discovery.cpp:(.text+0x3a5): undefined reference to `zmq_join' Discovery.cpp:(.text+0x3e1): undefined reference to `zmq_join' Discovery.cpp:(.text+0x41d): undefined reference to `zmq_connect' Discovery.cpp:(.text+0x528): undefined reference to `zmq_join' Discovery.cpp:(.text+0x55a): undefined reference to `zmq_sleep' Discovery.cpp:(.text+0x5f8): undefined reference to `zmq_leave' Discovery.cpp:(.text+0x62a): undefined reference to `zmq_sleep' Discovery.cpp:(.text+0x70c): undefined reference to `zmq_poll' Discovery.cpp:(.text+0x7ab): undefined reference to `zmq_close' Discovery.cpp:(.text+0x7e2): undefined reference to `zmq_close' Discovery.cpp:(.text+0x819): undefined reference to `zmq_ctx_term' collect2: error: ld returned 1 exit status -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Example for building against ZMQ with CMake + UDP Multicast Support
On 10.01.2017 17:28, Luca Boccassi wrote: Append to /etc/apt/sources.list : debhttp://download.opensuse.org/repositories/home:/zeromq:/git-draft/xUbuntu_16.04/ ./ How do I sign the key of this repo? -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Example for building against ZMQ with CMake + UDP Multicast Support
On 10.01.2017 17:21, Kevin Sapper wrote: there is a cmake option "ENABLE_DRAFTS" which should do the same. Do I have to include this option into the compilation of my project, too? Or is it just for compiling libzmq with CMake? -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev
[zeromq-dev] Example for building against ZMQ with CMake + UDP Multicast Support
Hi all, I could need a little help with using ZMQ. I try to setup my project with CMake under Ubuntu 16.04 LTS and I need the ZMQ UDP Multicast Support available as draft in the latest version. Does somebody have an working example CMake based project? I tried to compile the test_radio_dish.cpp by replacing the testutil.hpp by directly including the necessary headers. So far I #include and #include . I got the compile error: ‘zmq_msg_set_group’ was not declared in this scope "rc = zmq_msg_set_group (msg_, group_);" My first guess would be that I didn't compile libzmq the right way for being "zmq_msg_set_group" available. Here is what I did: - Download the tar for libzmq 4.2 - ./configure --enable-drafts - make - sudo make install After that the libraries where located in /usr/local/lib and the headers in /usr/local/include. Greetings, Stephan -- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/ ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org https://lists.zeromq.org/mailman/listinfo/zeromq-dev