Unable to link against installed GRASS libraries #2463
-
Using pybind11, I'm trying to interface with a modified package.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN16mm_register_initD1Ev Inspecting the $ nm -D package.cpython-39-x86_64-linux-gnu.so| grep mm_register_init
U _ZN16mm_register_initC1Ev
U _ZN16mm_register_initD1Ev With Checking if any ldconfig -p | grep -o "/opt/grass/.*" | xargs nm -D | grep mm_register_init
# and
fd "libgrass" / -e so | xargs nm -D | grep mm_register_init Calling The only solution I can see is adding the source code as a submodule and statically linking every required function which is not what I'd like to do. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
GRASS modules are functional within a GRASS work session. When you launch GRASS, it is setting up environment variables including adding GRASS .so files to LD search path. GRASS code base has certain assumptions on the environment when it runs thus if you are trying to bypass startup mechanism, its on to you to ensure sanity of the environment. TL;DR: start your python interpreter from a GRASS session. |
Beta Was this translation helpful? Give feedback.
GRASS modules are functional within a GRASS work session. When you launch GRASS, it is setting up environment variables including adding GRASS .so files to LD search path. GRASS code base has certain assumptions on the environment when it runs thus if you are trying to bypass startup mechanism, its on to you to ensure sanity of the environment.
TL;DR: start your python interpreter from a GRASS session.