From 16ddbe89fd9ba43b237590b8ab524fd44a2b7e73 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Sun, 15 Sep 2024 14:04:36 -0500 Subject: [PATCH] debug --- setup.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 3e0b2b1..4205e86 100644 --- a/setup.py +++ b/setup.py @@ -65,12 +65,18 @@ def build_extensions(self): # by FastJet and FastJet-contrib. # c.f. https://github.com/scikit-hep/fastjet/issues/310 if sys.platform == "darwin": - os.environ["CXXFLAGS"] = "-I/opt/homebrew/include " + os.environ.get( - "CXXFLAGS", "" - ) - os.environ["LDFLAGS"] = ( - os.environ.get("LDFLAGS", "") + " -L/opt/homebrew/lib" + os.environ["CXXFLAGS"] = ( + f"-I{os.environ['HOMEBREW_PREFIX']}/include " + + os.environ.get("CXXFLAGS", "") ) + # os.environ["LDFLAGS"] = ( + # os.environ.get("LDFLAGS", "") + # + f" -L{os.environ['HOMEBREW_PREFIX']}/lib" + # ) + # For reasons that are unclear, the LDFLAGS need to be fully + # overridden. It is insufficient to just prepend the Homebrew + # library path to the existing LDFLAGS. + os.environ["LDFLAGS"] = f"-L{os.environ['HOMEBREW_PREFIX']}/lib" # Pick up a Conda environment if it is active if "CONDA_PREFIX" in os.environ and os.environ["CONDA_PREFIX"]: os.environ["CXXFLAGS"] = ( @@ -135,7 +141,7 @@ def build_extensions(self): # For reasons that are unclear, the LDFLAGS need to be fully # overridden. It is insufficient to just prepend the Homebrew # library path to the existing LDFLAGS. - env["LDFLAGS"] = "-L/opt/homebrew/lib" + env["LDFLAGS"] = f"-L{env['HOMEBREW_PREFIX']}/lib" # Pick up a Conda environment if it is active if "CONDA_PREFIX" in env and env["CONDA_PREFIX"]: env["LDFLAGS"] = env["LDFLAGS"] + f" -L{env['CONDA_PREFIX']}/lib"