Skip to content

Commit

Permalink
Fix building source distribution without pybind11
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquev6 committed Jun 12, 2024
1 parent 9a141b6 commit 04b7379
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,15 @@ def make_liblincs_extension():
else:
print("WARNING: 'chrones' was not found, lincs will be compiled without Chrones", file=sys.stderr)

pybind11_dirs = [
option[2:]
for option in subprocess.run(
[sys.executable, "-m", "pybind11", "--includes"], capture_output=True, universal_newlines=True, check=True,
).stdout.strip().split(" ")
]
include_dirs += pybind11_dirs
try:
include_dirs += [
option[2:]
for option in subprocess.run(
[sys.executable, "-m", "pybind11", "--includes"], capture_output=True, universal_newlines=True, check=True,
).stdout.strip().split(" ")
]
except subprocess.CalledProcessError:
print("WARNING: 'pybind11' was not found, build will fail", file=sys.stderr)

if sys.platform == "linux":
extra_compile_args["c++"] = ["-std=c++17", "-Werror=switch", "-fopenmp"]
Expand Down

0 comments on commit 04b7379

Please sign in to comment.