Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init_pykmstest is called but undefined if utils option is not enabled #68

Open
cshaw-velo-ai opened this issue Dec 19, 2022 · 3 comments

Comments

@cshaw-velo-ai
Copy link

Hi, I'm building with python bindings turned on, but the utils option is turned off. This seems to lead to an undefined symbol in pykms.so:

>>> import pykms
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/pykms/__init__.py", line 1, in <module>
ImportError: /usr/lib/python3.10/site-packages/pykms/pykms.so: undefined symbol: _Z14init_pykmstestRN8pybind117module_E

Looking at the code, init_pykmstest is called no matter what:

init_pykmstest(m);

But the implementation of the function in pykmsutil.cpp is only included in the build if the tests option is enabled:

if get_option('utils')
pykms_sources += files([
'pykmsutil.cpp',
])
endif

@tomba tomba closed this as completed in 32b6f82 Dec 20, 2022
@tomba
Copy link
Owner

tomba commented Dec 20, 2022

Thanks. Can you try the master branch and see if it works for you now?

@cshaw-velo-ai
Copy link
Author

I think this could work, but I'm not sure if it's what you want? It seems a bit weird since there are two meson options (utils and libutils). libutils is responsible for defining HAS_KMSXXUTIL which is what causes pykms to try to call init_pykmsutils, but pykmsutil.cpp is only included based on the utils option. I think what you want is to change pykms/meson.build so that pykmsutil.cpp is included based on the libutils options instead of the utils option?

@tomba
Copy link
Owner

tomba commented Dec 22, 2022

Ah, I was hasty, and didn't notice that the current meson.build uses 'utils'. That's obviously wrong. I'll look at this again later. And I see #69, so I should perhaps split the py bindings to two separate py modules, the core (depends on kms++) and the rest (depends on kms++utils).

@tomba tomba reopened this Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants