CC7 build problem: error: use of undeclared identifier 'bswap_64'

Dear all,
I’m trying to build O2 within cantos:7 shipped with docker in my Max OSX, following the instructions here.
Unfortunately the compilation stops in O2.
The full log of the error can be found here:
https://cernbox.cern.ch/index.php/s/j1V62kK6JpsBXQt

Thanks in advance for any hint.
Best regards,
Diego

Hi @dstocco, I have renamed your issue as this does not concern macOS or Docker, it’s a CC7 problem.

The relevant part of your error is:

In file included from input_line_12:29:
In file included from /Users/dstocco/Documents/projects/alice/software/sw/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/common.h:40:
/Users/dstocco/Documents/projects/alice/software/sw/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:337:47: error: use of undeclared identifier 'bswap_16'
  static uint16 FromHost16(uint16 x) { return bswap_16(x); }
                                              ^
/Users/dstocco/Documents/projects/alice/software/sw/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:338:45: error: use of undeclared identifier 'bswap_16'
  static uint16 ToHost16(uint16 x) { return bswap_16(x); }
                                            ^
/Users/dstocco/Documents/projects/alice/software/sw/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:340:47: error: use of undeclared identifier 'bswap_32'
  static uint32 FromHost32(uint32 x) { return bswap_32(x); }
                                              ^
/Users/dstocco/Documents/projects/alice/software/sw/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:341:45: error: use of undeclared identifier 'bswap_32'
  static uint32 ToHost32(uint32 x) { return bswap_32(x); }
                                            ^
/Users/dstocco/Documents/projects/alice/software/sw/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:343:47: error: use of undeclared identifier 'bswap_64'
  static uint64 FromHost64(uint64 x) { return bswap_64(x); }
                                              ^
/Users/dstocco/Documents/projects/alice/software/sw/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:344:45: error: use of undeclared identifier 'bswap_64'
  static uint64 ToHost64(uint64 x) { return bswap_64(x); }
                                            ^
Error: /Users/dstocco/Documents/projects/alice/software/sw/slc7_x86-64/ROOT/v6-12-04-4/bin/rootcint: compilation failure (/Users/dstocco/Documents/projects/alice/software/sw/BUILD/10d22970a18c6d44dd18512fc0bd8fef146e8e6b/O2/CCDB/G__CCDBDict0e803a3e14_dictUmbrella.h)
CCDB/CMakeFiles/CCDB.dir/build.make:77: recipe for target 'CCDB/G__CCDBDict.cxx' failed
make[2]: *** [CCDB/G__CCDBDict.cxx] Error 1
CMakeFiles/Makefile2:1346: recipe for target 'CCDB/CMakeFiles/CCDB.dir/all' failed
make[1]: *** [CCDB/CMakeFiles/CCDB.dir/all] Error 2

Can you please send the output of:

aliDoctor O2 --defaults o2

(or whatever default you are using for building.)

Thanks,

d.

Hi @dstocco, one more remark. On my CC7 build I see O2 printing out, during the configuration (CMake) phase:

DEBUG:O2:O2:o2: -- Looking for FairMQ functionality in FairRoot ...
DEBUG:O2:O2:o2: -- Looking for FairMQ functionality in FairRoot: yes
DEBUG:O2:O2:o2: -- Found Protobuf: /home/dberzano/alice-ng/sw/slc7_x86-64/protobuf/v3.0.2-1/lib/libprotobuf.so;-lpthread (found version "3.0.0")
DEBUG:O2:O2:o2: -- Found Configuration: /home/dberzano/alice-ng/sw/slc7_x86-64/Configuration/v1.3.0-2/lib/libConfiguration.so
DEBUG:O2:O2:o2: -- Configuration found : /home/dberzano/alice-ng/sw/slc7_x86-64/Configuration/v1.3.0-2/lib/libConfiguration.so

From your log, it seems that the Protobuf line is completely missing. Now, the Protobuf package is required by O2’s CMake:

cmake/O2Dependencies.cmake:find_package(Protobuf REQUIRED)

meaning that the configuration will fail if the package is not found.

Can you try to build a pure O2 dev using alidist master and the o2 defaults? Is this what you are using? (Or, are you using instead some altered O2 with your code rebased on top and the alo defaults?)

This would help us understanding whether the problem’s in your code.

Hi Dario,
actually I tried various combinations with:
–defaults alo build alo
–defaults alo build O2
–defaults o2 build O2
I’m currently recompiling once more with the last option to be on the safe side…
Will come back to you with the full alidoctor log asap.
Thanks,
cheers,
Diego

The line In file included from input_line_12:29: tells me that this is a problem during ROOT dictionary creation – which is probably not seeing some headers.

1 Like

Hi again,
I recompiled again with:
alidiist: master
O2: dev
aliBuild -z o2-centos7 -w $ALICE_WORK_DIR --defaults o2 build O2

The issue is still there.
Here is the alidoctor output:
https://cernbox.cern.ch/index.php/s/GfVxReRPyaiJwob

Thanks,
cheers,
Diego

Hi @dstocco, for the record I have found some prerequisites problems that I have fixed (but they just concerned the pip installation of some Python packages).

On a pristine installation I am still completely unable to reproduce your issue. What comes to my mind is that this is a Docker container with the working directory shared with your macOS installation.

It is possible that there is some clash between build directories (i.e. your macOS O2 build directory is the same as your Docker CC7 one or something like that).

What’s the output of:

ls -l $ALICE_WORK_DIR

You can try as an option, to avoid clashes, to share only the MIRROR directory:

aliBuild ... -w /path/to/something/different --reference-sources $ALICE_WORK_DIR/MIRROR

That’d be in your case:

aliBuild -z o2-centos7 -w /alternative-alice-dir --reference-sources $ALICE_WORK_DIR/MIRROR --defaults o2 build O2

Side note on your command line: -w $ALICE_WORK_DIR is redundant. The environment variable ALICE_WORK_DIR (or ALIBUILD_WORK_DIR, they both work) replaces the -w switch.

Hi @dberzano,
yes, this is the case:
BUILD INSTALLROOT MIRROR MODULES SOURCES SPECS TARS osx_x86-64 slc7_x86-64
However, I thought that specifying
-z o2-centos7
would automatically get rid on any possible conflicts between the two installations. Isn’t that the case?
Anyways, I will try to fully decouple the two and let you know.
Thanks,
cheers,
Diego

It should, as this is the only way to guarantee different build directories. This is why I am a bit puzzled. Also, I do share my installation across several containers and as I said, I have never come across this issue and I cannot reproduce it at all…

One more thing, bear in mind that O2’s default branch is dev not master.

Hi @dberzano ,

Of course! And I actually use dev, as specified in a previous post:

Ciao,
Diego

Ciao @dberzano,

I tried it, but it is still does not work.
Cheers,
Diego

Hi @dberzano,
I think I found the problem.
The error came from rootcint, when trying to build the dictionary. I’ve already observed some limitations in the past in rootcint…sometimes related to the use of long string.
Indeed, the ALICE_WORK_DIR I’m using is already quite long, and, in addition, the rootcint fails when including:
$ALICE_WORK_DIR/slc7_x86-64/protobuf/v3.0.21/include/google/protobuf/stubs/common.h
Which again is particularly long.
So, I recompiled with:
aliBuild -z -w $HOME/alice --reference-sources $ALISOFT/sw/MIRROR --defaults o2 build O2
notice that I chose $HOME/alice as a working directory…and it compiles.

Maybe one can add a warning about long paths in the doc.

Thanks!
Ciao,
Diego

Hi @dstocco, wow - this is puzzling. There was indeed a limitation in the remote past, but it’s solved since 9 years, and we are using ROOT 6 here.

We’d better report a bug to the ROOT team instead. Basically you’re telling me that the following path is too long for rootcint:

/Users/dstocco/Documents/projects/alice/software/sw/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h

This path is 118 chars long. On my computer:

/home/dberzano/alice-ng/sw/ubuntu1604_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h

which is even longer, and it works (but I am in no container and no Mac as you can see). In case you still have your faulty installation around, can I kindly ask you to modify O2’s CMakeLists.txt and add, below the project() statement, the following line:

set(CMAKE_VERBOSE_MAKEFILE ON)

and then recompile normally? This spits out every single underlying command ran by CMake during the build process, so that we can see exactly what’s passed to rootcint that makes it unhappy.

For the moment, I am marking your answer as the solution but I am not closing the topic. No worries if you can’t reproduce it :slight_smile:

Ciao @dberzano,
actually, your path is not longer, being 99 chars instead of 118…but I do agree that there must be something related with rootcint+docker going on.
I re-run the buggy compilation with verbosity on (and with option -j1 to have a “linear” output). You can find the result here:
https://cernbox.cern.ch/index.php/s/1YAgP7fE5blK0Bg
Thanks,
ciao,
Diego

Haha too much time spent on computers, I forgot how to count :slight_smile:

So, from your log and for reference, the failing command line is:

cd /Users/dstocco/Documents/projects/alice/software/sw_centos7/BUILD/1d95dd1ca1a2427cefbb6ce6ea0c35adc5a766e4/O2/CCDB && \
  LD_LIBRARY_PATH=/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/ROOT/v6-12-04-1/lib::/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/googlebenchmark/1.3.0-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/ms_gsl/1-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/Monitoring/v1.6.0-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/Configuration/v1.4.1-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/RapidJSON/v1.1.0-alice1-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/O2HLTCATracking/hlt_o2_ca_tracking-v1.7-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/HepMC3/v3.0.0+git_d43693ce0e-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/Vc/1.3.3-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/FairRoot/alice-dev-20180413-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/googletest/1.8.0-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/DDS/2.0-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/nanomsg/v1.0.0+git_c52f1bedca-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/ZeroMQ/v4.1.5-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/ROOT/v6-12-04-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/GSL/v1.16-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/arrow/v0.9.0-alice1-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/flatbuffers/v1.8.0-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/CMake/v3.11.0-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/boost/v1.66.0-1/lib:/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/defaults-release/v1-1/lib:/opt/rh/devtoolset-6/root/usr/lib64:/opt/rh/devtoolset-6/root/usr/lib ROOTSYS=/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/ROOT/v6-12-04-1 \
  /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/ROOT/v6-12-04-1/bin/rootcint \
  -f \
  /Users/dstocco/Documents/projects/alice/software/sw_centos7/BUILD/1d95dd1ca1a2427cefbb6ce6ea0c35adc5a766e4/O2/CCDB/G__CCDBDict.cxx \
  -inlineInputHeader \
  -rmf \
  /Users/dstocco/Documents/projects/alice/software/sw_centos7/BUILD/1d95dd1ca1a2427cefbb6ce6ea0c35adc5a766e4/O2/lib/libCCDB.rootmap \
  -rml \
  CCDB.so \
  -c \
  -I/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/FairRoot/alice-dev-20180413-1/include \
  -I/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/FairRoot/alice-dev-20180413-1/include/fairmq \
  -I/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/ROOT/v6-12-04-1/include \
  -I/Users/dstocco/Documents/projects/alice/software/sw_centos7/SOURCES/O2/o2-master/0/CCDB \
  -I/Users/dstocco/Documents/projects/alice/software/sw_centos7/SOURCES/O2/o2-master/0/CCDB/include \
  -I/Users/dstocco/Documents/projects/alice/software/sw_centos7/SOURCES/O2/o2-master/0/CCDB/src \
  -I/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/boost/v1.66.0-1/include \
  -I/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/include \
  include/CCDB/Backend.h \
  include/CCDB/BackendOCDB.h \
  include/CCDB/BackendRiak.h \
  include/CCDB/Condition.h \
  include/CCDB/ConditionId.h \
  include/CCDB/ConditionMetaData.h \
  include/CCDB/FileStorage.h \
  include/CCDB/GridStorage.h \
  include/CCDB/IdPath.h \
  include/CCDB/IdRunRange.h \
  include/CCDB/LocalStorage.h \
  include/CCDB/Manager.h \
  include/CCDB/ObjectHandler.h \
  include/CCDB/Storage.h \
  include/CCDB/XmlHandler.h \
  test/TestClass.h \
  /Users/dstocco/Documents/projects/alice/software/sw_centos7/SOURCES/O2/o2-master/0/CCDB/src/CCDBLinkDef.h

I can see from it that:

  • /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/lib is in the LD_LIBRARY_PATH
  • -I/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/include include/CCDB/Backend.h is one of the rootcint options

Those pieces of information might be useful for future reference to the ROOT team. Thanks!

I have one more question for you. Can you try to run the above command manually?

You will need to run it in a ROOT-enabled environment, so enter FairRoot first:

alienv enter FairRoot/latest

then the command already contains a cd to the appropriate directory. Thanks…

Ciao @dberzano,
the command as it is fails due to a space between second and third line, that breaks the command:
/Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/ROOT/v6-12-04-1/bin/rootcint

Anyways, once I fixed this, I could run the command…but I still get the same error:
In file included from input_line_12:29: In file included from /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/common.h:40: /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:337:47: error: use of undeclared identifier 'bswap_16' static uint16 FromHost16(uint16 x) { return bswap_16(x); } ^ /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:338:45: error: use of undeclared identifier 'bswap_16' static uint16 ToHost16(uint16 x) { return bswap_16(x); } ^ /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:340:47: error: use of undeclared identifier 'bswap_32' static uint32 FromHost32(uint32 x) { return bswap_32(x); } ^ /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:341:45: error: use of undeclared identifier 'bswap_32' static uint32 ToHost32(uint32 x) { return bswap_32(x); } ^ /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:343:47: error: use of undeclared identifier 'bswap_64' static uint64 FromHost64(uint64 x) { return bswap_64(x); } ^ /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64/protobuf/v3.0.2-1/include/google/protobuf/stubs/port.h:344:45: error: use of undeclared identifier 'bswap_64' static uint64 ToHost64(uint64 x) { return bswap_64(x); } ^ Error: /Users/dstocco/Documents/projects/alice/software/sw_centos7/slc7_x86-64//ROOT/v6-12-04-1/bin/rootcint: compilation failure (/Users/dstocco/Documents/projects/alice/software/sw_centos7/BUILD/1d95dd1ca1a2427cefbb6ce6ea0c35adc5a766e4/O2/CCDB/G__CCDBDict85b045e625_dictUmbrella.h)

Ciao,
Diego
P.S. Happy labour day… :wink:

I have edited my post and fixed the command. Thanks for confirming that this still causes the error, my aim was to have a reproducer for the ROOT team!

p.s. happy Labour Day to you too :wink: