Skip to content

[Build system] ROOT installs its builtins directly into CMAKE_INSTALL_PREFIX. #8655

Closed

Description

@hageboeck
  • Checked for duplicates

Describe the bug

When you install a ROOT with builtins, it also installs the builtin headers (+ libraries probably) into the system directory.
This might be at least surprising, if not annoying.

Expected behavior

If builtins are needed, they could go into ${CMAKE_INSTALL_PREFIX}/include/ROOT_builtins} or similar.

This unfortunately requires going through all builtins, and changing their install locations, but I don't see a way around that.

To Reproduce

cmake -DCMAKE_INSTALL_PREFIX=/tmp/dummyInstallation <path/to/root>
make -j install

Setup

Master, linux.

Activity

  1. eguiraud commented on Apr 4, 2023

    @eguiraud
    Contributor

    The headers of a builtin nlohmann/json are installed at ${CMAKE_INSTALL_PREFIX}/include/nlohmann, which (as far as installing third-party stuff goes) is probably ok?

    Or you would rather have ROOT install those headers at ${CMAKE_INSTALL_PREFIX}/include/ROOT_builtins/nlohmann? If this was the case, projects building against ROOT would not find the builtins anymore, at least not without extra care.

  2. hageboeck commented on Apr 4, 2023

    @hageboeck
    MemberAuthor

    I guess the question is whether ROOT should interfere with what you installed in your system. Let's say you have something installed in /usr/include/nlohmann. Now you install ROOT, and for some reason it came with a builtin nlohmann_json (e.g. because of a different version). Now, everything in your system that was relying on the original nlohman_json version is broken.
    I thought that as far as reasonably possible, ROOT should not interfere with what you install in your system (i.e. it should leave all headers and libraries untouched), unless they are ROOT's own headers/libraries?

    You are correct that projects building against that installed ROOT would need to know about the include location, but I would think that this is ROOT's job (by exporting CMake targets such as ROOT::nlohmann).

    Maybe that's what users expect of ROOT, but I was at least surprised to have stuff installed that I didn't ask for.

    Let me rephrase this, maybe:
    You install X from source. Would you expect that this also installs Y, and possibly overwrites / corrupts any existing Ys?

  3. hageboeck commented on Jul 29, 2026

    @hageboeck
    MemberAuthor

    Tested today with all builtins on. Removed all files that match Roo*.h and T[A-Z]*.h. This results in:

    Bswapcpy.h            Bytes.h        CPyCppyy     Foption.h      HelpSMText.h     HFMsgService.h  Match.h         MPSendRecv.h      RConfigOptions.h  ROOT.modulemap      RStipples.h    RtypesImp.h  Strlen.h              v5                    X3DBuffer.h  ZipZSTD.h
    Buttons.h             Byteswap.h     CsgOps.h     Getline.h      HelpText.h       Hoption.h       Math            NetErrors.h       RConfigure.h      root_std_complex.h  RStringView.h  RVersion.h   strtok.h              Varargs.h             XRooFit.h
    bvh                   cfortran.h     DllImport.h  GLConstants.h  HelpTextTV.h     Hparam.h        MessageTypes.h  PoolUtils.h       Riostream.h       Rpair.h             Rstrstream.h   RZip.h       ThreadLocalStorage.h  vdt                   xrootd
    bvh2_extra_kernels.h  compiledata.h  ESTLType.h   Gtypes.h       Hepevt.h         Htypes.h        Minuit2         PosixThreadInc.h  RooStats          RQ_OBJECT.h         RtypesCore.h   snprintf.h   TMVA                  VectorizedTMath.h     ZipLZ4.h
    bvh2_third_party.h    Compression.h  Fit          GuiTypes.h     HFitInterface.h  KeySymbols.h    MPCode.h        RConfig.h         ROOT              RRemoteProtocol.h   Rtypes.h       strlcpy.h    TreeUtils.h           WidgetMessageTypes.h  ZipLZMA.h
    

    Particularly bad are probably:

    Also generic headers like: Match.h, Buttons.h, Compression.h

  4. self-assigned this
    on Jul 29, 2026
  5. ferdymercury commented on Sep 16, 2026

    @ferdymercury
    Collaborator

    The original issue is now solved thanks to Stephan. Builtins are private links so headers are not installed.
    The side observations (zipLzma, strlcpy, riostream, etc) are under deprecation and will be removed soon.
    Buttons.h or Match.h are very generic, but even if not, Debian won't be happy with adding 2000 headers without ROOT prefix so a different approach is being investigated that changes install prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions