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

Problems with hard-coded #include statements

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 6.10/00, 6.08/08
    • 6.08/06
    • Build System
    • None
    • Debian 8 x86_64

    Description

      Hi!

      I ran into some problems caused by hard-coded paths in #include statements inside the ROOT dictionary.

      If headers of a ROOT-based shared library are not located at the same location on the build and the execution system (e.g. clusters), apparently one has to provide all headers without preceding paths to rootcling and specify the locations(s) via -I flags. The paths provided by those flags will be stored in the dictionary and then checked on the execution system. They can be further adjusted by modifying the ROOT_INCLUDE_PATH environment variable to include additional header locations.

      Now, the problem is that using ROOT_GENERATE_DICTIONARY it seems to be impossible to pass headers without preceding path to rootcling. In the older
      FindROOT.cmake the path of the header dictionary will be automatically added (find_file). In the newer RootNewMacros.cmake the raw headers string will be passed to rootcling but a CMake dependency on the headers will be introduced:

      341   #---call rootcint------------------------------------------
      342   add_custom_command(OUTPUT ${dictionary}.cxx ${pcm_name} ${rootmap_name}
      343                      COMMAND ${command} -f  ${dictionary}.cxx ${newargs} ${excludepathsargs} ${rootmapargs}
      344                                         ${ARG_OPTIONS} ${definitions} ${includedirs} ${rheaderfiles} ${_linkdef}
      345                      IMPLICIT_DEPENDS CXX ${_linkdef} ${headerfiles}
      346                      DEPENDS ${headerfiles} ${_linkdef} ${ROOTCINTDEP}

      As the headers were specified without paths, this will obviously bring CMake to a stop complaining about the missing headers.

      I don't really know how to fix this in the best way. Please let me know if there is another way around this problem.

      Cheers,
      Dominik

      Attachments

        Issue Links

          Activity

            People

              amadio Guilherme Amadio
              246283f04147bf150841 dominik.werthmueller@glasgow.ac.uk
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Actual End: