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

include dependency of builtins

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Medium
    • Resolution: Unresolved
    • 6.14/04
    • None
    • Build System
    • None
    • _ROOT Version: 6.14/04
      Platform: linux
      Compiler: gcc 8.2.0

    Description

      https://root-forum.cern.ch/t/include-path-from-root-config-semi-complete/30449

      It occured to me that root headers are nowadays in
      ${CMAKE_INSTALL_PREFIX}/include/root and not anymore in
      ${CMAKE_INSTALL_PREFIX}/include, while still being included as #include "TF1.h" and not #include "root/TF1.h". Now that's fine, and root-config --cflags prints out a -I flag with the trailing root.

      But, when one installs VecCore along with root, these do end up in
      ${CMAKE_INSTALL_PREFIX}/include, which may not be in any standard -I path.

      MWE:

      build and install root with -Dbuiltin_veccore=ON -Dveccore=ON -DCMAKE_INSTALL_PREFIX=/home/pseyfert/root-install-and-nothing-else.

      create a tiny c++ file echo '#include "TF1.h"' > main.cpp.

      set up a build environment export CPPFLAGS=$(root-config --cflags); export CXX=$(root-config --cxx) (linkage not needed).

      use gnu make builtin rules to compile make main.o
      (results in c++ -pthread -std=c++1z -m64 -fdiagnostics-color -march=native -O3 -g -Wextra -Wall -Wshadow -I/home/pseyfert/root-install-and-nothing-else/include/root -c -o main.o main.cpp for me)

      the compilation then fails because of

      In file included from /home/pseyfert/root-install-and-nothing-else/include/root/TFormula.h:24,
      from /home/pseyfert/root-install-and-nothing-else/include/root/TF1.h:27,
      from main.cpp:1:
      /home/pseyfert/root-install-and-nothing-else/include/root/Math/Types.h:22:10: fatal error: VecCore/VecCore: No such file or directory
      #include <VecCore/VecCore>
      ^~~~~~~~~~~~~~~~~
      compilation terminated.
      make: *** [<builtin>: main.o] Error 1
      Not overly happy with this, but unsure if I should file that under 'unfortunate corner case', 'bug', 'new-version-migration-task' or something else.

      (root_numpy doesn't build for me atm because of this, which can be worked around by adding `-I/home/pseyfert/root-install-and-nothing-else/include` to the environment variable CPPFLAGS)

      It looks like I also hit this problem when using cmake https://root.cern.ch/how/integrate-root-my-project-cmake (although I had hoped cmake's dependency management would take care of that).

      from @amadio's reply https://root-forum.cern.ch/t/include-path-from-root-config-semi-complete/30449/4?u=pseyfert this comes from the -Dgnuinstall=ON flag

      Attachments

        Activity

          People

            oshadura Oksana Shadura
            pseyfert Paul Seyfert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: