Issues related to TFile inclusion

Dear All,

At ATLAS Open Data, we have a code that works fine in versions of ROOT 6.18, but when using on versions of ROOT over 6.20, I have issues that seem to be related to TFile.

I tested the code in several places and ROOT installation, including SWAN.
The code has the form like:

It is like the file is not created:

Writing with name option: dataA 
SysError in <TFile::TFile>: file /home/jovyan/notebooks-collection-opendata/13-TeV-examples/python/atlas-demo-Hyy/atlas-outreach-cpp-framework-13tev/Analysis/HWWAnalysis/Output_HWWAnalysis/dataA.root can not be opened No such file or directory
Error in <TROOT::WriteTObject>: The current directory (Rint) is not associated with a file. The object (hist_etmiss) has not been written.
Error in <TROOT::WriteTObject>: The current directory (Rint) is not associated with a file. The object (hist_mLL) has not been written.
Error in <TROOT::WriteTObject>: The current directory (Rint) is not associated with a file. The object (hist_ptLL) has not been written

So, my very simple question (after looking on the internet) is there a new/different way to include TFile to match current versions of ROOT?

Thanks!
Arturo

Make sure that this directory exists and is writable (by you):
ls -al /home/jovyan/notebooks-collection-opendata/13-TeV-examples/python/atlas-demo-Hyy/atlas-outreach-cpp-framework-13tev/Analysis/HWWAnalysis/Output_HWWAnalysis/

Thanks, @Wile_E_Coyote !
That was a silly one. I got the wrong permissions for that folder. So now, it is saving the files.

Now, and excuses for continue using this issue, but, originally, my problem started when I got this error:


starting ROOT
Info in <TUnixSystem::ACLiC>: creating shared library /home/jovyan/13-TeV-examples/python/atlas-demo-Hyy/atlas-outreach-cpp-framework-13tev/Analysis/HyyAnalysis/./main_HyyAnalysis_C.so

In file included from input_line_9:6:
In file included from ././main_HyyAnalysis.C:5:
In file included from /srv/conda/envs/notebook/include/TFile.h:38:
In file included from /srv/conda/envs/notebook/include/ROOT/TRWSpinLock.hxx:19:
In file included from /srv/conda/envs/notebook/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/include/c++/9.3.0/condition_variable:38:
In file included from /srv/conda/envs/notebook/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/include/c++/9.3.0/chrono:41:
/srv/conda/envs/notebook/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/include/c++/9.3.0/ctime:80:11: error: no member named 'timespec_get' in the global namespace
  using ::timespec_get;
        ~~^
Error in <ACLiC>: Executing '/srv/conda/envs/notebook/bin/rootcling -v0 "--lib-list-prefix=/home/jovyan/13-TeV-examples/python/atlas-demo-Hyy/atlas-outreach-cpp-framework-13tev/Analysis/HyyAnalysis/main_HyyAnalysis_C_ACLiC_map" -f "/home/jovyan/13-TeV-examples/python/atlas-demo-Hyy/atlas-outreach-cpp-framework-13tev/Analysis/HyyAnalysis/main_HyyAnalysis_C_ACLiC_dict.cxx" -I$ROOTSYS/include -I"/srv/conda/envs/notebook/etc/" -I"/srv/conda/envs/notebook/etc//cling" -I"/srv/conda/envs/notebook/include/" -I"/srv/conda/envs/notebook/include" -D__ACLIC__  "/home/jovyan/13-TeV-examples/python/atlas-demo-Hyy/atlas-outreach-cpp-framework-13tev/Analysis/HyyAnalysis/./main_HyyAnalysis.C" "/home/jovyan/13-TeV-examples/python/atlas-demo-Hyy/atlas-outreach-cpp-framework-13tev/Analysis/HyyAnalysis/main_HyyAnalysis_C_ACLiC_linkdef.h"' failed!
input_line_9:2:3: error: use of undeclared identifier 'main_HyyAnalysis'
 (main_HyyAnalysis(0, 0))
  ^
Error in <HandleInterpreterException>: Error evaluating expression (main_HyyAnalysis(0, 0)).
Execution of your code was aborted.
end of ROOT execution

And, again, looking around, it seems that something is missing in the ROOT installation (6.24.0), but this is a jupyterhub hosted at CERN (not by me) so, I cannot make changes in the configuration.

Is this assumption more and less correct? or should I be looking into other things?

Thanks again,
Arturo

ROOT Forum → Search → “timespec_get”

Hi Arturo,
that’s a problem with conda-forge (not even strictly related to ROOT), see

For some users, conda upgrade -c conda-forge --all seems to help.

I am afraid I don’t have a solution for now, but it seems the problem is only present for certain host platforms.

Cheers,
Enrico

Hi @eguiraud , @Wile_E_Coyote ,

Thanks again for the time and help.

My issue is straightforward, in fact:

  • I need to run my binder with ROOT installed. But after some requirements, the issue appears.

I looked into ROOT examples of containers running in MyBinder, but they don’t really work.

I used to have one running for the ATLAS Open Data project, but now it is too old and does not compile in MyBinder anymore.

So, I keep looking for an example that works :slight_smile: but, if you have it, please, it will be awesome to take a look.

Thanks again!
Arturo

Hi Arturo,
as you can see from the links I shared it’s not really a ROOT issue, it’s a general (and recent) issue with conda-forge and C++.

You can check if this works for you as a starting point: https://github.com/root-project/training/tree/dev/SoftwareCarpentry (note that the link points to the dev branch and the SoftwareCarpentry subdirectory) : there is a binder badge there that seems to do the job.

Cheers,
Enrico

EDIT: the dev branch was merged, the correct link is now training/SoftwareCarpentry at master · root-project/training · GitHub

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.