# Build error in the v6-26-00-patches branch fails to build on Ubuntu 18.04

**URL:** <https://root-forum.cern.ch/t/build-error-in-the-v6-26-00-patches-branch-fails-to-build-on-ubuntu-18-04/49149>\
**Category:** ROOT\
**Tags:** build\
**Created:** [March 12, 2022, 4:22pm UTC](https://root-forum.cern.ch/t/build-error-in-the-v6-26-00-patches-branch-fails-to-build-on-ubuntu-18-04/49149 "2022-03-12T16:22:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 12, 2022, 4:22pm UTC](https://root-forum.cern.ch/t/build-error-in-the-v6-26-00-patches-branch-fails-to-build-on-ubuntu-18-04/49149/1 "2022-03-12T16:22:13Z")

</div>

This is Ubuntu 18.04 LTS / x86\_64 / gcc, g++, gfortran 7.5.0 / cmake 3.20.3 here. The building of the current “v6-26-00-patches” branch (as of 2022.03.12) generates an error (“`--std=c++14`”):

```nohighlight
(...)
In file included from /tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/src/ZeroMQSvc.cpp:14:0:
/tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/res/RooFit_ZMQ/ZeroMQSvc.h: In member function ‘void ZmqLingeringSocketPtrDeleter<PERIOD>::operator()(zmq::socket_t*)’:
/tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/res/RooFit_ZMQ/ZeroMQSvc.h:60:24: error: ‘class zmq::socket_t’ has no member named ‘set’; did you mean ‘send’?
                socket->set(zmq::sockopt::linger, PERIOD);
                        ^~~
                        send
/tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/res/RooFit_ZMQ/ZeroMQSvc.h:60:33: error: ‘zmq::sockopt’ has not been declared
                socket->set(zmq::sockopt::linger, PERIOD);
                                 ^ ~~~~~~
/tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/res/RooFit_ZMQ/ZeroMQSvc.h: At global scope:
/tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/res/RooFit_ZMQ/ZeroMQSvc.h:79:36: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
 using ZmqLingeringSocketPtr = std::unique_ptr<zmq::socket_t, ZmqLingeringSocketPtrDeleter<PERIOD>>;
                                    ^ ~~~~~~~~~
(...)
/tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/res/RooFit_ZMQ/ZeroMQSvc.h:103:6: error: no matching function for call to ‘zmq::socket_t::recv(std::reference_wrapper<zmq::message_t>&, int&)’
In file included from /tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/res/RooFit_ZMQ/ZeroMQSvc.h:17:0,
                 from /tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/res/RooFit_ZMQ/ZeroMQPoller.h:17,
                 from /tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/src/ZeroMQPoller.cpp:14:
/usr/include/zmq.hpp:625:23: note: candidate: size_t zmq::socket_t::recv(void*, size_t, int)
         inline size_t recv (void *buf_, size_t len_, int flags_ = 0)
                       ^~~~
/usr/include/zmq.hpp:625:23: note: no known conversion for argument 1 from ‘std::reference_wrapper<zmq::message_t>’ to ‘void*’
/usr/include/zmq.hpp:635:21: note: candidate: bool zmq::socket_t::recv(zmq::message_t*, int)
         inline bool recv (message_t *msg_, int flags_ = 0)
                     ^~~~
/usr/include/zmq.hpp:635:21: note: no known conversion for argument 1 from ‘std::reference_wrapper<zmq::message_t>’ to ‘zmq::message_t*’
In file included from /tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/res/RooFit_ZMQ/ZeroMQPoller.h:17:0,
                 from /tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/src/ZeroMQPoller.cpp:14:
(...)
/tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/src/ZeroMQPoller.cpp:231:14: error: ‘m_fds’ was not declared in this scope
    auto it = m_fds.find(fd);
              ^ ~~~~
/tmp/ROOT/v6-26-00-patches/roofit/roofitZMQ/src/ZeroMQPoller.cpp:231:14: note: suggested alternative: ‘m_free’
    auto it = m_fds.find(fd);
              ^ ~~~~
              m_free
Consolidate compiler generated dependencies of target obj.clingInterpreter
[73%] Built target obj.clingInterpreter
[73%] Built target clingInterpreter
[73%] Built target CLING
[73%] Built target clad
[73%] Built target LLVMRES
Consolidate compiler generated dependencies of target ClingUtils
roofit/roofitZMQ/CMakeFiles/RooFitZMQ.dir/build.make:89: recipe for target 'roofit/roofitZMQ/CMakeFiles/RooFitZMQ.dir/src/ZeroMQPoller.cpp.o' failed
make[2]: *** [roofit/roofitZMQ/CMakeFiles/RooFitZMQ.dir/src/ZeroMQPoller.cpp.o] Error 1
make[2]: Target 'roofit/roofitZMQ/CMakeFiles/RooFitZMQ.dir/build' not remade because of errors.
CMakeFiles/Makefile2:35161: recipe for target 'roofit/roofitZMQ/CMakeFiles/RooFitZMQ.dir/all' failed
make[1]: *** [roofit/roofitZMQ/CMakeFiles/RooFitZMQ.dir/all] Error 2
(...)

```

It seems that the problem is related to the system provided “`libzmq`”.  
The configuration step says:  
`-- ZeroMQ not found. Switching on builtin_zeromq option`  
but it also finds:  
`pkgcfg_lib_PC_LIBZMQ_zmq:FILEPATH=/usr/lib/x86_64-linux-gnu/libzmq.so`  
and then it uses the system provided `/usr/include/zmq.hpp` (from the “`libzmq3-dev 4.2.5-1ubuntu0.2`” package).

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [March 14, 2022, 8:34am UTC](https://root-forum.cern.ch/t/build-error-in-the-v6-26-00-patches-branch-fails-to-build-on-ubuntu-18-04/49149/2 "2022-03-14T08:34:13Z")

</div>

Hi Wile E., can you open a github issue for this?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 14, 2022, 8:47am UTC](https://root-forum.cern.ch/t/build-error-in-the-v6-26-00-patches-branch-fails-to-build-on-ubuntu-18-04/49149/3 "2022-03-14T08:47:15Z")

</div>

Neither me nor myself have a github account. 😉

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [March 14, 2022, 8:52am UTC](https://root-forum.cern.ch/t/build-error-in-the-v6-26-00-patches-branch-fails-to-build-on-ubuntu-18-04/49149/4 "2022-03-14T08:52:38Z")

</div>

OK, it is now [v6-26-00-patches branch fails to build on ubuntu 18.04 · Issue #10107 · root-project/root · GitHub](https://github.com/root-project/root/issues/10107)

---

<div class="post-metadata">

**Author:** ![jonas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonas/32/24756_2.png) [@jonas](https://root-forum.cern.ch/u/jonas)\
**Post date:** [March 14, 2022, 1:28pm UTC](https://root-forum.cern.ch/t/build-error-in-the-v6-26-00-patches-branch-fails-to-build-on-ubuntu-18-04/49149/5 "2022-03-14T13:28:10Z")

</div>

Thanks for reporting, I have created a PR to fix this issue:

> <https://github.com/root-project/root/pull/10111>
>
> If the ZeroMQ system version is too old, we can't use the system C++
> headers ei…ther (note that \`find\_package(ZeroMQ)\` not only checks if the
> library exists, but also if it's a recent version with zmq\_ppoll).
> 
> Therefore, we should also enable \`builtin\_cppzmq\` if no usable ZMQ
> version is found, not only \`builtin\_zeromq\`.
> 
> This closes #10107.
> 
> @egpbos, FYI

It will be integrated in the next patch release. In the meantime, you can compile ROOT with `-Dbuiltin_cppzmq=ON` to make it work (please let me know if it doesn’t).

Cheers,  
Jonas

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 28, 2022, 1:29pm UTC](https://root-forum.cern.ch/t/build-error-in-the-v6-26-00-patches-branch-fails-to-build-on-ubuntu-18-04/49149/6 "2022-03-28T13:29:01Z")

</div>

Closed on March 28, 2022, 1:29pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
