mmdvm-sdr
mmdvm-sdr copied to clipboard
Having issues compiling code on Pi after zmq additions
Hi! I'm trying to get this up by installing libzmq and running make on a raspberry pi 4(64 bit image) and it is failing to compile after ab1cc22.
pi@mmdvm:~/mmdvm-sdr/build $ sudo apt install libzmq3-dev
[...]
The following NEW packages will be installed:
libzmq3-dev libzmq5
0 upgraded, 2 newly installed, 0 to remove and 76 not upgraded.
[...]
pi@mmdvm:~/mmdvm-sdr/build $ make -j4
[ 5%] Building CXX object CMakeFiles/mmdvm.dir/IORPi.cpp.o
[ 5%] Building CXX object CMakeFiles/mmdvm.dir/IO.cpp.o
/home/pi/mmdvm-sdr/IO.cpp: In constructor ‘CIO::CIO()’:
/home/pi/mmdvm-sdr/IO.cpp:93:16: error: no matching function for call to ‘zmq::socket_t::socket_t()’
m_lockout(false)
^
In file included from /home/pi/mmdvm-sdr/IO.h:28,
from /home/pi/mmdvm-sdr/Globals.h:94,
from /home/pi/mmdvm-sdr/IO.cpp:22:
/usr/include/zmq.hpp:474:16: note: candidate: ‘zmq::socket_t::socket_t(zmq::socket_t&&)’
inline socket_t(socket_t&& rhs) ZMQ_NOTHROW : ptr(rhs.ptr)
^~~~~~~~
/usr/include/zmq.hpp:474:16: note: candidate expects 1 argument, 0 provided
/usr/include/zmq.hpp:467:16: note: candidate: ‘zmq::socket_t::socket_t(zmq::context_t&, zmq::socket_type)’
inline socket_t(context_t& context_, socket_type type_)
^~~~~~~~
/usr/include/zmq.hpp:467:16: note: candidate expects 2 arguments, 0 provided
/usr/include/zmq.hpp:461:16: note: candidate: ‘zmq::socket_t::socket_t(zmq::context_t&, int)’
inline socket_t(context_t& context_, int type_)
^~~~~~~~
/usr/include/zmq.hpp:461:16: note: candidate expects 2 arguments, 0 provided
/home/pi/mmdvm-sdr/IO.cpp:93:16: error: no matching function for call to ‘zmq::socket_t::socket_t()’
m_lockout(false)
^
In file included from /home/pi/mmdvm-sdr/IO.h:28,
from /home/pi/mmdvm-sdr/Globals.h:94,
from /home/pi/mmdvm-sdr/IO.cpp:22:
/usr/include/zmq.hpp:474:16: note: candidate: ‘zmq::socket_t::socket_t(zmq::socket_t&&)’
inline socket_t(socket_t&& rhs) ZMQ_NOTHROW : ptr(rhs.ptr)
^~~~~~~~
/usr/include/zmq.hpp:474:16: note: candidate expects 1 argument, 0 provided
/usr/include/zmq.hpp:467:16: note: candidate: ‘zmq::socket_t::socket_t(zmq::context_t&, zmq::socket_type)’
inline socket_t(context_t& context_, socket_type type_)
^~~~~~~~
/usr/include/zmq.hpp:467:16: note: candidate expects 2 arguments, 0 provided
/usr/include/zmq.hpp:461:16: note: candidate: ‘zmq::socket_t::socket_t(zmq::context_t&, int)’
inline socket_t(context_t& context_, int type_)
^~~~~~~~
/usr/include/zmq.hpp:461:16: note: candidate expects 2 arguments, 0 provided
/home/pi/mmdvm-sdr/IORPi.cpp: In member function ‘void CIO::interrupt()’:
/home/pi/mmdvm-sdr/IORPi.cpp:116:43: error: ‘zmq::send_flags’ has not been declared
m_zmqsocket.send (reply, zmq::send_flags::dontwait);
^~~~~~~~~~
/home/pi/mmdvm-sdr/IORPi.cpp: In member function ‘void CIO::interruptRX()’:
/home/pi/mmdvm-sdr/IORPi.cpp:147:10: error: ‘recv_result_t’ is not a member of ‘zmq’
zmq::recv_result_t recv_result = m_zmqsocketRX.recv(mq_message, zmq::recv_flags::none);
^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/mmdvm.dir/build.make:271: CMakeFiles/mmdvm.dir/IO.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/mmdvm.dir/build.make:284: CMakeFiles/mmdvm.dir/IORPi.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/mmdvm.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
I was able to compile the last commit as of writing on my Ubuntu x86, but for my purpose I'd like to run this off a Pi, so I'm stuck on ab1cc22. Using the provided cross compiler file which seems to not expect any external dependencies and isn't updated.
Quick fix for the time being:
https://github.com/cutcoin/cutcoin/issues/5#issuecomment-712358180
Make a backup of /usr/include/zmq.hpp before overwriting. Seems to fix the issue for me on RPi. Kindly test and let me know. @kantooon any suggestions ?
@r4d10n That works! I'm not sure if that's the most practical fix but it allows me to compile and run this now. I'll leave this issue open so you can devise a fix, which honestly might just be putting that command in the README for Raspberry Pi users.
https://github.com/r4d10n/mmdvm-sdr/commit/c43a5d4906fc1a4dbcfa0a7f7f918f4a797be2ea fixes the error in IO.cpp. Tested working in x86 and arm environments.
There seems to be some broken API changes in ZMQ, which causes the ‘zmq::send_flags’ has not been declared
/ ‘recv_result_t’ is not a member of ‘zmq’
errors. To be further investigated.
Probably caused by older versions of libzmq. Starting with libzmq4 send_flags are sort of required and the old calls have been deprecated.
I can replicate on debian buster:
[xxx@xxx]:/tmp/mmdvm-sdr/build> make
Scanning dependencies of target mmdvm
[ 2%] Building CXX object CMakeFiles/mmdvm.dir/CWIdTX.cpp.o
[ 5%] Building CXX object CMakeFiles/mmdvm.dir/CalDMR.cpp.o
[ 8%] Building CXX object CMakeFiles/mmdvm.dir/CalDStarRX.cpp.o
[ 11%] Building CXX object CMakeFiles/mmdvm.dir/CalDStarTX.cpp.o
[ 13%] Building CXX object CMakeFiles/mmdvm.dir/CalNXDN.cpp.o
[ 16%] Building CXX object CMakeFiles/mmdvm.dir/CalP25.cpp.o
[ 19%] Building CXX object CMakeFiles/mmdvm.dir/CalRSSI.cpp.o
[ 22%] Building CXX object CMakeFiles/mmdvm.dir/DMRDMORX.cpp.o
[ 25%] Building CXX object CMakeFiles/mmdvm.dir/DMRDMOTX.cpp.o
[ 27%] Building CXX object CMakeFiles/mmdvm.dir/DMRIdleRX.cpp.o
[ 30%] Building CXX object CMakeFiles/mmdvm.dir/DMRRX.cpp.o
[ 33%] Building CXX object CMakeFiles/mmdvm.dir/DMRSlotRX.cpp.o
[ 36%] Building CXX object CMakeFiles/mmdvm.dir/DMRSlotType.cpp.o
[ 38%] Building CXX object CMakeFiles/mmdvm.dir/DMRTX.cpp.o
[ 41%] Building CXX object CMakeFiles/mmdvm.dir/DStarRX.cpp.o
[ 44%] Building CXX object CMakeFiles/mmdvm.dir/DStarTX.cpp.o
[ 47%] Building CXX object CMakeFiles/mmdvm.dir/IO.cpp.o
[ 50%] Building CXX object CMakeFiles/mmdvm.dir/IORPi.cpp.o
/tmp/mmdvm-sdr/IORPi.cpp: In member function ‘void CIO::interrupt()’:
/tmp/mmdvm-sdr/IORPi.cpp:116:43: error: ‘zmq::send_flags’ has not been declared
m_zmqsocket.send (reply, zmq::send_flags::dontwait);
^~~~~~~~~~
/tmp/mmdvm-sdr/IORPi.cpp: In member function ‘void CIO::interruptRX()’:
/tmp/mmdvm-sdr/IORPi.cpp:147:10: error: ‘recv_result_t’ is not a member of ‘zmq’
zmq::recv_result_t recv_result = m_zmqsocketRX.recv(mq_message, zmq::recv_flags::none);
^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/mmdvm.dir/build.make:284: CMakeFiles/mmdvm.dir/IORPi.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/mmdvm.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
Checking out the commit 421a2f3bbb8cbad60c9de61e1b5d2a23b9dae028
and then building that works however.