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 18, 2024
1 parent 39e75be commit b11bbda
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ graft fastjet-core
graft fastjet-contrib
graft pybind11
global-exclude .git .gitmodules
include LICENSE README.md pyproject.toml setup.py setup.cfg patch_fastjet_i.txt patch_clustersequence.txt patch_makefileinc.txt
include LICENSE README.md pyproject.toml setup.py setup.cfg patch_fastjet_i.txt patch_clustersequence.txt
exclude .cirrus.yml
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 @@ -97,21 +97,16 @@ def build_extensions(self):
raise

env = os.environ.copy()
env["CXX"] = env.get("CXX", "g++")
env["ORIGIN"] = "$ORIGIN" # if evaluated, it will still be '$ORIGIN'
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 b11bbda

Please sign in to comment.