Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RooFit::MultiProcess & TestStatistics part 2 redo: RooFitZMQ & MultiProcess #9078

Conversation

egpbos
Copy link
Contributor

@egpbos egpbos commented Oct 6, 2021

This PR is a do-over of #8385 and #8412 and, as such, again the second part of a split and clean-up of #8294. The most important blocker in those PRs was the inclusion of a patched libzmq in RooFitZMQ itself. This patch has now been included in libzmq proper. Another blocking review comment was that libzmq symbols must not be allowed to be exported through our libraries. This has been solved in theory, and in practice is pending another PR to libzmq. Having fixed these two blockers, we should now be able to continue.

To recap:

In this PR, we introduce two packages: RooFitZMQ and RooFit::MultiProcess. It also adds two builtins for ZeroMQ to ease dependency management: libzmq and cppzmq. The builtin for libzmq is especially necessary at this point because it has recently gained a necessary feature that has not been released yet.

RooFit::MultiProcess is a task-based parallelization framework.

It uses forked processes for parallelization, as opposed to threads. We chose this approach because A) the existing RooRealMPFE parallelization framework already made use of forks as well, so we had something to build on and B) it was at the time deemed infeasible to check the entire RooFit code for thread-safety. Moreover, we use MultiProcess to parallelize gradients -- i.e. the tasks to be executed in parallel are partial derivatives -- and these are sufficiently large tasks that communication in between tasks is not a big concern in the big fits that we aimed to parallelize.

The communication between processes is done using ZeroMQ. The ZeroMQ dependency is wrapped in convenience classes contributed by @roelaaij which here are packaged as RooFitZMQ.

Will un-draft the PR once the following is done (based on previous review comments by @guitargeek @hageboeck @amadio @lmoneta and also some other things from myself):

  • includes: correct order (matching header, RooFit, ROOT, std) and ROOT includes in quotation marks
  • fix ZMQ deprecation warnings
  • refactor member names: underscore suffix
  • document important things with doxygen
  • remove commented out code and TODOs and other junk
  • fix copyright headers + author lists (RooFitZMQ: me, Roel; MP: me, Inti, Vince)
  • rebase in 2-3 neat commits that all compile and pass tests
  • clang-tidy up
  • change libzmq builtin back to master after PR is merged: Manually disable symbol export zeromq/libzmq#4266
  • use enum class instead of template parameters for minimizer function implementation choice -> next PR

Edit 18 Nov 2021: the following list is to keep track of unaddressed (at time of writing) comments made in this thread (because the thread is so long that it is very inconvenient to navigate on GitHub which doesn't load it all at once):

Let me know if you find additional items for the todo list.

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Collaborator

Build failed on mac1014/python3.
Running on macitois22.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-10-06T16:48:41.747Z] builtins/xrootd/XROOTD-prefix/include/xrootd/XrdCl/XrdClOptional.hh:58:29: warning: unused parameter 'n' [-Wunused-parameter]

@phsft-bot
Copy link
Collaborator

Build failed on mac11.0/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-10-06T20:43:42.824Z] builtins/xrootd/XROOTD-prefix/include/xrootd/XrdCl/XrdClOptional.hh:58:29: warning: unused parameter 'n' [-Wunused-parameter]

Failing tests:

amadio
amadio previously requested changes Oct 7, 2021
Copy link
Member

@amadio amadio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has improved a lot over the previous version. I think with just a bit of work to ensure the build system parts work in both builtin and non-builtin mode, it can be merged. I will leave review of things other than the build system for others in the team that are more familiar with RooFit.

BTW, it would also be really nice to have the final git history with fixups and formatting changes already squashed into the appropriate commits if you can do that. Thanks a lot!

builtins/zeromq/libzmq/CMakeLists.txt Show resolved Hide resolved
builtins/zeromq/libzmq/CMakeLists.txt Outdated Show resolved Hide resolved
cmake/modules/SearchInstalledSoftware.cmake Outdated Show resolved Hide resolved
roofit/multiprocess/CMakeLists.txt Outdated Show resolved Hide resolved
roofit/multiprocess/inc/RooFit/MultiProcess/Job.h Outdated Show resolved Hide resolved
roofit/roofitZMQ/CMakeLists.txt Outdated Show resolved Hide resolved
roofit/roofitZMQ/inc/RooFit_ZMQ/functions.h Outdated Show resolved Hide resolved
roofit/roofitZMQ/test/CMakeLists.txt Outdated Show resolved Hide resolved
@egpbos
Copy link
Contributor Author

egpbos commented Oct 7, 2021

Thanks for the build system review @amadio, very useful comments. Indeed, I will rebase stuff into probably just two commits, one for RooFitZMQ and one for MultiProcess. Maybe one more for the builtins, but probably not, because they don't make sense without RooFitZMQ.

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Collaborator

Build failed on mac1014/python3.
Running on macitois21.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-10-07T16:38:30.549Z] builtins/xrootd/XROOTD-prefix/include/xrootd/XrdCl/XrdClOptional.hh:58:29: warning: unused parameter 'n' [-Wunused-parameter]

@phsft-bot
Copy link
Collaborator

Build failed on mac11.0/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-10-07T17:47:46.821Z] builtins/xrootd/XROOTD-prefix/include/xrootd/XrdCl/XrdClOptional.hh:58:29: warning: unused parameter 'n' [-Wunused-parameter]

Failing tests:

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

2 similar comments
@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Collaborator

Build failed on mac11.0/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@egpbos
Copy link
Contributor Author

egpbos commented Oct 14, 2021

@lmoneta indeed, it looks like -Droofit_multiprocess=OFF, -Dbuiltin_zeromq=OFF and -Dbuiltin_cppzmq=OFF are used, at least on the mac11.0/cxx17 build log. Is there somewhere we can change this?

@egpbos
Copy link
Contributor Author

egpbos commented Oct 14, 2021

@phsft-bot build with flags -Droofit_multiprocess=ON

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1014/python3, mac11.0/cxx17, windows10/cxx14 with flags -Droofit_multiprocess=ON
How to customize builds

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-10-14T19:18:23.383Z] CMake Error at cmake/modules/SearchInstalledSoftware.cmake:17 (_find_package):
  • [2021-10-14T19:18:23.383Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-performance-centos8-multicore/default.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-10-14T19:18:31.690Z] CMake Error at cmake/modules/SearchInstalledSoftware.cmake:17 (_find_package):
  • [2021-10-14T19:18:31.690Z] CMake Error at /data/sftnight/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu2004/soversion.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-10-14T19:18:37.099Z] CMake Error at cmake/modules/SearchInstalledSoftware.cmake:17 (_find_package):
  • [2021-10-14T19:18:37.099Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-1.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-10-14T19:18:48.499Z] CMake Error at cmake/modules/SearchInstalledSoftware.cmake:17 (_find_package):
  • [2021-10-14T19:18:48.499Z] CMake Error at /mnt/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@phsft-bot
Copy link
Collaborator

Build failed on mac1014/python3.
Running on macitois21.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-10-14T19:19:40.685Z] CMake Error at cmake/modules/SearchInstalledSoftware.cmake:17 (_find_package):
  • [2021-10-14T19:19:40.685Z] CMake Error at /Volumes/HD2/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@phsft-bot
Copy link
Collaborator

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-10-14T19:19:41.789Z] CMake Error at cmake/modules/SearchInstalledSoftware.cmake:17 (_find_package):
  • [2021-10-14T19:19:42.046Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@phsft-bot
Copy link
Collaborator

Build failed on mac11.0/cxx17.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-10-14T19:20:36.842Z] CMake Error at cmake/modules/SearchInstalledSoftware.cmake:17 (_find_package):
  • [2021-10-14T19:20:36.842Z] CMake Error at /Users/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@egpbos
Copy link
Contributor Author

egpbos commented Oct 15, 2021

@phsft-bot build with flags -Droofit_multiprocess=ON

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1014/python3, mac11.0/cxx17, windows10/cxx14 with flags -Droofit_multiprocess=ON
How to customize builds

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-10-15T19:05:21.535Z] CMake Error at cmake/modules/SearchInstalledSoftware.cmake:17 (_find_package):
  • [2021-10-15T19:05:21.535Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@guitargeek guitargeek dismissed stale reviews from amadio and Axel-Naumann November 26, 2021 10:52

PR has been updated in the meantime and requested changes addressed

@guitargeek guitargeek merged commit 4398ac4 into root-project:master Nov 26, 2021
@amadio
Copy link
Member

amadio commented Nov 29, 2021

@egpbos Given my comment in your previous merge request, I am quite disappointed to learn that this has been merged as enabled by default when it depends on a yet unreleased version of ZeroMQ. This, for example, has caused failures in pretty much all the LCG builds today: https://cdash.cern.ch/index.php?project=LCGSoft&date=2021-11-29. Please disable roofit_multiprocess by default and re-enable it only when a released version of ZeroMQ has the functionality you need, adding the proper version in your call to find_package().

@egpbos
Copy link
Contributor Author

egpbos commented Nov 29, 2021

@amadio You're right, we overlooked that.

We should discuss in the RooFit dev meeting how to do this, also in the long run. I guess for the time being, setting it to OFF by default sounds reasonable. What do you think @guitargeek @lmoneta?

If this is indeed what we do, it would be quite important (imho) that CI still builds with -Droofit_multiprocess=ON -Dbuiltin_zeromq=ON -Dbuiltin_cppzmq=ON so that future changes don't break it. Then, when the new libzmq version is released, it will be easy to adapt the CMake config to that.

@guitargeek
Copy link
Contributor

Hi @amadio! I thought we had addressed this problem by making the unreleased zeromq interface only a dependency at ROOT build time, and the libraries are linked statically against this unreleased zeromq library. So it should not matter what is installed on the system, as long as the builtins are used for building.

What exactly is the problem you have at configuration times in these LCG builds? I can't see the full log. I hope it's just one of your configurations checks that doesn't work in your environment and we can fix that.

@egpbos
Copy link
Contributor Author

egpbos commented Nov 29, 2021

Ah, I wasn't aware that that was also meant to solve @amadio's problem, thx @guitargeek.

@amadio
Copy link
Member

amadio commented Nov 29, 2021

The problem is that LCG cannot use builtins (and also sets fail-on-missing=ON), as well as other Linux distributions, like Fedora, Gentoo, Arch, etc. Something that only works with builtins cannot be enabled by default.

@egpbos
Copy link
Contributor Author

egpbos commented Nov 29, 2021

Hm ok, actually it does also work with a custom built/installed from source version of the unreleased libzmq library, so that would be an option to avoid builtins in those situations. But I guess that's not something they will want to invest time in.

@guitargeek
Copy link
Contributor

Makes sense in general, that building without builtins should be possibe in LCG and distros! But why can't we use builtins at compile time only? I don't see why not, and that would also be a big restriction :)

@Axel-Naumann
Copy link
Member

Axel-Naumann commented Nov 29, 2021

The problem is that LCG cannot use builtins

That's only half-true, of course we do have builtins that LGC builds with just fine (libAfterImage, llvm, etc). But then we must not expose it as "override-able". So either it's not configurable and we always build our "hacked" zmq (exporting neither headers nor symbols, so the world doesn't care), or we wait until it's released.

@guitargeek
Copy link
Contributor

guitargeek commented Nov 29, 2021

100 % agreed. So I'll open a PR to always use our "hacked" zmq (and yes we expose neither headers nor symbols). When it's release we can change it back

@amadio
Copy link
Member

amadio commented Nov 29, 2021

But why can't we use builtins at compile time only?

ZeroMQ is already part of LCG, so unless we are absolutely sure that no symbol will be leaked, we should use the external one. Like with LLVM, which has bitten with this many times because of mesa using it too and linking to it, there's always the risk of having multiple incompatible versions of symbols loaded into the same running process. Builtins are evil, and patched builtins are extra evil. Please just disable it by default, else you are running the risk of breaking experiment software that uses both ROOT and ZeroMQ because of enabling the builtin. Remember what builtin LZMA without optimizations has caused to CMS already and please don't repeat that mistake.

@amadio
Copy link
Member

amadio commented Nov 29, 2021

As for requiring a patched version of something, have a look a this bug: https://bugs.gentoo.org/824018 for an example of the consequences.

@Axel-Naumann
Copy link
Member

What's the release schedule for zeromq versus our mid January ROOT v6.26?

@guitargeek
Copy link
Contributor

guitargeek commented Nov 29, 2021

Ok fair enough.

  • I was just checking, and indeed there are zmq symbols that end up in libRooFitMultiprocessing and libRooFitZMQ. There are probably some visibilty-related flags that would need to be changed.

  • This means that for the time being, we have to disable roofit_multiprocessing by default, even if we always use our "hacked" zeromq at compile time like I suggested before.

  • If roofit_multiprocessing were to be re-enabled by default, the symbol leak needs to be fixed - including unit tests that make sure there are no zmq symbols exported by the new RooFit libraries.

Is that okay?

@egpbos
Copy link
Contributor Author

egpbos commented Nov 29, 2021

Sounds reasonable to me. I checked previously that there were no ZeroMQ symbols in RooFitZMQ, so I'm surprised they are back. Indeed, adding a unit test seems ideal to make sure they stay out.

On CI, we can still enable roofit_multiprocessing, though, right? That way, at least the code won't rot until we can fix it.

@egpbos
Copy link
Contributor Author

egpbos commented Nov 29, 2021

What's the release schedule for zeromq versus our mid January ROOT v6.26?

@Axel-Naumann I don't know actually, I'll ask on Gitter.

@egpbos
Copy link
Contributor Author

egpbos commented Nov 30, 2021

@guitargeek How did you find zmq symbols in the libraries? I don't see them with the following check:

root [0] R__LOAD_LIBRARY(libRooFitZMQ)
root [1] int a, b, c; zmq_version(&a, &b, &c);

RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby
                Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
                All rights reserved, please read http://roofit.sourceforge.net/license.txt

IncrementalExecutor::executeFunction: symbol 'zmq_version' unresolved while linking [cling interface function]!
root [2]

This is on macOS with most settings default, so with modules. Perhaps the PCH build leaks symbols somehow?

@guitargeek
Copy link
Contributor

I have seen them with this command (I got it from here):

nm libRooFitZMQ.so  | c++filt | cut -d ' ' -f 3-99 | sort | uniq

I think this was a false alarm, because I forgot to look only for dynamic symbols (passing the -D flag to nm). I need to read a little bit about linkers to understand what the difference really is :)

But indeed, I think there is no symbol leak because I can't use libRooFitZMQ instead of libzmq when compiling this code snippet:

#include <zmq.h>

int main(int argc, char** argv) {
   return ((int*)(&zmq_poll))[argc];
}

Compiled with g++ -L.RooFit.so -o check check.C.

Meaning that as far as I can tell, there is no symbol leak. Still, we have switched off roofit_multiprocess by default now. Probably we will only consider enabling it in the release after 6.26.

@amadio
Copy link
Member

amadio commented Dec 3, 2021

I need to read a little bit about linkers to understand what the difference really is :)

Just read man nm. You have to ensure that all symbols from ZeroMQ are marked with a small t, as that means that the symbol is local (i.e. not exported). You can do a crude check for exported symbols like this:

$ nm libRooFitZMQ.so | awk '/ T /{print $3}' | c++filt

and look for ZeroMQ symbols in the output.

@egpbos
Copy link
Contributor Author

egpbos commented Dec 3, 2021

Indeed, this shows no ZeroMQ symbols in libRooFitZMQ.so or libRooFitMultiProcess.so, nor in the new libRooFitCore.so of #9349, so it seems we are safe.

@guitargeek Indeed, in #9349, roofit_multiprocess will be switched off. In the coming release, people can start trying it out and it could be defaulted ON later on, when the ZeroMQ release with zmq_ppoll has also happened.

guitargeek added a commit to guitargeek/root that referenced this pull request Dec 8, 2021
In the v6.26 development cycle cycle, some RooFit helper header files
whose names don't start with the `Roo` prefix sneaked into the
RooFitCore library. These headers have the overly generic names
`Floats.h` and `UniqueId.h`, which calls for trouble in environments
where the ROOT headers are directly installed in the main system include
path (most Linux distributions).

To prevent any possible issues, this commit proposes and follows new
conventions for RooFit headers:

  * Installed RooFit headers must start with `Roo*` or must be located
    in a subdirectory starting with `Roo*` (e.g. RooFit or RooStats).
  * Similarly, if the class name doesn't start with Roo, it has to go in
    a `Roo*` namespace (usually `RooFit`)
  * Free functions always need to go in this namespace
  * For implmentation details that we can't avoid installing, we can use
    a `Roo*::Detail` namespace like we have with `ROOT::Detail` (same
    with `Experimental`)

We should also keep in mind what we established in PR root-project#9078:

  * `inc/` is for installed headers
  * `res/` is for headers that are only used at compile time of other
    ROOT components
  * Headers only used within a library go to `src/`

This means that there is no need in specifiying the headers to install
manually in `roofit/rofitcore/CMakeLists.txt`. We can glob for all the
headers fulfilling the criteria above.
guitargeek added a commit to guitargeek/root that referenced this pull request Dec 9, 2021
In the v6.26 development cycle cycle, some RooFit helper header files
whose names don't start with the `Roo` prefix sneaked into the
RooFitCore library. These headers have the overly generic names
`Floats.h` and `UniqueId.h`, which calls for trouble in environments
where the ROOT headers are directly installed in the main system include
path (most Linux distributions).

To prevent any possible issues, this commit proposes and follows new
conventions for RooFit headers:

  * Installed RooFit headers must start with `Roo*` or must be located
    in a subdirectory starting with `Roo*` (e.g. RooFit or RooStats).
  * Similarly, if the class name doesn't start with Roo, it has to go in
    a `Roo*` namespace (usually `RooFit`)
  * Free functions always need to go in this namespace
  * For implmentation details that we can't avoid installing, we can use
    a `Roo*::Detail` namespace like we have with `ROOT::Detail` (same
    with `Experimental`)

We should also keep in mind what we established in PR root-project#9078:

  * `inc/` is for installed headers
  * `res/` is for headers that are only used at compile time of other
    ROOT components
  * Headers only used within a library go to `src/`

This means that there is no need in specifiying the headers to install
manually in `roofit/rofitcore/CMakeLists.txt`. We can glob for all the
headers fulfilling the criteria above.
guitargeek added a commit to guitargeek/root that referenced this pull request Dec 9, 2021
In the v6.26 development cycle cycle, some RooFit helper header files
whose names don't start with the `Roo` prefix sneaked into the
RooFitCore library. These headers have the overly generic names
`Floats.h` and `UniqueId.h`, which calls for trouble in environments
where the ROOT headers are directly installed in the main system include
path (most Linux distributions).

To prevent any possible issues, this commit proposes and follows new
conventions for RooFit headers:

  * Installed RooFit headers must start with `Roo*` or must be located
    in a subdirectory starting with `Roo*` (e.g. RooFit or RooStats).
  * Similarly, if the class name doesn't start with Roo, it has to go in
    a `Roo*` namespace (usually `RooFit`)
  * Free functions always need to go in this namespace
  * For implmentation details that we can't avoid installing, we can use
    a `Roo*::Detail` namespace like we have with `ROOT::Detail` (same
    with `Experimental`)

We should also keep in mind what we established in PR root-project#9078:

  * `inc/` is for installed headers
  * `res/` is for headers that are only used at compile time of other
    ROOT components
  * Headers only used within a library go to `src/`

This means that there is no need in specifiying the headers to install
manually in `roofit/rofitcore/CMakeLists.txt`. We can glob for all the
headers fulfilling the criteria above.
guitargeek added a commit that referenced this pull request Dec 9, 2021
In the v6.26 development cycle cycle, some RooFit helper header files
whose names don't start with the `Roo` prefix sneaked into the
RooFitCore library. These headers have the overly generic names
`Floats.h` and `UniqueId.h`, which calls for trouble in environments
where the ROOT headers are directly installed in the main system include
path (most Linux distributions).

To prevent any possible issues, this commit proposes and follows new
conventions for RooFit headers:

  * Installed RooFit headers must start with `Roo*` or must be located
    in a subdirectory starting with `Roo*` (e.g. RooFit or RooStats).
  * Similarly, if the class name doesn't start with Roo, it has to go in
    a `Roo*` namespace (usually `RooFit`)
  * Free functions always need to go in this namespace
  * For implmentation details that we can't avoid installing, we can use
    a `Roo*::Detail` namespace like we have with `ROOT::Detail` (same
    with `Experimental`)

We should also keep in mind what we established in PR #9078:

  * `inc/` is for installed headers
  * `res/` is for headers that are only used at compile time of other
    ROOT components
  * Headers only used within a library go to `src/`

This means that there is no need in specifiying the headers to install
manually in `roofit/rofitcore/CMakeLists.txt`. We can glob for all the
headers fulfilling the criteria above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants