Been getting compile errors on Linux for the past week


#1

Tracked down some new dependencies:

  • libaudio-dev
  • libdisplaymigration-dev

then a following compile fail seemed to get fixed by running the compile a second time.

I am using make -j7 all (multicore compile) so it might be an improperly-defined compile dependency causing the compile threads to trip over each other?

Now stuck at vhacd compile:

[ 98%] Linking CXX executable vhacd-util
/usr/bin/ld: ../../ext/makefiles/vhacd/project/lib/libVHACD.a(VHACD.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../ext/makefiles/vhacd/project/lib/libVHACD.a(btAlignedAllocator.cpp.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../ext/makefiles/vhacd/project/lib/libVHACD.a(btConvexHullComputer.cpp.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../ext/makefiles/vhacd/project/lib/libVHACD.a(vhacdICHull.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../ext/makefiles/vhacd/project/lib/libVHACD.a(vhacdManifoldMesh.cpp.o): relocation R_X86_64_32 against symbol `_ZTVN5VHACD6TMMeshE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../ext/makefiles/vhacd/project/lib/libVHACD.a(vhacdMesh.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../ext/makefiles/vhacd/project/lib/libVHACD.a(vhacdVolume.cpp.o): relocation R_X86_64_32 against symbol `_ZTVN5VHACD8VoxelSetE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
tools/vhacd-util/CMakeFiles/vhacd-util.dir/build.make:196: recipe for target 'tools/vhacd-util/vhacd-util' failed
make[2]: *** [tools/vhacd-util/vhacd-util] Error 1
CMakeFiles/Makefile2:8136: recipe for target 'tools/vhacd-util/CMakeFiles/vhacd-util.dir/all' failed
make[1]: *** [tools/vhacd-util/CMakeFiles/vhacd-util.dir/all] Error 2
Makefile:105: recipe for target 'all' failed
make: *** [all] Error 2

That was also on a second run-through the compile with just make all and no fancy stuff. gcc (Debian 6.2.0-10) 6.2.0 20161027, tracking Debian/Testing for lib versions, except qt which is 5.7 strait from qt.io

Just did a make clean and am trying a single-core make all.

Nope, still failing with above errors. :frowning:

Also, wading through page after page of
warning: ‘-pedantic’ is not an option that controls warnings [-Wpragmas]
is a real pain!


#2

Unfortunately, HiFi is going to need some patching to compile with GCC 6.x – I had started looking for where cmake is adding -pedantic flag to compiler options, but, haven’t had the time needed to deal with it. Does your distribution have option to go back to GCC 5.x? I know some Ubuntu releases would allow you to select GCC 4.x or GCC 5.x when 5.x was new and causing problems.


#3

It sounds like you’re on some cutting edge packages. The hifi codebase currently builds with Qt-5.6. Dunno what happens when you try Qt-5.7. Perhaps you haven’t even reached the Qt build errors yet.

Are you trying to build with GCC-6.x? I’m using GCC-5.4.0 on an Ubuntu spinoff distro and that appears to work.

The V-HACD source code is downloaded from a hard coded link inside a file: …/your-hifi-sandbox/cmake/externals/vhacd/CMakeLists.txt. The link is:

http://hifi-public.s3.amazonaws.com/dependencies/v-hacd-master.zip

You could download that file, unzip it into your /tmp directory and try building it like so:

unzip -d /tmp v-hacd-master.zip
cd /tmp/v-hacd-master
mkdir build
cd build
cmake ../
make

Do you get the same compile errors when manually building V-HACD? If not, the problem could a config bug in the highfidelity cmake files, otherwise perhaps the V-HACD codebase needs a patch (or hifi needs to update its version of V-HACD).

Dunno how the -pedantic option for g++ would get into your build. Is there perhaps some CFLAGS or CXXFLAGS env variable defined on your environment?

You can build verbose and see the full commands during the build like so:

make VERBOSE=1


#4

So far, QT5.7 seems to work fine, I tried it with Interface and Stack just to see if it “blew up” and all seemed to work well - but, for my builds I use QT5.6.1-1.

The problem here is passing -pedantic flag to GCC 6.x which leads to make fails for everything in HF codebase, and, yes it’s a compile flag being generated during the cmake step, but, whether that’s a problem with cmake + GCC6.x or Hifi’s cmake config files remains an open question.

What I saw trying to compile with GCC6.x is way way up the chain you see errors compiling but make keeps plugging away (due to -j>1) leading to often missing where it really failed. I’m still on GCC 5.x but had tried getting a HF build on some other distros where I ran into GCC6.x and the glorious future that awaits us.


#5

Using the HiFi v-hacd already. Even tried deleting it and forcing a re-load from HiFi :frowning:

I will try backing down to GCC5, though I was compiling successfully on 6 a week ago, also no problems with QT5.7 a week ago, but will try a downgrade.


#6

Most interesting. I blew away my source folder and started with a fresh git-clone and all is good again :smile: No need to downgrade from GCC-6 or anything!