Skip to content

Commit 74d0b68

Browse files
fix: Use environment CXX to configure fastjet-contrib .Makefile.inc
* 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.
1 parent 39e75be commit 74d0b68

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

patch_makefileinc.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

setup.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def build_extensions(self):
6969
env = os.environ.copy()
7070
env["PYTHON"] = sys.executable
7171
env["PYTHON_INCLUDE"] = f'-I{sysconfig.get_path("include")}'
72+
env["CXX"] = env.get("CXX", "g++")
7273
env["CXXFLAGS"] = "-O3 -Bstatic -lgmp -Bdynamic -std=c++17"
7374
env["ORIGIN"] = "$ORIGIN" # if evaluated, it will still be '$ORIGIN'
7475

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

104-
subprocess.run(
105-
["patch", "./.Makefile.inc", DIR / "patch_makefileinc.txt"],
106-
cwd=FASTJET_CONTRIB,
107-
env=env,
108-
check=True,
109-
)
110-
111105
subprocess.run(
112106
[
113107
"./configure",
114108
f"--fastjet-config={FASTJET}/fastjet-config",
109+
f'CXX={env["CXX"]}',
115110
"CXXFLAGS=-O3 -Bstatic -Bdynamic -std=c++17",
116111
],
117112
cwd=FASTJET_CONTRIB,

0 commit comments

Comments
 (0)