-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[root6] Fix missing declarations in the code interpreted by Cling (#451)
This should have been a part of #448 as the changes are closely related but unfortunately that PR was merged before I had a chance to update it. A couple of issues seen in the ROOT6 CI tests are taken care of: 1. Include missing definitions when interpreting AgMLGeometry. Unlike `rootcint`, `rootcling` needs to see explicit definitions of the types used in an interpreted code. ``` LoadTable: .L /star-sw/StarDb/AgMLGeometry/Geometry.y2021a.C In file included from input_line_732:1: In file included from /star-sw/StarDb/AgMLGeometry/Geometry.y2021a.C:2: /star-sw/StarDb/AgMLGeometry/CreateGeometry.h:10:8: error: use of undeclared identifier 'gGeoManager' if ( gGeoManager ) { ^ ``` 2. StBFChain: Declare global pointer to `chain` in compiled code. It appears that the ROOT6 interpreter prefers to see the declaration of the main StBFChain in the compiled code over the one in the `bfc.C` macro. ``` LoadTable: .L /star-sw/StarDb/AgMLGeometry/Geometry.y2021a.C IncrementalExecutor::executeFunction: symbol 'chain' unresolved while linking [cling interface function]! root4star: .sl79_gcc485/OBJ/StRoot/St_db_Maker/St_db_Maker.cxx:934: virtual TDataSet* St_db_Maker::LoadTable(TDataSet*): Assertion `!ee' failed. ``` Could it be that global variables in interpreted code are not visible in other interpreted scripts? From the C++ point of view, the error actually makes sense because of the `extern StBFChain* chain;` statement in `StarDb/AgMLGeometry/CreateGeometry.h` As suggested during the review, local variables were renamed to avoid confusion with global name `chain`
- Loading branch information
Showing
3 changed files
with
35 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters