Skip to content

Python bindings include absolute path to build directory. #457

@rndubs

Description

@rndubs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions