Skip to content

Commit

Permalink
fix: prepare setup for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLapous committed Nov 26, 2024
1 parent 9a62afe commit 13fe8cf
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import shutil
import site

from pathlib import Path
import numpy as np
from Cython import Tempita
from Cython.Build import cythonize
Expand All @@ -15,7 +16,8 @@
Options.fast_fail = True
# Options.warning_errors = True

os.system("mkdir -p ./build/tmp")
os.system("mkdir ./build/")
os.system("mkdir ./build/tmp")


def was_modified(file):
Expand Down Expand Up @@ -121,9 +123,7 @@ def process_tempita(fromfile):

# When venv is not properly set, we have to add the current python path
# removes lib / python3.x / site-packages
PYTHON_ENV_PATH = "/".join((site.getsitepackages()[0]).split("/")[:-3])
INCLUDE_PATH = PYTHON_ENV_PATH + "/include/"
LIBRARY_PATH = PYTHON_ENV_PATH + "/lib/"
PYTHON_ENV_PATH = site.getsitepackages()[0] + "../../../"

cpp_dirs = [
"multipers/gudhi",
Expand All @@ -132,13 +132,24 @@ def process_tempita(fromfile):
"multipers/multi_parameter_rank_invariant",
"multipers/tensor",
np.get_include(),
INCLUDE_PATH,
PYTHON_ENV_PATH + "/include/", # Unix
PYTHON_ENV_PATH + "/Libary/include/", # Windows
]
cpp_dirs = [str(Path(stuff).expanduser().resolve()) for stuff in cpp_dirs]

library_dirs = [
LIBRARY_PATH,
PYTHON_ENV_PATH + "/lib/", # Unix
PYTHON_ENV_PATH + "/Library/lib/", # Windows
]

library_dirs = [str(Path(stuff).expanduser().resolve()) for stuff in library_dirs]

print("Include dirs:")
print(cpp_dirs)

print("Library dirs:")
print(library_dirs)

extensions = [
Extension(
f"multipers.{module}",
Expand Down

0 comments on commit 13fe8cf

Please sign in to comment.