Skip to content

Commit

Permalink
find libblosc2 independent of suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
bnavigator committed Feb 25, 2023
1 parent f3cd76e commit 13ad71f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tables/__init__.py
Expand Up @@ -8,20 +8,23 @@
"""
import os
from ctypes import cdll
from ctypes.util import find_library
import platform


# Load the blosc2 library, and if not found in standard locations,
# try this directory (it should be automatically copied in setup.py).
current_dir = os.path.dirname(__file__)
platform_system = platform.system()
blosc2_lib = "libblosc2"
if platform_system == "Linux":
blosc2_lib += ".so"
elif platform_system == "Darwin":
blosc2_lib += ".dylib"
else:
blosc2_lib += ".dll"
blosc2_lib = find_library("libblosc2")
if blosc2_lib is None:
current_dir = os.path.dirname(__file__)
platform_system = platform.system()
blosc2_lib = "libblosc2"
if platform_system == "Linux":
blosc2_lib += ".so"
elif platform_system == "Darwin":
blosc2_lib += ".dylib"
else:
blosc2_lib += ".dll"
try:
cdll.LoadLibrary(blosc2_lib)
except OSError:
Expand Down

0 comments on commit 13ad71f

Please sign in to comment.