-
Notifications
You must be signed in to change notification settings - Fork 167
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
add boost to ROOT INCLUDE PATH #1305
Conversation
Hmm. Isn't it just possible to mask out the boost headers to Cling with some |
Yeah, this is a slippery slope, that's why I was suggesting to refactor the code rather than have everything in the ROOT dictionaries. This will also make the memory usage explode until the C++ modules are available in ROOT. |
@dberzano As far as I understand, the #ifdef guards can mask the unwanted headers in the macro only in the interpreted mode, in the ACLIC compilation both both CLING and ROOTCLING are defined like in the standard compilation. @ktf Fine as a principle, but realistically I don't see what I can do. In 3 days I had 2 unrelated occasions of O2 headers depending on the low-level framework classes. If we don't allow such dependencies, it should be imposed as a policy and probably added to CI test (e.g. no #include <boost" in the common headers). Also note that in the example above the boost headers are successfully loaded provided the system boost is used. @davidrohr In this particular case, the |
What I am saying is that #if !defined(__CLING__) && !defined(__ROOTCLING__)
#include <relevant_boost_headers.h>
#endif |
this only works if the header is used only by the implementation, not the API.. |
@ktf Yes exactly. I hope this is the case (I haven't looked at the code actually), in most cases it is. |
for boost i kind of disagree. this is used at many places,so it would be a good idea to make it availabe to root generally similarly to when the system installation of boost is used.
Kind Regards
David Rohr
(Sent from my mobile, excuse the typos.)
…On 27 September 2018 12:05:20 CEST, Dario Berzano ***@***.***> wrote:
What I am saying is that `ROOT_INCLUDE_PATH` should be needed at
runtime only for dictionaries, and we should not need boost in any
dictionary, in principle. What we need to do is masking out the code
when invoking `rootcling`.
```cxx
#if !defined(__CLING__) && !defined(__ROOTCLING__)
#include <relevant_boost_headers.h>
#endif
```
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1305 (comment)
|
@davidrohr I think we should:
In this particular case, isn't it possible to mask both the |
@dberzano : "...What we need to do is masking out the code when invoking rootcling." @davidrohr : in the particular case of the
declaration in the same header, which is enough to declare the friend class (and Cluster.cxx does not use boost either). I've compiled both O2 and dependent macro w/o this include. Do you want me commit the Cluster.h w/o include, until we decide common recipe for such situations? |
@shahor02 : I am not the author of this class, and I didn't add boost. @dberzano : well, it is a bit weird, boost is a common library used in many places, and also available to root if we use the system boost. So I do not see a reason why we shouldn't make the boost headers available to root in case we use the alidist boost. This is a bit like if we would not allow any std::... includes in headers parsed by ROOT. In general, I agree we should keep the dictionary generation simple, but we also shouldn't make our life unnecessarily hard. |
OK so it seems it's not needed here. @shahor02 let me further clarify. The header must not be masked in the compiled macro, this is not what I said. I suggested to mask it while generating the class dictionary. This happens at compile time by invoking @davidrohr I strongly stand on both my points: if we can make it work without adding more (and more and more) stuff to |
IMHO if it's hard to disentangle boost / fairmq / stl from dictionary creation it means we are doing something wrong with what we are saving as ROOT objects. Boost / STL are great when it comes to simplify implementations, but if we have anything but |
Totally agree with @ktf. |
@davidrohr ok, sorry, missed the authorship, it comes from P.Christiansen. Incidentally, originally it was guarded by @dberzano: fine, in the dictionary creation the header can be guarded, but my problem was not the dictionary: it was macro compilation from the root, were we don't have cmake-managed include paths. |
PR AliceO2Group/AliceO2#1364 solves this particular problem. |
Hi,
I can bypass this problem with some dirty tricks, but I find principally wrong than I cannot use e.g. |
again, In my opinion boost is quite basic and we should make it available to ROOT by default, in particular to avoid difference between system-boost and alidist-boost setups, and because these issues pop up in macros so they are not caught by the CI. |
@davidrohr agree, and related to this (AliceO2Group/AliceO2#1351): I don't see why we need to test macros in the interpreted mode, in this way we check only the dictionaries. I think the macros should be always in compiled mode. |
Hi @dberzano @ktf
Also the aliBuild-installed boost needs to be added to the ROOT_INCLUDE_PATH
to have the macros compilable. Otherwise we get e.g.: