# Load Delphes library to ROOT

**URL:** <https://root-forum.cern.ch/t/load-delphes-library-to-root/36795>\
**Category:** Newbie\
**Created:** [November 13, 2019, 5:41am UTC](https://root-forum.cern.ch/t/load-delphes-library-to-root/36795 "2019-11-13T05:41:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgummulu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/6de8d8/32.png) [@pgummulu](https://root-forum.cern.ch/u/pgummulu)\
**Post date:** [November 13, 2019, 5:41am UTC](https://root-forum.cern.ch/t/load-delphes-library-to-root/36795/1 "2019-11-13T05:41:29Z")

</div>

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

```auto
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!

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [November 13, 2019, 7:07am UTC](https://root-forum.cern.ch/t/load-delphes-library-to-root/36795/2 "2019-11-13T07:07:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pgummulu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/6de8d8/32.png) [@pgummulu](https://root-forum.cern.ch/u/pgummulu)\
**Post date:** [November 14, 2019, 3:48am UTC](https://root-forum.cern.ch/t/load-delphes-library-to-root/36795/3 "2019-11-14T03:48:16Z")

</div>

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")`

```auto
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.

```auto
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.

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [November 14, 2019, 9:14am UTC](https://root-forum.cern.ch/t/load-delphes-library-to-root/36795/4 "2019-11-14T09:14:07Z")

</div>

Hi,

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![pgummulu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/6de8d8/32.png) [@pgummulu](https://root-forum.cern.ch/u/pgummulu)\
**Post date:** [November 15, 2019, 4:48am UTC](https://root-forum.cern.ch/t/load-delphes-library-to-root/36795/5 "2019-11-15T04:48:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pgummulu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/6de8d8/32.png) [@pgummulu](https://root-forum.cern.ch/u/pgummulu)\
**Post date:** [November 15, 2019, 5:54am UTC](https://root-forum.cern.ch/t/load-delphes-library-to-root/36795/6 "2019-11-15T05:54:19Z")

</div>

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
