Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Ubuntu compile Qt failed



  • Hi,
    I am trying to compile Qt on Ubantu , following This blog. However, I am getting the error below. Could anyone help me out?
    ../../include/QtCore/5.13.0/QtCore/private/../../../../../src/corelib/tools/qsimd_p.h:196:14: fatal error: 'x86intrin.h' file not found

    include <x86intrin.h>

             ^~~~~~~~~~~~~
    

    1 error generated.
    shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting
    Makefile:10986: recipe for target '.obj/qendian.o' failed
    make[3]: *** [.obj/qendian.o] Error 1
    make[3]: Leaving directory '/home/lixing/qt-everywhere-src-5.13.0-alpha/qtbase/src/corelib'
    Makefile:222: recipe for target 'sub-corelib-make_first' failed
    make[2]: *** [sub-corelib-make_first] Error 2
    make[2]: Leaving directory '/home/lixing/qt-everywhere-src-5.13.0-alpha/qtbase/src'
    Makefile:50: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory '/home/lixing/qt-everywhere-src-5.13.0-alpha/qtbase'
    Makefile:82: recipe for target 'module-qtbase' failed
    make: *** [module-qtbase] Error 2



  • @Lee1101

    Hi and welcome to devnet forum

    Any particular reason to compile Qt5.13.alpha?
    5.13 alpha is as called an alpha release. It is still some time until it will be released. Therefore it is recommended to use Qt5.12.1 as the last pre-built release.



  • Thanks for your reply~ I am trying to use qt web assembly , I tried 5.12, also the same error


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What compiler are you using ?



  • @SGaist Hi,thanks for your reply. I am using emcc. And the information of emcc can be found below:
    lixing@lixing-virtual-machine:~/project$ em++ -v
    emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.38.28
    clang version 6.0.1 (https://github.com/emscripten-core/emscripten-fastcomp-clang 605a43bd86aa1f7571e169f606d2ea06cdd835a2) (https://github.com/emscripten-core/emscripten-fastcomp e7cdb2a092b096d7116c90a25b82456899dcdc4c) (emscripten 1.38.28 : 1.38.28)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /home/lixing/myfastcomp/emscripten-fastcomp/build/bin
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
    Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
    Candidate multilib: .;@m64
    Selected multilib: .;@m64
    shared:INFO: (Emscripten: Running sanity checks)



  • Hi guys! I want to join you conversation because I have the same problem.

    So I will start from the beginning.
    I tried to compile just created(with help of Qt Creator) untouched GUI project. I cd to project directory and run /path/to/qt/install/dir/5.13.0/wasm_32/bin/qmake qtwindow.pro(emsdk was activated before source /path/to/emsdk/emsdk_env.sh). Then make and here I dot errors:

    error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcj
    error: undefined symbol: _Znaj
    error: undefined symbol: _Znwj
    error: undefined symbol: _ZnwjRKSt9nothrow_t
    

    First I tried to solve them but without any luck. Digging in the internet make me think that "may be problem in QT, maybe it was compiled with most recent libs or something". So I decided to compile QT from source. I followed instructions in https://blog.qt.io/blog/2018/11/19/getting-started-qt-webassembly/ but stuck on step make module-qtbase module-qtdeclarative with next error:

    em++ -c -pipe -O3 -Oz -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -s ALLOW_MEMORY_GROWTH=1 -Wall -W -Wdate-time -Winconsistent-missing-override -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DPCRE2_CODE_UNIT_WIDTH=16 -I. -I../3rdparty/zlib/src -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty -I../3rdparty/double-conversion/include -I../3rdparty/double-conversion/include/double-conversion -I../3rdparty/forkfd -I../3rdparty/tinycbor/src -I../../include -I../../include/QtCore -I../../include/QtCore/5.13.0 -I../../include/QtCore/5.13.0/QtCore -I.moc -I.tracegen -I../3rdparty/pcre2/src -I../../mkspecs/wasm-emscripten -o .obj/qendian.o global/qendian.cpp
    In file included from global/qendian.cpp:44:
    In file included from ../../include/QtCore/5.13.0/QtCore/private/qsimd_p.h:1:
    ../../include/QtCore/5.13.0/QtCore/private/../../../../../src/corelib/tools/qsimd_p.h:196:14: fatal error: 'x86intrin.h' file not found
    #    include <x86intrin.h>
                 ^~~~~~~~~~~~~
    1 error generated.
    

    I tried to edit qtbase/src/corelib/Makefile and add next paths to em++(-I option)

    locate x86intrin.h
    /home/codepriest/Android/Sdk/build-tools/26.0.2/renderscript/clang-include/x86intrin.h
    /home/codepriest/Android/Sdk/build-tools/27.0.3/renderscript/clang-include/x86intrin.h
    /home/codepriest/Works/playground/emsdk/clang/fastcomp/build_incoming_64/lib/clang/6.0.1/include/x86intrin.h
    /home/codepriest/Works/playground/emsdk/clang/fastcomp/src/tools/clang/lib/Headers/x86intrin.h
    /srv/big-data/qt/Tools/QtCreator/libexec/qtcreator/clang/lib/clang/7.0.0/include/x86intrin.h
    /usr/lib64/clang/4.0.1/include/x86intrin.h
    /usr/lib64/gcc/x86_64-suse-linux/4.8/include/x86intrin.h
    /usr/lib64/gcc/x86_64-suse-linux/8/include/x86intrin.h
    

    It solve problem with missing x86intrin.h(and other libs) but it start to complain on content of this headers, it look like it is not compatible with QT or emscripten or something like that(if it important I can reproduce this error).

    Thanks in advance.


  • Moderators

    I suggest asking on interest Qt mailing list - the devs behind wasm hang out there, they might be able to help.



  • How we can ask them? Can you share email address or something?





  • I have exactly the same issue. Where is this header coming from?

    corelib/tools/qsimd_p.h:196:14: fatal error: 'x86intrin.h' file not found



  • I have the same problem as well on Ubuntu Bionic. The include file should come from clang includes.



  • Got an answer from the mailing list: Use the latest version from the git 5.13 branch. With this hint I got it working on Ubuntu.


  • Banned

    This post is deleted!


  • @sierdzio said in Ubuntu compile Qt failed:

    I suggest asking on interest Qt mailing list - the devs behind wasm hang out there, they might be able to help.

    Sorry, I didn't realize there were people actually using it and posting issues here. :)



  • I use Fedora 29 kernel 5 for the OS, Qt 5.12.3 from source and Ryzen for processor. Just remove or comment some line of codes from the file
    ~/[QT Source Directory]/qtbase/src/corelib/tools/qsimd_p.h

    find " include <x86intrin.h>"
    this from my file:

    #  if defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
    // GCC 4.4 and Clang 2.8 added a few more intrinsics there
    #    include <x86intrin.h>
    #  endif
    

    after change:

    /*
    #  if defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
    // GCC 4.4 and Clang 2.8 added a few more intrinsics there
    #    include <x86intrin.h>
    #  endif
    */
    

    and everything work fine now.
    Sorry for my language :)


Log in to reply