Skip to content

Commit

Permalink
Update __init__.py.in (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmadsen authored Jun 1, 2021
1 parent 736a2ee commit 45f6e89
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions kokkos/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ version = sys.modules[__name__].__getattribute__("version")

def _load_kokkos_libs():
"""Loads the kokkos shared libraries (generally only needed on macOS)"""
relative_lib_path = "@LIB_RELPATH@"
relative_lib_path = ("@LIB_RELPATH@", "../../..")
ext = None

import ctypes
Expand All @@ -107,8 +107,11 @@ def _load_kokkos_libs():
def _load(name):
# get the path to this directory
this_path = os.path.abspath(os.path.dirname(__file__))
p = os.path.realpath(os.path.join(this_path, relative_lib_path, name))
return ctypes.CDLL(p)
for itr in relative_lib_path:
p = os.path.realpath(os.path.join(this_path, itr, name))
if os.path.exists(p):
return ctypes.CDLL(p)
return ctypes.CDLL(name)

for itr in ("core", "containers"):
try:
Expand Down

0 comments on commit 45f6e89

Please sign in to comment.