HiFiPi - TBB Woes


#1

Hey! So, I’ve been busy fiddling with my Raspberry Pis again, and after waiting 8 days compiling Qt5.8 on Raspbian, I was ready to get the domain-server and assignment-client working. However, I am running into a very strange situation that baffles my mind a bit, and am hoping someone may have some ideas in how to resolve it.

So, first, here are the instructions I followed to get HiFi working on the Raspberry Pi (leaving out compiling cmake and Qt5.8 as Cmake is straight forward and Qt5.8 is a painful experience).

High Fidelity Changes for the Pi
  1. git clone -b stable https://github.com/highfidelity/hifi.git && cd hifi
  2. nano cmake/macros/SetupHifiLibrary.cmake
    • Comment out any lines regarding AVX, as there is no support on the Pi
  3. nano cmake/externals/tbb/CMakeLists.txt
  4. nano libraries/audio/src/AudioLimiter.h
    • Add #include <stdlib.h> after #include “stdint.h”
  5. mkdir build && cd build
  6. cmake -DSERVER_ONLY=TRUE -DQT_CMAKE_PREFIX_PATH=/usr/local/qt5/lib/cmake … |& tee output_cmake
  7. We need to run two export commands (due to TBB and quazip):
    • export CXXFLAGS="-DTBB_USE_GCC_BUILTINS=1 -D__TBB_64BIT_ATOMICS=0 -std=c++11 -m32"
    • export LDFLAGS="-DTBB_USE_GCC_BUILTINS=1 -D__TBB_64BIT_ATOMICS=0 -std=c++11 -m32"
  8. make -j3 assignment-client |& tee output_assignment-client

Link to build log: http://pastebin.com/jcrc9nxN

What is worth pointing out is that it fails to link the libtbb.so.2 file it generated while building the assignment-client. Otherwise, everything else compiles just fine.

[details=Linker Error Details][100%] Linking CXX executable assignment-client
/usr/bin/ld: skipping incompatible /home/hifi/hifi/build/ext/makefiles/tbb/project/src/tbb/lib/ia32/gcc4.4/libtbb.so.2 when searching for libtbb.so.2
/usr/bin/ld: skipping incompatible /home/hifi/hifi/build/ext/makefiles/tbb/project/src/tbb/lib/ia32/gcc4.4/libtbbmalloc.so.2 when searching for libtbbmalloc.so.2
/usr/bin/ld: cannot find libtbbmalloc.so.2[/details]

In my past builds, I typically used Ubuntu 14.04 for the Pi2, but the latest build 16.04 was very buggy as updating the Pi at all would result in a failure to boot. Since I got a USB-COMM debugger, I was able to figure it out and resolve the issue, so I will be building Qt5.8 natively again (I tried cross compiling and getting QtWebkit to cooperate on 5.7.1 is not working). On that distro, I don’t have issues building Hifi at all (the biggest hurdles is always compiling Qt).

However, since the Raspbian build is SO close to working, I’m hoping something can be tweaked to get the final part working. Thankfully I ordered two Pi3s, where my current Pi server is running Ubuntu 14.04 on a Raspberry Pi 2. However, the Pi2 is running Qt5.6, which produces strange results with the assignment-clients and domain-server (they’ll work, just things may act odd).


#2

Just got QT5.8 compiled on Ubuntu 16.04 for the Raspberry Pi 3, which took only 48 hours. I’ll attempt to compile High Fidelity on that and see how well it goes.

Update #1: AND same result here! So now I’m just confused, since all past versions of the ‘Raspberry Pi’ edition do not have this problem.

Update #2: objdump seems to state the following:
architecture: UNKNOWN!, flags 0x00000150:
meanwhile, libBulletDynamics.so, which seems to work, reports the following:
architecture: arm, flags 0x00000150:
Starting to wonder if something in libtbb isn’t compiling properly. I’ll check the results on the GOOD old build and see what it reports back.

Update #3: objdump reports the same thing on the older builds. I officially have no clue.

Update #4: Gitter chat suggests building using GCC 4.x rather than using 5.4. The Raspbian build was using 4.9.4, and installing 4.9 gives me 4.9.3 on Ubuntu 16.04. We’ll see how well it goes.