I have code that embeds Python. That embedded Python uses NumPy and hence, I need to explicitly load libpython, to make NumPy work.
The driving code is in C++ (tests in Google Test). There is a bug somewhere, and I try to use gdb for debugging. However, something strange happens as embedded versions are different, when I simply run the executable and when I run the executable under gdb.
I find the path to libpython by instantiating sysconfig module under the initialized embedded Python and then using sysconfig.get_config_var("LIBDIR").
I log the found path to the libpython hen I simply run the executable:
Path to libpython is /home/dima/.conda/envs/um02-open-interfaces/lib
When I run the same executable under gdb:
Path to libpython is /home/linuxbrew/.linuxbrew/opt/[email protected]/lib
How to stop gdb from changing environment?