Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-733

Shiboken execution fails on CentOS 7.2 with gcc 4.8.5

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.11.1
    • 5.11.0
    • Shiboken
    • None
    • CentOS 7.2
      gcc 4.8.5
      custom built libclang
    • Linux/X11
    • 2313b5247def794216acb1afde93f2c33c2b7aa0 (pyside-setup 5.11, 10.7.2018, 5.11.1)

    Description

      When I install pyside2 with

      python setup.py  --qmake=$(which qmake) --build-tests --ignore-git --jobs=8 install
      

      I run into

      qt.shiboken: (shiboken) CLANG builtins includes directory: /work/logiciels/rh7/llvm/6.0.1/lib/clang/6.0.1/include
      (minimal) clang_parseTranslationUnit2(0x0, cmd[7]=-isystem/work/logiciels/rh7/llvm/6.0.1/lib/clang/6.0.1/include -fPIC -fno-exceptions -Wno-constant-logical-operand -std=c++14 -I/work/scratch/logiciels/sources/pyside2/pyside-setup/sources/shiboken2/tests/libminimal /tmp/global_J46778.hpp)
      (shiboken) clang_parseTranslationUnit2(0x0, cmd[6]=-isystem/work/logiciels/rh7/llvm/6.0.1/lib/clang/6.0.1/include -fPIC -fno-exceptions -Wno-constant-logical-operand -std=c++14 /tmp/nothing_J46774.hpp)
      Detecting inconsistencies in typesystem...   [OK]
      
      qt.shiboken: (shiboken) No C++ classes found!
      /work/scratch/logiciels/sources/pyside2/pyside-setup/sources/shiboken2/tests/libminimal/listuser.h:32:10: fatal error: 'list' file not found
      

      This relates to the fact clang in installed in a non standard directory, and that its default standard library is libc++. The installation procedure can be found there.

      $ echo | clang++ -Wp,-v -x c++ - -fsyntax-only
      clang -cc1 version 6.0.1 based upon LLVM 6.0.1 default target x86_64-unknown-linux-gnu
      ignoring nonexistent directory "/include"
      #include "..." search starts here:
      #include <...> search starts here:
       /work/logiciels/rh7/llvm/6.0.1/bin/../include/c++/v1
       /usr/local/include
       /work/logiciels/rh7/llvm/6.0.1/lib/clang/6.0.1/include
       /usr/include
      End of search list.
      

      Note that I could proceed with the compilation thanks to a very dirty hack

      diff --git i/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp w/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
      index 6554548..6f82fbd 100644
      --- i/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
      +++ w/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
      @@ -178,6 +178,13 @@ QByteArrayList emulatedCompilerOptions()
               result.append(QByteArrayLiteral("-isystem"));
               result.append(clangBuiltinIncludesDir);
           }
      +        const HeaderPaths gppPaths = gppInternalIncludePaths(QStringLiteral("clang++"));
      +        for (const HeaderPath &h : gppPaths) \{
      +            // if (h.path.contains("c++"))
      +            // result.append(QByteArrayLiteral("-isystem"));
      +            // result.append(h.path);
      +            headerPaths.append(h);
      +        }
           // Append the c++ include paths since Clang is unable to find <list> etc
           // on RHEL 7.4 with g++ 6.3. A fix for this has been added to Clang 5.0,
           // so, the code can be removed once Clang 5.0 is the minimum version.
      @@ -194,7 +201,7 @@ QByteArrayList emulatedCompilerOptions()
           detectVulkan(&headerPaths);
           std::transform(headerPaths.cbegin(), headerPaths.cend(),
                          std::back_inserter(result), [](const HeaderPath &p) \{
      -                       return HeaderPath::includeOption(p, true);
      +                       return HeaderPath::includeOption(p, false);
           });
           return result;
       }
      

      Attachments

        Issue Links

          Activity

            People

              kleint Friedemann Kleint
              luchermitte Luc Hermitte
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: