# Load Library bug or quirk

**URL:** <https://root-forum.cern.ch/t/load-library-bug-or-quirk/38900>\
**Category:** ROOT\
**Created:** [April 15, 2020, 3:39pm UTC](https://root-forum.cern.ch/t/load-library-bug-or-quirk/38900 "2020-04-15T15:39:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [April 15, 2020, 4:53pm UTC](https://root-forum.cern.ch/t/load-library-bug-or-quirk/38900/2 "2020-04-15T16:53:24Z")

</div>

@Axel For me, it’s a bug.

The problem is that ROOT “prepends” its own “`root-config --libdir`” to the list of searched directories from the “`LD_LIBRARY_PATH`” (and then appends the “`.`” directory).  
You can easily see it, just try: `gSystem->Load("NonExistent");`

I would really prefer to have “`.:${LD_LIBRARY_PATH}:/anything:/else:/useful`” (where “`LD_LIBRARY_PATH`” is exactly what the user provided, without ANY modifications).

This is actually a bug in the “root” executable, which internally modifies its own “`LD_LIBRARY_PATH`” value:  
`std::cout << gSystem->ExpandPathName("${LD_LIBRARY_PATH}") << std::endl;`

For the time being, this does NOT happen if you use the “root.exe” executable, though. So, running “root.exe” (instead of “root”) is a possible brutal fix.

You can also try to apply another brutal fix (in your “`rootlogon.C`” file):  
`gSystem->SetDynamicPath(TString::Format("/my/preferred/path:%s", gSystem->GetDynamicPath()));`

BTW. [You should NEVER install ROOT into “standard” system directories.](https://root-forum.cern.ch/t/missing-canvas/17664/17)

---

_[View the full topic](https://root-forum.cern.ch/t/load-library-bug-or-quirk/38900)._
