-
Notifications
You must be signed in to change notification settings - Fork 5
assets/configure.ac: Check for zmq.hpp header #54
Conversation
|
Thanks for creating this PR and looking into this. I am still a newbie with the autotools. It looks like this AC_CHECK_HEADERS is looking for system headers zmq.hpp and will complain if it is not found in the include system directories. |
|
But maybe here I am doing the wrong assumption that zmq.hpp include file is installed in the same directory as libzmq.h file (which was the case in my test)? |
We do require the header for compilation but do currently not check for it. The code snippet ensures that we get a recent version with zmq::socket_t::disconnect method. This snipped is copied from cppTango/6402affe (Use feature tests for checking if we have zmq::socket::disconnect, 2019-10-23). Saving and restoring CXXFLAGS allows us to honour a custom zmq-prefix which makes it possible to have libzmq and cppzmq in different locations. So the following now works: git clone https://github.com/zeromq/libzmq cd libzmq mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=$HOME/libzmq -DENABLE_DRAFTS=OFF .. make make install git clone https://github.com/zeromq/cppzmq cd cppzmq mkdir build cd build export CMAKE_PREFIX_PATH=$HOME/libzmq/share/cmake/ZeroMQ cmake -DCMAKE_INSTALL_PREFIX=$HOME/cppzmq -DENABLE_DRAFTS=OFF -DCPPZMQ_BUILD_TESTS=OFF .. make make install ./configure --with-zmq=$HOME/libzmq CXXFLAGS="-I $HOME/cppzmq/include" make
|
@bourtemb I've fixed one issue regarding different locations for libzmq and cppzmq. The commit message has detailed instructions for testing. This works here on debian stretch. |
4407f27 to
c6a3601
Compare
|
I propose the following patch to support some additional older versions of zmq.hpp file which were already supporting the disconnect method but didn't have a zmq::context_t default constructor: This could be useful for people who try to use the zmq.hpp file which was provided in some previous Tango distributions (this file is still compatible): |
|
@bourtemb Sounds good. I'll make that change here and in the cppTango repo as well. |
We used to ship a version of zmg.hpp with cppTango, see 5144cb80 (Add again zmq.hpp before tagging release 9.2.5 to be consistent with 9.2.5 version from SVN Sourceforge (#348), 2017-01-11) in tango-controls/cppTango. And in that version there was no default constructor for zmq::context_t available. The constructor taking an integer parameter is still available in newer versions so we can just use that here.
|
@bourtemb Good point. Done. |
bourtemb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
We do require the header for compilation but do currently not check for
it. The code snippet ensures that we get a recent
version with zmq::socket_t::disconnect method. This snipped is copied
from cppTango/6402affe (Use feature tests for checking if we have
zmq::socket::disconnect, 2019-10-23).
I'm not very familiar with autotools, but that works here.