Load Delphes library to ROOT

Hi,
I am pretty new to using ROOT. I have generated a root file from Delphes output. In root I am typing gSystem->Load("libDelphes.so"),
It is succesfully loaded when I launch root from within Delphes library.
However if I launch root from any other directory or from python
I get the following error

libDelphes.so does not exist in /home/sameer/root-6.18.04/builddir/lib:/home/sameer/root-6.18.04/builddir/lib:.:/home/sameer/root-6.18.04/builddir/lib:/lib/x86_64-linux-gnu/tls/haswell/x86_64:/lib/x86_64-linux-gnu/tls/haswell:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/haswell/x86_64:/lib/x86_64-linux-gnu/haswell:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64:/usr/lib/x86_64-linux-gnu/tls/haswell:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/haswell/x86_64:/usr/lib/x86_64-linux-gnu/haswell:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/tls/haswell/x86_64:/lib/tls/haswell:/lib/tls/x86_64:/lib/tls:/lib/haswell/x86_64:/lib/haswell:/lib/x86_64:/lib:/usr/lib/tls/haswell/x86_64:/usr/lib/tls/haswell:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/haswell/x86_64:/usr/lib/haswell:/usr/lib/x86_64:/usr/lib

Please help!

Try: gSystem->Load("/full/path/to/your/libDelphes.so"),

Thank you very much for the response.
I have tried that. It worked and was able to detect Electron, Muon etc. However I did see some errors when I did gSystem->Load("/full/path/to/your/libDelphes.so")

Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTreeReader.h
   requested to autoload type ExRootTreeReader
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTreeWriter.h
   requested to autoload type ExRootTreeWriter
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTreeBranch.h
   requested to autoload type ExRootTreeBranch
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootResult.h
   requested to autoload type ExRootResult
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootClassifier.h
   requested to autoload type ExRootClassifier
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootFilter.h
   requested to autoload type ExRootFilter
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootProgressBar.h
   requested to autoload type ExRootProgressBar
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
   requested to autoload type ExRootConfParam
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
   requested to autoload type ExRootConfReader
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTask.h
   requested to autoload type ExRootTask
  1. How do we overcome these errors?
  2. If I try doing the following in python, the method does not work.
import ROOT
ROOT.gSystem.Load("libDelphes.so")

(I tried with the full path too. It does not work in even that case)

I get the following errors.

libDelphes.so does not exist in /home/sameer:/home/sameer/root-6.18.04/builddir/lib:.:/home/sameer/root-6.18.04/builddir/lib:/lib/x86_64-linux-gnu/tls/haswell/x86_64:/lib/x86_64-linux-gnu/tls/haswell:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/haswell/x86_64:/lib/x86_64-linux-gnu/haswell:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64:/usr/lib/x86_64-linux-gnu/tls/haswell:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/haswell/x86_64:/usr/lib/x86_64-linux-gnu/haswell:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/tls/haswell/x86_64:/lib/tls/haswell:/lib/tls/x86_64:/lib/tls:/lib/haswell/x86_64:/lib/haswell:/lib/x86_64:/lib:/usr/lib/tls/haswell/x86_64:/usr/lib/tls/haswell:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/haswell/x86_64:/usr/lib/haswell:/usr/lib/x86_64:/usr/lib
TClass::Init:0: RuntimeWarning: no dictionary for class LHEFEvent is available

Hi,

Try the following, works for both ROOT and python (this assumes /full/path/to/your/libDelphes.so):

export LD_LIBRARY_PATH=/full/path/to/your:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/full/path/to/your/../include

That assumes that the Delphes headers can be found at /full/path/to/your/../include, otherwse please adjust that path.

Once you did this in your shell you can run ROOT or python. Note that the latter (ROOT_INCLUDE_PATH) is going to be fixed by ROOT v6.20!

Cheers, Axel.

Thank you very much. I have added both these environment variables like this
export LD_LIBRARY_PATH=/home/sameer/Desktop/tools/MG5_aMC_v2_6_7/Delphes:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/home/sameer/Desktop/tools/MG5_aMC_v2_6_7/Delphes/external/
(This folder contatins the ExrootAnalysis folder the below error states t can’t be found)

export ROOT_INCLUDE_PATH=/home/sameer/Desktop/tools/MG5_aMC_v2_6_7/Delphes/classes/:$ROOT_INCLUDE_PATH

That solved most issues. However in python, the issue is only partially fixed. ‘libDelphes.so’ is loaded perfectly. However I still get the following error

ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
LC_ALL=C x86_64-linux-gnu-g+±8 -O3 -DNDEBUG -xc++ -E -v /dev/null 2>&1 >/dev/null | awk ‘/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}’ | GREP_OPTIONS= grep -E “(c|g)++”
Results was:
With exit code 256
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootTreeReader.h
requested to autoload type ExRootTreeReader
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootTreeWriter.h
requested to autoload type ExRootTreeWriter
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootTreeBranch.h
requested to autoload type ExRootTreeBranch
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootResult.h
requested to autoload type ExRootResult
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootClassifier.h
requested to autoload type ExRootClassifier
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootFilter.h
requested to autoload type ExRootFilter
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootProgressBar.h
requested to autoload type ExRootProgressBar
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
requested to autoload type ExRootConfParam
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
requested to autoload type ExRootConfReader
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootTask.h
requested to autoload type ExRootTask

I got it fixed by setting export PYTHONPATH=$PYTHONPATH:$ROOT_INCLUDE_PATH

Thank you all for the help. Please let me know if there is a better solution for this