I am trying to use cubit on an Ubuntu docker and when I try to import cubit in python, I am seeing the below error:
cubit_path = /opt/Coreform-Cubit-2023.8/bin
Traceback (most recent call last):
File “/usr/bin/VFConformalMesher”, line 29, in
import cubit
File “/opt/Coreform-Cubit-2023.8/bin/cubit.py”, line 41, in
from cubit3 import *
File “/opt/Coreform-Cubit-2023.8/bin/cubit3.py”, line 12, in
import _cubit3
ImportError: /opt/Coreform-Cubit-2023.8/bin/acis/code/bin/libExperienceKernel.so: undefined symbol: CAT_inflateReset
Can you please advise what to do to get this fixed?
Yes, that’s already added. The code has been tested and in production working on RedHat system as well as in Windows but using older versions of the cubit software. It’s only recently that I am trying to publish our software packages on a docker system that it is not working on this Ubuntu docker. Clearly the error is not because it does not know where cubit python package is located but rather an internal dependency of the cubit package relying on libExperienceKernel.so “undefined symbol: CAT_inflateReset”
Do you have LD_LIBRARY_PATH set? libExperienceKernel.so should be picking up the symbols it needs from the same directory it’s in, bin/acis/code/bin. It has the rpath $ORIGIN set, so it should be picking up its libraries from the same directory, but LD_LIBRARY_PATH changes where libraries look to load their symbols from.
Something else to check is if you can run Cubit inside the docker container normally. Use docker exec to get a shell in the container, then run coreform_cubit -nog -prompt Cubit. That should get you a Cubit terminal in the docker container. If that works, we know it’s a problem with the Python import. Are you using Cubit’s bundled Python or a system version?
I tried above and asked to accept license agreement but then failed due to no license error.
So my next question is: I actually have not tried to activate the cubit software yet. We already have a perpetual float license. I am curious as to how do we set the server address and port from the command line since this is a headless (no GUI) docker ubuntu. Is there a file I could edit and set the float license?
So after setting up the license file I am actually able to get cubit prompt to work. But I am still receiving the exact same error:
Traceback (most recent call last):
File “/usr/bin/VFConformalMesher”, line 29, in
import cubit
File “/opt/Coreform-Cubit-2023.8/bin/cubit.py”, line 41, in
from cubit3 import *
File “/opt/Coreform-Cubit-2023.8/bin/cubit3.py”, line 12, in
import _cubit3
ImportError: /opt/Coreform-Cubit-2023.8/bin/acis/code/bin/libExperienceKernel.so: undefined symbol: CAT_inflateReset
I also added this path /opt/Coreform-Cubit-2023.8/bin/acis/code/bin to LD_LIBRARY_PATH and exported it nothing changed same error.
You get the same error when importing into Python or when running the Cubit prompt?
Are you using the Python version that’s bundled with Cubit in bin/python3?
I am inclined to think it’s just the way it was compiled with wrapper cython for this version. It is clear that it already knows where the *.so shared library is located indicating the absolute path of the libary. I had no issue before running my code on RedHat using older versions. I am trying to use an older version of cubit the version 2021.10. I’ll let you know if the problem persists with this version as well.
bundled python3 imports cubit no issue with version 2021.10. It’s clearly an issue in the latest release and has nothing with setting up paths. Hope you guys can get the latest version fixed. Thanks.