Build simple CRU test program against ReadoutCard libraries


I’m trying to put together some instructions for detector teams which are starting testing their electronics.
The “User story” is something like:

I have my CC7 freshly installed FLP with a CRU inside and I connect my electronics to it. I want to write my own test suite to run a bunch of tests and I want to use the ReadoutCard library.

I took the following snippet from Pascal presented here as an example:

// 1. We include the library
#include <ReadoutCard/ChannelFactory.h>

void foo() {
  using namespace AliceO2::roc;
  std::shared_ptr<BarInterface> bar0;

  // 2. To open a BAR, we can use the card's PCI address or
  // serial number. Here we open BAR number 0
  bar0 = ChannelFactory().getBar(PciAddress("42:0.0"), 0);
  bar0 = ChannelFactory().getBar(12345, 0);
  bar0 = ChannelFactory().getBar(-1, 0);

  // 3. Read register at index 0

  // 4. Write 123 to register at index 0
  bar0->writeRegister(0, 123);
  // 5. No doc strings in C++, refer to Doxygen

I’ve installed the alisw-ReadoutCard+v0.8.8-2.x86_64 RPM and loaded the package environment aliswmod enter ReadoutCard/v0.8.8-2.

But I get the following error:

    In file included from /opt/alisw/el7/GCC-Toolchain/v6.2.0-alice1-4/include/c++/6.2.0/x86_64-unknown-linux-gnu/bits/c++config.h:495:0,
             from /opt/alisw/el7/GCC-Toolchain/v6.2.0-alice1-4/include/c++/6.2.0/bits/stl_algobase.h:59,
             from /opt/alisw/el7/GCC-Toolchain/v6.2.0-alice1-4/include/c++/6.2.0/bits/stl_tree.h:63,
             from /opt/alisw/el7/GCC-Toolchain/v6.2.0-alice1-4/include/c++/6.2.0/map:60,
             from /opt/alisw/el7/ReadoutCard/v0.8.8-2/include/ReadoutCard/Parameters.h:9,
             from /opt/alisw/el7/ReadoutCard/v0.8.8-2/include/ReadoutCard/ChannelFactory.h:10,
             from roc-my-test.cxx:1:
    /opt/alisw/el7/GCC-Toolchain/v6.2.0-alice1-4/include/c++/6.2.0/x86_64-unknown-linux-gnu/bits/os_defines.h:39:22: fatal error: features.h: No such file or directory
    #include <features.h>

Is there a way of doing this without going via aliBuild ?


I suspect you are missing build-essential rpm or something similar? features.h is system stuff, IIRC.

features.h is in glibc-headers package that is an dependency of glibc-devel package.
Thus, installing glibc-devel will fix the error. There may be some other missing -devel packages, though.

We, indeed, do not ship our own glibc along with our compiler, so @maogino’s solution will probably work. Could you let us know?

On a side note, we might think of shipping it in the future, but we have to think it through.

I have an item in my wp3 presentation about it. Maybe we can discuss it tomorrow ?

1 Like

This was discussed at today’s WP3, a solution will be provided.

Thanks, I was able to find a set of instructions that work.
Once the instructions for detector teams are finalized, I’ll post the link here for reference.

And here’s the link:

1 Like