---
# System prepended metadata

title: Build `zio`
tags: [DAQ, DUNE, artdaq, Software Management, protoDUNE]

---

# Build `zio`

###### tags: `DAQ` `protoDUNE` `artdaq` `DUNE` `Software Management`

## Build zyre UPS product

The UPS tarball is [here v2.0.0.](https://home.fnal.gov/~dingpf/zyre-2.0.0-sl7-x86_64-e17.tar.bz2)
It depends on the following UPS products:
* [ZMQ v4.3.2](https://home.fnal.gov/~dingpf/zmq-4.3.2-sl7-x86_64-e17.tar.bz2) 
* [CZMQ v4.2.0](https://home.fnal.gov/~dingpf/czmq-4.2.0-sl7-x86_64-e17.tar.bz2).


Notes for building the UPS product:
* [repo](https://github.com/zeromq/zyre)
* [Source tarball](https://github.com/zeromq/zyre/releases/download/v2.0.0/zyre-2.0.0.tar.gz)
* Similar as building `czmq`;
* Add `czmq` and `zmq`'s `lib/pkgconfig` to `PKG_CONFIG_PATH`.
* Run `configure` followed by `make`;

## Install spdlog

* [repo](https://github.com/gabime/spdlog)
* This is installed locally;
* Though there's `spdlog-devel` RPM package available, but that package does not come with its pkgconfig file;
* So we are installing it manually as below:
```
git clone https://github.com/gabime/spdlog.git
cd spdlog && mkdir build && cd build
cmake .. && make -j
sudo make install
# note: spdlog's pkgconfig by default will be installed to /usr/local/lib/pkgconfig/spdlog.pc
```

## Building zio

* [repo](https://github.com/brettviren/zio)

```
setup zyre v2_0_0 -q e17
export PKG_CONFIG_PATH=${ZMQ_LIB}/pkgconfig:${CZMQ_LIB}/pkgconfig:${ZYRE_LIB}/pkgconfig:/usr/local/lib/pkgconfig
git clone https://github.com/brettviren/zio.git
cd zio
./waf configure --prefix=/prefix_to_install
./waf install
```

The configuration was successful. However, the installation (compliation) went into errors like:
```
[root@e143c1e7038b zio]# export PKG_CONFIG_PATH=${ZMQ_LIB}/pkgconfig:${CZMQ_LIB}/pkgconfig:${ZYRE_LIB}/pkgconfig:/usr/local/lib/pkgconfig
[root@e143c1e7038b zio]# ./waf configure --prefix=/products/zio/v0_0_0/source/install
Setting top to                           : /products/zio/v0_0_0/source/zio
Setting out to                           : /products/zio/v0_0_0/source/zio/build
Checking for 'g++' (C++ compiler)        : /cvmfs/larsoft.opensciencegrid.org/products/gcc/v7_3_0/Linux64bit+3.10-2.17/bin/g++
Checking for program 'pkg-config'        : /usr/bin/pkg-config
Checking for 'libzmq'                    : yes
Checking for 'libczmq'                   : yes
Checking for 'libzyre'                   : yes
Checking for 'spdlog'                    : yes
Checking for library ['pthread']         : yes
'configure' finished successfully (0.217s)
[root@e143c1e7038b zio]# ./waf install
Waf: Entering directory `/products/zio/v0_0_0/source/zio/build'
[ 1/82] Compiling src/node.cpp
[ 2/82] Compiling src/domo_worker.cpp
[ 3/82] Compiling src/domo_broker.cpp
[ 4/82] Compiling src/message.cpp
[ 5/82] Compiling src/util.cpp
[ 6/82] Compiling src/main.cpp
[ 7/82] Compiling src/domo_client.cpp
[ 8/82] Compiling src/tens.cpp
../src/domo_client.cpp: In constructor ‘zio::domo::Client::Client(zmq::socket_t&, std::__cxx11::string)’:
../src/domo_client.cpp:12:9: error: ‘ZMQ_CLIENT’ was not declared in this scope
     if (ZMQ_CLIENT == stype) {
         ^~~~~~~~~~
../src/domo_client.cpp:12:9: note: suggested alternative: ‘ZMQ_EVENTS’
     if (ZMQ_CLIENT == stype) {
         ^~~~~~~~~~
         ZMQ_EVENTS
../src/domo_client.cpp: In member function ‘void zio::domo::Client::recv(zmq::multipart_t&)’:
../src/domo_client.cpp:56:10: error: ‘poller_t’ is not a member of ‘zio’
     zio::poller_t<> poller;
          ^~~~~~~~
../src/domo_client.cpp:56:19: error: expected primary-expression before ‘>’ token
     zio::poller_t<> poller;
                   ^
../src/domo_client.cpp:56:21: error: ‘poller’ was not declared in this scope
     zio::poller_t<> poller;
                     ^~~~~~
../src/domo_client.cpp:56:21: note: suggested alternative: ‘popen’
     zio::poller_t<> poller;
                     ^~~~~~
                     popen
../src/domo_client.cpp:57:29: error: ‘zio::event_flags’ has not been declared
     poller.add(m_sock, zio::event_flags::pollin);
                             ^~~~~~~~~~~
../src/domo_client.cpp:59:23: error: ‘poller_event’ is not a member of ‘zio’
     std::vector< zio::poller_event<> > events(1);
                       ^~~~~~~~~~~~
../src/domo_client.cpp:59:36: error: template argument 1 is invalid
     std::vector< zio::poller_event<> > events(1);
                                    ^
../src/domo_client.cpp:59:36: error: template argument 2 is invalid
../src/domo_client.cpp:59:38: error: expected unqualified-id before ‘>’ token
     std::vector< zio::poller_event<> > events(1);
                                      ^
../src/domo_client.cpp:60:30: error: ‘events’ was not declared in this scope
     int rc = poller.wait_all(events, m_timeout);
                              ^~~~~~
../src/domo_client.cpp:60:30: note: suggested alternative: ‘fgets’
     int rc = poller.wait_all(events, m_timeout);
                              ^~~~~~
                              fgets

../src/util.cpp: In function ‘bool zio::is_serverish(zmq::socket_t&)’:
../src/util.cpp:95:12: error: ‘ZMQ_SERVER’ was not declared in this scope
     return ZMQ_SERVER == stype or ZMQ_ROUTER == stype;
            ^~~~~~~~~~
../src/util.cpp:95:12: note: suggested alternative: ‘ZMQ_DEALER’
     return ZMQ_SERVER == stype or ZMQ_ROUTER == stype;
            ^~~~~~~~~~
            ZMQ_DEALER
../src/util.cpp: In function ‘bool zio::is_clientish(zmq::socket_t&)’:
../src/util.cpp:100:12: error: ‘ZMQ_CLIENT’ was not declared in this scope
     return ZMQ_CLIENT == stype or ZMQ_DEALER == stype;
            ^~~~~~~~~~
../src/util.cpp:100:12: note: suggested alternative: ‘ZMQ_EVENTS’
     return ZMQ_CLIENT == stype or ZMQ_DEALER == stype;
            ^~~~~~~~~~
            ZMQ_EVENTS
../src/util.cpp: In function ‘zio::remote_identity_t zio::recv_serverish(zmq::socket_t&, zmq::multipart_t&)’:
../src/util.cpp:107:9: error: ‘ZMQ_SERVER’ was not declared in this scope
     if (ZMQ_SERVER == stype) {
         ^~~~~~~~~~
../src/util.cpp:107:9: note: suggested alternative: ‘ZMQ_DEALER’
     if (ZMQ_SERVER == stype) {
         ^~~~~~~~~~
         ZMQ_DEALER
../src/util.cpp: In function ‘zio::remote_identity_t zio::recv_server(zmq::socket_t&, zmq::multipart_t&)’:
../src/util.cpp:122:44: error: ‘class zmq::message_t’ has no member named ‘routing_id’
     remote_identity_t remid = to_remid(msg.routing_id());
                                            ^~~~~~~~~~
../src/util.cpp:123:54: error: ‘class zmq::message_t’ has no member named ‘routing_id’
     zio::debug("recv_server: rid={} remid='{}'", msg.routing_id(), zio::binstr(remid));
                                                      ^~~~~~~~~~
../src/util.cpp: In function ‘void zio::send_serverish(zmq::socket_t&, zmq::multipart_t&, const remote_identity_t&)’:
../src/util.cpp:144:9: error: ‘ZMQ_SERVER’ was not declared in this scope
     if (ZMQ_SERVER == stype) {
         ^~~~~~~~~~
../src/util.cpp:144:9: note: suggested alternative: ‘ZMQ_DEALER’
     if (ZMQ_SERVER == stype) {
         ^~~~~~~~~~
         ZMQ_DEALER
../src/util.cpp: In function ‘void zio::send_server(zmq::socket_t&, zmq::multipart_t&, const remote_identity_t&)’:
../src/util.cpp:163:9: error: ‘class zmq::message_t’ has no member named ‘set_routing_id’
     msg.set_routing_id(to_rid(remid));
         ^~~~~~~~~~~~~~
../src/util.cpp: In function ‘void zio::recv_clientish(zmq::socket_t&, zmq::multipart_t&)’:
../src/util.cpp:181:9: error: ‘ZMQ_CLIENT’ was not declared in this scope
     if (ZMQ_CLIENT == stype) {
         ^~~~~~~~~~
../src/util.cpp:181:9: note: suggested alternative: ‘ZMQ_EVENTS’
     if (ZMQ_CLIENT == stype) {
         ^~~~~~~~~~
         ZMQ_EVENTS
../src/util.cpp: In function ‘void zio::send_clientish(zmq::socket_t&, zmq::multipart_t&)’:
../src/util.cpp:216:9: error: ‘ZMQ_CLIENT’ was not declared in this scope
     if (ZMQ_CLIENT == stype) {
         ^~~~~~~~~~
../src/util.cpp:216:9: note: suggested alternative: ‘ZMQ_EVENTS’
     if (ZMQ_CLIENT == stype) {
         ^~~~~~~~~~
         ZMQ_EVENTS

../src/domo_worker.cpp: In constructor ‘zio::domo::Worker::Worker(zmq::socket_t&, std::__cxx11::string, std::__cxx11::string)’:
../src/domo_worker.cpp:16:9: error: ‘ZMQ_CLIENT’ was not declared in this scope
     if (ZMQ_CLIENT == stype) {
         ^~~~~~~~~~
../src/domo_worker.cpp:16:9: note: suggested alternative: ‘ZMQ_EVENTS’
     if (ZMQ_CLIENT == stype) {
         ^~~~~~~~~~
         ZMQ_EVENTS
../src/domo_worker.cpp: In member function ‘void zio::domo::Worker::recv(zmq::multipart_t&)’:
../src/domo_worker.cpp:74:10: error: ‘poller_t’ is not a member of ‘zio’
     zio::poller_t<> poller;
          ^~~~~~~~
../src/domo_worker.cpp:74:19: error: expected primary-expression before ‘>’ token
     zio::poller_t<> poller;
                   ^
../src/domo_worker.cpp:74:21: error: ‘poller’ was not declared in this scope
     zio::poller_t<> poller;
                     ^~~~~~
../src/domo_worker.cpp:74:21: note: suggested alternative: ‘Worker’
     zio::poller_t<> poller;
                     ^~~~~~
                     Worker
../src/domo_worker.cpp:75:29: error: ‘zio::event_flags’ has not been declared
     poller.add(m_sock, zio::event_flags::pollin);
                             ^~~~~~~~~~~
../src/domo_worker.cpp:77:23: error: ‘poller_event’ is not a member of ‘zio’
     std::vector< zio::poller_event<> > events(1);
                       ^~~~~~~~~~~~
../src/domo_worker.cpp:77:36: error: template argument 1 is invalid
     std::vector< zio::poller_event<> > events(1);
                                    ^
../src/domo_worker.cpp:77:36: error: template argument 2 is invalid
../src/domo_worker.cpp:77:38: error: expected unqualified-id before ‘>’ token
     std::vector< zio::poller_event<> > events(1);
                                      ^
../src/domo_worker.cpp:78:30: error: ‘events’ was not declared in this scope
     int rc = poller.wait_all(events, m_heartbeat);
                              ^~~~~~
../src/domo_worker.cpp:78:30: note: suggested alternative: ‘fgets’
     int rc = poller.wait_all(events, m_heartbeat);
                              ^~~~~~
                              fgets
../src/domo_worker.cpp: In function ‘void zio::domo::echo_worker(zmq::socket_t&, std::__cxx11::string, int)’:
../src/domo_worker.cpp:149:10: error: ‘poller_t’ is not a member of ‘zio’
     zio::poller_t<> poller;
          ^~~~~~~~
../src/domo_worker.cpp:149:19: error: expected primary-expression before ‘>’ token
     zio::poller_t<> poller;
                   ^
../src/domo_worker.cpp:149:21: error: ‘poller’ was not declared in this scope
     zio::poller_t<> poller;
                     ^~~~~~
../src/domo_worker.cpp:149:21: note: suggested alternative: ‘worker’
     zio::poller_t<> poller;
                     ^~~~~~
                     worker
../src/domo_worker.cpp:150:27: error: ‘zio::event_flags’ has not been declared
     poller.add(link, zio::event_flags::pollin);
                           ^~~~~~~~~~~
../src/domo_worker.cpp:151:27: error: ‘zio::event_flags’ has not been declared
     poller.add(sock, zio::event_flags::pollin);
                           ^~~~~~~~~~~
../src/domo_worker.cpp:165:27: error: ‘poller_event’ is not a member of ‘zio’
         std::vector< zio::poller_event<> > events(2);
                           ^~~~~~~~~~~~
../src/domo_worker.cpp:165:40: error: template argument 1 is invalid
         std::vector< zio::poller_event<> > events(2);
                                        ^
../src/domo_worker.cpp:165:40: error: template argument 2 is invalid
../src/domo_worker.cpp:165:42: error: expected unqualified-id before ‘>’ token
         std::vector< zio::poller_event<> > events(2);
                                          ^
../src/domo_worker.cpp:166:39: error: ‘events’ was not declared in this scope
         int nevents = poller.wait_all(events, poll_resolution);
                                       ^~~~~~
../src/domo_worker.cpp:166:39: note: suggested alternative: ‘nevents’
         int nevents = poller.wait_all(events, poll_resolution);
                                       ^~~~~~
                                       nevents

../src/message.cpp: In member function ‘zmq::message_t zio::Message::encode() const’:
../src/message.cpp:125:15: error: ‘class zmq::message_t’ has no member named ‘set_routing_id’
         spmsg.set_routing_id(rid);
               ^~~~~~~~~~~~~~
../src/message.cpp: In member function ‘void zio::Message::decode(const zmq::message_t&)’:
../src/message.cpp:133:29: error: ‘const class zmq::message_t’ has no member named ‘routing_id’
     m_remid = to_remid(data.routing_id());
                             ^~~~~~~~~~

../src/domo_broker.cpp: In constructor ‘zio::domo::Broker::Broker(zmq::socket_t&)’:
../src/domo_broker.cpp:22:9: error: ‘ZMQ_SERVER’ was not declared in this scope
     if (ZMQ_SERVER == stype) {
         ^~~~~~~~~~
../src/domo_broker.cpp:22:9: note: suggested alternative: ‘ZMQ_DEALER’
     if (ZMQ_SERVER == stype) {
         ^~~~~~~~~~
         ZMQ_DEALER
../src/domo_broker.cpp: In member function ‘void zio::domo::Broker::start()’:
../src/domo_broker.cpp:90:10: error: ‘poller_t’ is not a member of ‘zio’
     zio::poller_t<> poller;
          ^~~~~~~~
../src/domo_broker.cpp:90:19: error: expected primary-expression before ‘>’ token
     zio::poller_t<> poller;
                   ^
../src/domo_broker.cpp:90:21: error: ‘poller’ was not declared in this scope
     zio::poller_t<> poller;
                     ^~~~~~
../src/domo_broker.cpp:90:21: note: suggested alternative: ‘Worker’
     zio::poller_t<> poller;
                     ^~~~~~
                     Worker
../src/domo_broker.cpp:91:29: error: ‘zio::event_flags’ has not been declared
     poller.add(m_sock, zio::event_flags::pollin);
                             ^~~~~~~~~~~
../src/domo_broker.cpp:98:27: error: ‘poller_event’ is not a member of ‘zio’
         std::vector< zio::poller_event<> > events(1);
                           ^~~~~~~~~~~~
../src/domo_broker.cpp:98:40: error: template argument 1 is invalid
         std::vector< zio::poller_event<> > events(1);
                                        ^
../src/domo_broker.cpp:98:40: error: template argument 2 is invalid
../src/domo_broker.cpp:98:42: error: expected unqualified-id before ‘>’ token
         std::vector< zio::poller_event<> > events(1);
                                          ^
../src/domo_broker.cpp:99:34: error: ‘events’ was not declared in this scope
         int rc = poller.wait_all(events, timeout);
                                  ^~~~~~
../src/domo_broker.cpp:99:34: note: suggested alternative: ‘fgets’
         int rc = poller.wait_all(events, timeout);
                                  ^~~~~~
                                  fgets
../src/domo_broker.cpp: In function ‘void zio::domo::broker_actor(zmq::socket_t&, std::__cxx11::string, int)’:
../src/domo_broker.cpp:321:10: error: ‘poller_t’ is not a member of ‘zio’
     zio::poller_t<> poller;
          ^~~~~~~~
../src/domo_broker.cpp:321:19: error: expected primary-expression before ‘>’ token
     zio::poller_t<> poller;
                   ^
../src/domo_broker.cpp:321:21: error: ‘poller’ was not declared in this scope
     zio::poller_t<> poller;
                     ^~~~~~
../src/domo_broker.cpp:321:21: note: suggested alternative: ‘popen’
     zio::poller_t<> poller;
                     ^~~~~~
                     popen
../src/domo_broker.cpp:322:27: error: ‘zio::event_flags’ has not been declared
     poller.add(link, zio::event_flags::pollin);
                           ^~~~~~~~~~~
../src/domo_broker.cpp:323:27: error: ‘zio::event_flags’ has not been declared
     poller.add(sock, zio::event_flags::pollin);
                           ^~~~~~~~~~~
../src/domo_broker.cpp:332:27: error: ‘poller_event’ is not a member of ‘zio’
         std::vector< zio::poller_event<> > events(2);
                           ^~~~~~~~~~~~
../src/domo_broker.cpp:332:40: error: template argument 1 is invalid
         std::vector< zio::poller_event<> > events(2);
                                        ^
../src/domo_broker.cpp:332:40: error: template argument 2 is invalid
../src/domo_broker.cpp:332:42: error: expected unqualified-id before ‘>’ token
         std::vector< zio::poller_event<> > events(2);
                                          ^
../src/domo_broker.cpp:333:39: error: ‘events’ was not declared in this scope
         int nevents = poller.wait_all(events, timeout);
                                       ^~~~~~
../src/domo_broker.cpp:333:39: note: suggested alternative: ‘nevents’
         int nevents = poller.wait_all(events, timeout);
                                       ^~~~~~
                                       nevents

Waf: Leaving directory `/products/zio/v0_0_0/source/zio/build'
Build failed
 -> task in 'zio' failed with exit status 1 (run with -v to display more information)
 -> task in 'zio' failed with exit status 1 (run with -v to display more information)
 -> task in 'zio' failed with exit status 1 (run with -v to display more information)
 -> task in 'zio' failed with exit status 1 (run with -v to display more information)
 -> task in 'zio' failed with exit status 1 (run with -v to display more information)
[
```