computationalgeography / lue

LUE Scientific Database and Environmental Modelling Framework
https://lue.computationalgeography.org
MIT License
12 stars 4 forks source link

Conditionally warn about not setting `LD_PRELOAD` on Linux #681

Open kordejong opened 3 months ago

kordejong commented 3 months ago

Iff LUE is built with a custom allocator (it should), this allocator must be loaded before Python start executing. Example:

LD_PRELOAD=<prefix>/lib/libtcmalloc_minimal.so.4 python ./my_lue_script.py

There are probably other ways to preload a shared library but this is a typical way for a regular user to do it.

We can check (in LUE's main __init__.py) whether LD_PRELOAD contains the name of the allocator used to build LUE (tcmalloc in this case), and if not we can warn the user that the process may crash because of this.

Options: