Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8267

ROOT 6 master fails to compile if clang present in system include paths, picks up system's clang includes!

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.08/00
    • Component/s: Cling
    • Labels:
      None
    • Environment:

      Gentoo Linux x86_64

      Description

      Dear Axel,

      after the "upgrade for the upgrade" from today (12.7.16) it seems that cling in ROOT picks up my system's clang headers instead of the one from the ROOT build tree:

      [ 89%] Building CXX object /var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/lib/Interpreter/CMakeFiles/clingInterpreter.dir/AutoSynthesizer.cpp.o
      cd /var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/lib/Interpreter && /usr/libexec/icecc/bin/x86_64-pc-linux-gnu-g++   -DCLING_INCLUDE_PATHS=\"/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/llvm/inst/include:/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/include:/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/../clang/include:/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/../../include\" -DCLING_VERSION="0.3~dev" -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/lib/Interpreter -I/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/include -I/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/../clang/include -I/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/llvm/obj/include -I/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/llvm/src/include  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG   -fno-rtti  -fno-exceptions -fno-rtti -o CMakeFiles/clingInterpreter.dir/AutoSynthesizer.cpp.o -c /var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/lib/Interpreter/AutoSynthesizer.cpp
      In file included from /usr/include/clang/AST/ExternalASTSource.h:17:0,
                       from /usr/include/clang/AST/Decl.h:20,
                       from /var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/lib/Interpreter/ASTTransformer.h:15,
                       from /var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/lib/Interpreter/AutoSynthesizer.h:13,
                       from /var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/lib/Interpreter/AutoSynthesizer.cpp:10:
      /usr/include/clang/AST/CharUnits.h: In Elementfunktion »clang::CharUnits clang::CharUnits::RoundUpToAlignment(const clang::CharUnits&) const«:
      /usr/include/clang/AST/CharUnits.h:177:26: Fehler: »RoundUpToAlignment« ist kein Element von »llvm«
               return CharUnits(llvm::RoundUpToAlignment(Quantity, 
                                ^

      i.e. ROOTs "interpreter/cling/lib/Interpreter/ASTTransformer.h" includes "/usr/include/clang/AST/Decl.h" instead of using the version in-tree from "interpreter/llvm/src/tools/clang/include/clang/AST/Decl.h".
      It seems that "interpreter/llvm/src/tools/clang/include/" is missing from the set of "-I" flags...
      The include path "/var/tmp/portage/sci-physics/root-9999/work/root-9999/interpreter/cling/../clang/include" which is included instead seems wrong to me, but I fail to find the reason, i.e. where exactly the list of include directories is collected, maybe you're more lucky than I am (and I wonder why this does not show up elsewhere...) .

      This is a configure-build, but I think at this place it does not really matter since it seems to happen inside LLVM-cmake if I see that correctly.

      Cheers,
      Oliver

        Attachments

          Activity

            People

            Assignee:
            axel Axel Naumann
            Reporter:
            ofreyerm Oliver Freyermuth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Actual End: