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

Python bindings include absolute path to build directory. #457

Open
rndubs opened this issue May 22, 2024 · 1 comment
Open

Python bindings include absolute path to build directory. #457

rndubs opened this issue May 22, 2024 · 1 comment
Labels

Comments

@rndubs
Copy link

rndubs commented May 22, 2024

After generating python bindings, the exodus3.py module contains the following lines (lines 164-174 in version 1.21.1):

ACCESS = os.getenv('ACCESS', '/path/to/build/dir/seacas')  # <-- this line is the one in question
if os.uname()[0] == 'Darwin':
    EXODUS_SO = f"{ACCESS}/lib/libexodus.dylib"
else:
    EXODUS_SO = f"{ACCESS}/lib/libexodus.so"
pip_path = os.path.dirname(__file__)
pip_so_path = os.path.join(pip_path, "libexodus.so")
try:
    EXODUS_LIB = ctypes.cdll.LoadLibrary(pip_so_path)
except Exception:
    EXODUS_LIB = ctypes.cdll.LoadLibrary(EXODUS_SO)

The default path provided to os.getenv should likely be a relative path, or a path constructed from the current module's location, since installation from the wheel will likely rarely be in the build directory.

It is unclear if the ACCESS code path is needed in addition to the pip_path code path. Either way, the path as currently defined is not going to work for distribution of the wheel.

Additionally, the installed location in a venv is going to be </path to venv>/lib/python3.X/site-packages, so the EXODUS_SO paths are not going to point to the .so even when ACCESS points to the installation location instead of the build location.

@gsjaardema
Copy link
Member

@mvlopri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants