diff --git a/extern/fastjet-core b/extern/fastjet-core index 0648cfc..67796a1 160000 --- a/extern/fastjet-core +++ b/extern/fastjet-core @@ -1 +1 @@ -Subproject commit 0648cfc312bbfefbaa28ffa2cb29b010f88e163c +Subproject commit 67796a1d43981d25a0f6d197fdfb71571028caf0 diff --git a/setup.py b/setup.py index 8e237a6..535bd1e 100644 --- a/setup.py +++ b/setup.py @@ -101,12 +101,20 @@ def build_extensions(self): subprocess.run(["make", "-j"], cwd=FASTJET, env=env, check=True) subprocess.run(["make", "install"], cwd=FASTJET, env=env, check=True) + # For aarch64 macOS need to set the LDFLAGS for Homebrew installed + # dependencies to be found. However, fastjet-contrib's configure + # script does not use/accept LDFLAGS as an argument, and so to get + # the library search path options passed to the linker it is necessary + # to improperly inject them into the CXXFLAGS (which are used). + # This is a bad hack, and will be alleviated if CMake can be used + # by FastJet and FastJet-contrib. + # c.f. https://github.com/scikit-hep/fastjet/issues/310 subprocess.run( [ "./configure", f"--fastjet-config={FASTJET}/fastjet-config", f'CXX={env["CXX"]}', - f'CXXFLAGS=-O3 -Bstatic -Bdynamic -std=c++17 {env["LDFLAGS"]}', + f'CXXFLAGS=-O3 -Bstatic -Bdynamic -std=c++17{" "+env["LDFLAGS"] if sys.platform == "darwin" else ""}', ], cwd=FASTJET_CONTRIB, env=env, @@ -135,10 +143,7 @@ def run(self): shutil.copytree(OUTPUT, fastjetdir / "_fastjet_core", symlinks=True) - make = "make" - if sys.platform == "darwin": - make = "gmake" - + make = "gmake" if sys.platform == "darwin" else "make" pythondir = pathlib.Path( subprocess.check_output( f"""{make} -f Makefile --eval='print-pythondir: