Closed t-b closed 5 years ago
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. configure should work even if the user didn't install libzmq via its Linux Distribution packaging system and if the user installed libzmq and cppzmq in a custom directory and use the --with-zmq configure option to specify the zmq install root directory, or using PKG_CONFIG_PATH environment variable to point to the zmq root directory. It looks like this AC_CHECK_HEADERS(zmq.hpp, ...) test is failing in this use case, even though libzmq >= 4.0.5 test passed.
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)?
@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.
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:
--- a/assets/configure.ac
+++ b/assets/configure.ac
@@ -205,7 +205,7 @@ AC_CHECK_HEADERS(zmq.hpp, [], [AC_MSG_ERROR([Couldn't find a compatible zmq.hpp]
int main(int, char**)
{
- zmq::context_t c;
+ zmq::context_t c(1);
zmq::socket_t s(c, ZMQ_REQ);
s.disconnect("some endpoint");
}])
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): https://github.com/tango-controls/cppTango/blob/cppapi_Release_9_2_5/cppapi/client/zmq.hpp
@bourtemb Sounds good. I'll make that change here and in the cppTango repo as well.
@bourtemb Good point. Done.
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.