Skip to content

Commit

Permalink
added libmem lookup for python installation
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbo committed Jan 2, 2024
1 parent 11b21a7 commit b1609f3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from sys import platform
import pathlib
import os
import sysconfig

def get_version():
return "5.0.0-pre0"
Expand All @@ -14,7 +15,20 @@ def readme():
return content

def search_installed_libmem():
return True
libmem_libs = ["liblibmem.so", "liblibmem.a", "libmem.lib", "libmem.dll"]
lib_dirs = [sysconfig.get_config_var("LIBDIR")]

print(f"Library dirs: {lib_dirs}")

for dir in lib_dirs:
for file in os.listdir(dir):
if file in libmem_libs:
print(f"Found installed libmem: {dir}{os.sep}{file}")
return True

print("Unable to find installed libmem")

return False

def platform_libs():
libs = []
Expand All @@ -35,7 +49,7 @@ def get_sources(src_dir):
for file in os.listdir(src_dir):
if file.endswith(".c"):
sources.append(os.path.join(src_dir, file))
print(sources)
print(f"libmem-py sources: {sources}")
return sources

libmem_py = Extension(
Expand Down

0 comments on commit b1609f3

Please sign in to comment.