-
Notifications
You must be signed in to change notification settings - Fork 121
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
Tensorstore C++ Integration: How to Avoid Driver Registry Conflict #191
Comments
Both Anyway, without looking at your package files, it seems likely that two versions of tensorstore are being built and linked into your project. There may be order problems with your CMake file. It would be nice to provide a self-contained repro to understand better what's going on. |
I have also tried with the newer tensorstore release (v1.63). Finally, explicitly modifying the symbol visibility in the CMake files (at the project level) seem to resolve the issue.
|
I may need to add something like that to our CMake generation. |
It appears that at least some tensorstore symbols have somehow ended up with global visibility across the two extension modules. Symbol visibility for Python extension modules is tricky. Normally you want all symbols defined by the extension module to be private. Python in fact loads extension modules with RTLD_LOCAL by default, which means that symbols should be private. Separately, you can build with -fvisibility=hidden for better performance and to ensure symbols are private even if loaded with RTLD_GLOBAL. The tensorstore python package that we provide is built this way. You may want to still figure out why the global symbol visibility issue came up in the first place. Is tensorstore statically linked into your C extension module or is there an intermediate dynamic library by any chance? |
I think that this is during the C++ build. There could be two versions of tensorstore included in the build, and/or there a difference between the equivalent bazel build flags and the cmake build flags and/or bazel_to_cmake failed to generate the linker script here? |
Is there a github repository or some other reproducing example you can provide where this happens? |
We have two Python packages (bfiocpp and argolid) where we use the C++ API and follow the CMake integration instruction given in the documentation.
Both of the packages individually work without any issue. However, we noticed that when both the packages are present in the same environment, if we try to import both of them, we get the following error:
I am using
v0.1.60
. I would appreciate if you can shed some light on why such driver registry works on global level instead of per-package level.The text was updated successfully, but these errors were encountered: