Skip to content

Commit

Permalink
fix: Use environment CXX to configure fastjet-contrib .Makefile.inc
Browse files Browse the repository at this point in the history
* fastjet-contrib's .Makefile.inc is created at ./configure time, which means
  that if the environment's CXX is accessible inside of setup.py it can be passed
  as an argument to configure. Use this to set CXX for fastjet-contrib/.Makefile.inc
  and use a default value of g++ if no environment value is set.
* As this supersedes the need for patching .Makefile.inc, which was being overwritten,
  remove that patch file and the .Makefile.inc patching step from setup.py.
  • Loading branch information
matthewfeickert committed Feb 17, 2024
1 parent 39e75be commit 74d0b68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
21 changes: 0 additions & 21 deletions patch_makefileinc.txt

This file was deleted.

9 changes: 2 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def build_extensions(self):
env = os.environ.copy()
env["PYTHON"] = sys.executable
env["PYTHON_INCLUDE"] = f'-I{sysconfig.get_path("include")}'
env["CXX"] = env.get("CXX", "g++")
env["CXXFLAGS"] = "-O3 -Bstatic -lgmp -Bdynamic -std=c++17"
env["ORIGIN"] = "$ORIGIN" # if evaluated, it will still be '$ORIGIN'

Expand Down Expand Up @@ -101,17 +102,11 @@ def build_extensions(self):
subprocess.run(["make", "-j"], cwd=FASTJET, env=env, check=True)
subprocess.run(["make", "install"], cwd=FASTJET, env=env, check=True)

subprocess.run(
["patch", "./.Makefile.inc", DIR / "patch_makefileinc.txt"],
cwd=FASTJET_CONTRIB,
env=env,
check=True,
)

subprocess.run(
[
"./configure",
f"--fastjet-config={FASTJET}/fastjet-config",
f'CXX={env["CXX"]}',
"CXXFLAGS=-O3 -Bstatic -Bdynamic -std=c++17",
],
cwd=FASTJET_CONTRIB,
Expand Down

0 comments on commit 74d0b68

Please sign in to comment.