[Paraview-SuperBuild] Ubuntu 18.04 failed when using Qt5 as backend

System: Ubuntu 18.04, gcc 7.3.0.

Command: cmake -DCMAKE_INSTALL_PREFIX=/home/qth20/.local/paraview -DENABLE_paraview=True -DENABLE_qt5=True -DENABLE_ffmpeg=True -DENABLE_tbb=True -DENABLE_ospray=True ../paraview-superbuild

Error:

[ 64%] Performing build step for 'qt5'
/usr/bin/x86_64-linux-gnu-ld.gold: error: .obj/qmutex_linux.o: multiple definition of 'QBasicMutex::lockInternal()'
/usr/bin/x86_64-linux-gnu-ld.gold: .obj/qmutex.o: previous definition here
/usr/bin/x86_64-linux-gnu-ld.gold: error: .obj/qmutex_linux.o: multiple definition of 'QBasicMutex::lockInternal(int)'
/usr/bin/x86_64-linux-gnu-ld.gold: .obj/qmutex.o: previous definition here
/usr/bin/x86_64-linux-gnu-ld.gold: error: .obj/qmutex_linux.o: multiple definition of 'QBasicMutex::unlockInternal()'
/usr/bin/x86_64-linux-gnu-ld.gold: .obj/qmutex.o: previous definition here
collect2: error: ld returned 1 exit status
Makefile:1215: recipe for target '../../lib/libQt5Core.so.5.8.0' failed
make[6]: *** [../../lib/libQt5Core.so.5.8.0] Error 1
Makefile:163: recipe for target 'sub-corelib-make_first' failed
make[5]: *** [sub-corelib-make_first] Error 2
Makefile:46: recipe for target 'sub-src-make_first' failed
make[4]: *** [sub-src-make_first] Error 2
Makefile:66: recipe for target 'module-qtbase-make_first' failed
make[3]: *** [module-qtbase-make_first] Error 2
CMake Error at /home/qth20/Downloads/build-paraview/superbuild/sb-qt5-build.cmake:47 (message):
  Failed with exit code 2


superbuild/CMakeFiles/qt5.dir/build.make:123: recipe for target 'superbuild/qt5/stamp/qt5-build' failed
make[2]: *** [superbuild/qt5/stamp/qt5-build] Error 1
CMakeFiles/Makefile2:1266: recipe for target 'superbuild/CMakeFiles/qt5.dir/all' failed
make[1]: *** [superbuild/CMakeFiles/qt5.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Does it mean I should build Qt5 separately instead?

You could, but on linux it is supported and works perfectly in our buildbot.
Are you using master are the source of a specific release ?

This is built using paraview as source, yes.

Ok, , so you build the tip of the master branch ?

Yes, changing it to 5.5.2 won’t solve it, though.

To be accurate, we run the standalone-qt project which uses the same superbuild code to build and install qt5 on the machine and then we build against that version of Qt to save time. (Not rebuilding Qt cuts build time roughly in half). Also our buildbot is CentOS 6 with newer compilers, so it may be an Ubuntu problem.

Have you tried changing the qt5_SOURCE_SELECTION cmake variable? Unless you need Qt 5.8 for some reason, you could try building with 5.9 or 5.10. Ubuntu 18.04 is very new and you may have better luck with a newer Qt version.

Switching to 5.10 doesn’t help either…


[ 90%] Performing build step for 'qt5'
make[3]: warning: -jN forced in submake: disabling jobserver mode.
Info: creating cache file /home/qth20/Downloads/build-paraview/superbuild/qt5/build/qtbase/.qmake.cache
In file included from /home/qth20/Downloads/build-paraview/superbuild/qt5/src/qtbase/include/QtCore/qstring.h:1:0,
                 from /home/qth20/Downloads/build-paraview/superbuild/qt5/src/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:44,
                 from /home/qth20/Downloads/build-paraview/superbuild/qt5/src/qtbase/include/QtCore/qcoreapplication.h:1,
                 from /home/qth20/Downloads/build-paraview/superbuild/qt5/src/qtbase/src/corelib/global/qt_pch.h:62:
/home/qth20/Downloads/build-paraview/superbuild/qt5/src/qtbase/include/QtCore/../../src/corelib/tools/qstring.h: In member function ‘bool QUrlPrivate::setHost(const QString&, int, int, QUrl::ParsingMode)’:
/home/qth20/Downloads/build-paraview/superbuild/qt5/src/qtbase/include/QtCore/../../src/corelib/tools/qstring.h:1037:7: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
     { if (i >= s.d->size) s.resize(i + 1, QLatin1Char(' ')); else s.detach();
       ^~
/usr/bin/x86_64-linux-gnu-ld.gold: error: .obj/qmutex_linux.o: multiple definition of 'QBasicMutex::lockInternal()'
/usr/bin/x86_64-linux-gnu-ld.gold: .obj/qmutex.o: previous definition here
/usr/bin/x86_64-linux-gnu-ld.gold: error: .obj/qmutex_linux.o: multiple definition of 'QBasicMutex::lockInternal(int)'
/usr/bin/x86_64-linux-gnu-ld.gold: .obj/qmutex.o: previous definition here
/usr/bin/x86_64-linux-gnu-ld.gold: error: .obj/qmutex_linux.o: multiple definition of 'QBasicMutex::unlockInternal()'
/usr/bin/x86_64-linux-gnu-ld.gold: .obj/qmutex.o: previous definition here
collect2: error: ld returned 1 exit status
Makefile:1158: recipe for target '../../lib/libQt5Core.so.5.10.1' failed
make[6]: *** [../../lib/libQt5Core.so.5.10.1] Error 1

I have deliberately tried to just use paraview, without anything extra (no guide, no tutorial, no ffmpeg, nothing. Just qt5 and paraview) and it is still giving up…

I am getting close to sudo apt install paraview… :’(

In that case you could download the Qt binaries and use that with the superbuild.

I’d recommend just using the Qt from the package manager unless you want a different version for some reason. I think Ubuntu’s Qt is fairly recent.