-
Notifications
You must be signed in to change notification settings - Fork 68
Fix use of deleted assignment operator for gDirectory under ROOT 6.24 in StFwdTrackMaker #757
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
Conversation
Replaced `gDirectory = prevDir` with `prevDir->cd()` to avoid compilation error with ROOT 6.24
```
.sl73_x8664_gcc485/OBJ/StRoot/StFwdTrackMaker/StFwdQAMaker.cxx: In member function 'virtual int StFwdQAMaker::Finish()':
.sl73_x8664_gcc485/OBJ/StRoot/StFwdTrackMaker/StFwdQAMaker.cxx:196:20: error: use of deleted function 'ROOT::Internal::TDirectoryAtomicAdapter& ROOT::Internal::TDirectoryAtomicAdapter::operator=(const ROOT::Internal::TDirectoryAtomicAdapter&)'
gDirectory = prevDir;
^
In file included from /cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/root-6.24.06-ojgeqx4c6cazamrg2mltgfm3wpivwzyf/include/TDirectoryFile.h:25:0,
from /cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/root-6.24.06-ojgeqx4c6cazamrg2mltgfm3wpivwzyf/include/TFile.h:28,
from StRoot/StChain/StMaker.h:20,
from StRoot/StFwdTrackMaker/StFwdQAMaker.h:11,
from .sl73_x8664_gcc485/OBJ/StRoot/StFwdTrackMaker/StFwdQAMaker.cxx:1:
/cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/root-6.24.06-ojgeqx4c6cazamrg2mltgfm3wpivwzyf/include/TDirectory.h:247:11: note: 'ROOT::Internal::TDirectoryAtomicAdapter& ROOT::Internal::TDirectoryAtomicAdapter::operator=(const ROOT::Internal::TDirectoryAtomicAdapter&)' is implicitly deleted because the default definition would be ill-formed:
struct TDirectoryAtomicAdapter {
^
/cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/root-6.24.06-ojgeqx4c6cazamrg2mltgfm3wpivwzyf/include/TDirectory.h:247:11: error: non-static reference member 'std::atomic<TDirectory*>& ROOT::Internal::TDirectoryAtomicAdapter::fValue', can't use default assignment operator
cons: *** [.sl73_x8664_gcc485/OBJ/StRoot/StFwdTrackMaker/StFwdQAMaker.o] Error 1
cons: errors constructing .sl73_x8664_gcc485/OBJ/StRoot/StFwdTrackMaker/StFwdQAMaker.o
```
genevb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no objection to the proposed changes. But perhaps best also to replace the two lines...
auto prevDir = gDirectory;
...at StFwdQAMaker.cxx line 185, and StFwdAnalysisMaker.cxx line 31 with this thread-safe code...
auto prevDir = TDirectory::CurrentDirectory();
-Gene
|
Sure, why not. Functionally it looks like the same thing. |
klendathu2k
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a compilation error in ROOT 6.24 where the assignment operator for gDirectory has been deleted. The fix replaces direct assignment to gDirectory with appropriate ROOT API calls to change directories.
Key changes:
- Replace
gDirectoryassignment withTDirectory::CurrentDirectory()andcd()method calls - Ensure compatibility with ROOT 6.24 while maintaining the same directory management functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| StRoot/StFwdUtils/StFwdAnalysisMaker.cxx | Updated directory handling to use ROOT 6.24 compatible API calls |
| StRoot/StFwdTrackMaker/StFwdQAMaker.cxx | Updated directory handling to use ROOT 6.24 compatible API calls |
|
@jdbrice : ping |
|
Any more updates/follow-ups? Can we close & merge? |
Nothing from my side. We can merge if the primary maintainer remains unresponsive |
Same from my side. Last time I spoke with @jdbrice , I told him this was pretty straightforward for him to approve. |
Just correcting my typo to get it correctly documented here: we agreed yesterday that "SL25y" is the tag we will use for the descendent of SL24y, and which @plexoos yesterday tagged as SL24y_3. Sorry for the noise. |
|
Yes, let’s merge it, and I’ll tag it however you’d like. |
|
Created the following refs: SL25y, SL25b, and SL25b_0 (= SL25b). Please use them when cloning or updating your git repository. |
Replaced
gDirectory = prevDirwithprevDir->cd()to avoid compilation error with ROOT 6.24