Skip to content

Commit

Permalink
Use autoreconf to generate configure script
Browse files Browse the repository at this point in the history
* Avoid the assumptions built into autogen.sh.
  • Loading branch information
matthewfeickert committed Aug 14, 2024
1 parent 21ebb21 commit e5cafbb
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,32 @@ def build_extensions(self):
env["LDFLAGS"] = env.get("LDFLAGS", "") + f" -Wl,-rpath,{_rpath}"
env["ORIGIN"] = "$ORIGIN" # if evaluated, it will still be '$ORIGIN'

# Use autoreconf to generate configure script to avoid
# assumptions in autogen.sh
# c.f. https://github.com/scikit-hep/fastjet/issues/300
_SISCONE_DIR = FASTJET / "plugins" / "SISCone" / "siscone"
try:
subprocess.run(
["autoreconf", "-i"],
cwd=_SISCONE_DIR,
env=env,
check=True,
)
except Exception:
print(f"ERROR: 'autoreconf -i' in directory {_SISCONE_DIR} failed")
raise

try:
subprocess.run(
["autoreconf", "-i"],
cwd=FASTJET,
env=env,
check=True,
)
except Exception:
print(f"ERROR: 'autoreconf -i' in directory {FASTJET} failed")
raise

args = [
f"--prefix={OUTPUT}",
"--enable-thread-safety",
Expand All @@ -83,7 +109,7 @@ def build_extensions(self):

try:
subprocess.run(
["./autogen.sh"] + args,
["./configure"] + args,
cwd=FASTJET,
env=env,
check=True,
Expand Down

0 comments on commit e5cafbb

Please sign in to comment.