CesiumGS / cesium-omniverse

Bringing the 3D geospatial ecosystem to Omniverse
https://cesium.com/platform/cesium-for-omniverse/
Apache License 2.0
58 stars 7 forks source link

Error loading .pyd as static library when built in debug mode #33

Closed lilleyse closed 2 years ago

lilleyse commented 2 years ago

When building a static debug library on Linux we see the following error in Omniverse Code:

2022-11-02 19:57:34  [Error] [omni.ext.python] ImportError: /home/slilley/Code/cesium-omniverse/cesium-kit-exts/exts/cesium.omniverse/cesium/omniverse/bindings/cesium/omniverse/CesiumOmniversePythonBindings.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN14CesiumGeometry3RayC1ERKN3glm3vecILm3EdLNS1_9qualifierE0EEES6_

pybind11 might be the culprit because if we build cesium-omniverse as a shared library the problem goes away. Likely related to https://github.com/CesiumGS/cesium-omniverse/issues/32. Another related issues is that shared libraries aren't installed correctly, CC https://github.com/CesiumGS/cesium-omniverse/issues/30.

lilleyse commented 2 years ago

Same problem on Windows. Except that I can't get static or shared libraries to work for Debug builds.

2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer] Failed to import python module cesium.omniverse. Error: DLL load failed: A dynamic link library (DLL) initialization routine failed.. Traceback:
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer] Traceback (most recent call last):
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "c:/users/slilley/appdata/local/ov/pkg/code-2022.2.0/kit/plugins/bindings-python\omni\ext\impl\custom_importer.py", line 76, in import_module
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]     return importlib.import_module(name)
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "c:\users\slilley\appdata\local\ov\pkg\code-2022.2.0\kit\python\lib\importlib\__init__.py", line 127, in import_module
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]     return _bootstrap._gcd_import(name[level:], package, level)
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap_external>", line 728, in exec_module
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "c:\users\slilley\code\cesium-omniverse\cesium-kit-exts\exts\cesium.omniverse\cesium\omniverse\__init__.py", line 1, in <module>
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]     from .extension import *
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "c:\users\slilley\code\cesium-omniverse\cesium-kit-exts\exts\cesium.omniverse\cesium\omniverse\extension.py", line 1, in <module>
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]     from .window import CesiumOmniverseWindow
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]   File "c:\users\slilley\code\cesium-omniverse\cesium-kit-exts\exts\cesium.omniverse\cesium\omniverse\window.py", line 1, in <module>
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer]     from .bindings.cesium.omniverse import CesiumOmniversePythonBindings as CesiumOmniverse
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer] ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
2022-11-03 20:16:51  [Error] [omni.ext.impl.custom_importer] 
2022-11-03 20:16:51  [Error] [carb.scripting-python.plugin] Exception: Extension python module: 'cesium.omniverse' in 'c:\users\slilley\code\cesium-omniverse\cesium-kit-exts\exts\cesium.omniverse' failed to load.
2022-11-03 20:16:51  [Error] [carb.scripting-python.plugin] 
2022-11-03 20:16:51  [Error] [carb.scripting-python.plugin] At:
2022-11-03 20:16:51  [Error] [carb.scripting-python.plugin]   c:/users/slilley/appdata/local/ov/pkg/code-2022.2.0/kit/plugins/bindings-python\omni\ext\impl\_internal.py(177): startup
2022-11-03 20:16:51  [Error] [carb.scripting-python.plugin]   c:/users/slilley/appdata/local/ov/pkg/code-2022.2.0/kit/plugins/bindings-python\omni\ext\impl\_internal.py(268): startup_extension
2022-11-03 20:16:51  [Error] [carb.scripting-python.plugin]   PythonExtension.cpp::startup()(2): <module>
2022-11-03 20:16:51  [Error] [carb.scripting-python.plugin] 
2022-11-03 20:16:51  [Error] [omni.ext.plugin] [ext: cesium.omniverse-0.0.0] Failed to startup python extension.