Skip to content

bfc.C: fix for cling#278

Merged
plexoos merged 2 commits intostar-bnl:mainfrom
veprbl:pr/bfc_cling_fix
May 27, 2022
Merged

bfc.C: fix for cling#278
plexoos merged 2 commits intostar-bnl:mainfrom
veprbl:pr/bfc_cling_fix

Conversation

@veprbl
Copy link
Copy Markdown
Member

@veprbl veprbl commented Jan 10, 2022

cling needs to have libraries loaded before running a macro.

This disables the #include statements when ACLiC is not
used. Currently, cling can't parse those headers: there seems to be an
issue with how forward declarations interract with
$clingAutoload$. Fortunately, the #pragma load takes care of the
headers, like in ROOT5, so things just work.

@veprbl veprbl added the ROOT6 Issues and changes related to transition from ROOT5 to ROOT6 label Jan 10, 2022
Copy link
Copy Markdown
Contributor

@genevb genevb left a comment

Choose a reason for hiding this comment

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

Hi, @veprbl . I understood @perevbnlgov was working on the transition of macros for ROOT6. Did this get discussed with him?

Thanks,
-Gene

@veprbl veprbl mentioned this pull request Jan 16, 2022
@veprbl
Copy link
Copy Markdown
Member Author

veprbl commented Jan 16, 2022

Hi, @veprbl . I understood @perevbnlgov was working on the transition of macros for ROOT6. Did this get discussed with him?

Thanks, -Gene

I am only aware of what's discussed in threads https://github.com/star-bnl/star-sw/pulls?q=author%3Aperevbnlgov+ . There was no private discussion. If discussion is needed, it can happen here, I suppose.

Copy link
Copy Markdown
Contributor

@klendathu2k klendathu2k left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread StRoot/macros/bfc.C
class StMessMgr;
#if !defined(__CINT__) || defined(__MAKECINT__)

#pragma cling load("StUtilities")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So... I did a search for documentation on this feature of cling... and only was able to find the load pragma in their github repo under tests...

https://github.com/root-project/cling

Regardless,... this appears to solve the problem, enabling the necessary libraries to be preloaded. I think you could also achieve this by loading libraries in the standard rootlogon.C. But this would be more general (and allows individual users to implement their own root logons).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, rootlogon.C, might be possible, but, if it can work without the "secret sauce", I prefer that)

cling needs to have libraries loaded before running a macro.

This disables the #include statements when ACLiC is not
used. Currently, cling can't parse those headers: there seems to be an
issue with how forward declarations interract with
"$clingAutoload$". Fortunately, the "#pragma load" takes care of the
headers, like in ROOT5, so things just work.
When tested on 6.24/06 the libraries seem to be loaded
automagically. On CI we use 6.16, and that seems to not work. Or it
could be that it uses RTLD_NOW. Let's try to add missing libraries
manually.
@plexoos
Copy link
Copy Markdown
Member

plexoos commented May 26, 2022

Last call for comments?

@plexoos plexoos merged commit 5dc2080 into star-bnl:main May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ROOT6 Issues and changes related to transition from ROOT5 to ROOT6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants