diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 488c359..59e9c27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: fail-fast: false matrix: python-version: ["3.8", "3.12"] - runs-on: [ubuntu-latest, macos-13] + runs-on: [ubuntu-latest, macos-13, macos-latest] arch: [auto64] steps: - uses: actions/checkout@v4 @@ -48,8 +48,7 @@ jobs: - name: Install compiler tools on macOS if: runner.os == 'macOS' run: | - brew install make automake swig gmp mpfr boost - export PATH="/usr/local/opt/make/libexec/gnubin:$PATH" + brew install make automake swig gmp mpfr boost libtool - name: Install extra deps on Linux if: runner.os == 'Linux' @@ -57,7 +56,6 @@ jobs: - name: Install package run: | - echo $PATH python -m pip install '.[test]' -v - name: Test package @@ -69,7 +67,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-13] + os: [ubuntu-latest, macos-13, macos-latest] python: [312] arch: [auto64] @@ -86,8 +84,7 @@ jobs: - name: Install compiler tools on macOS if: runner.os == 'macOS' run: | - brew install make automake swig mpfr boost - export PATH="/usr/local/opt/make/libexec/gnubin:$PATH" + brew install make automake swig mpfr boost libtool - name: Clone gmp if: runner.os == 'macOS' diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ece5d47..4a96d71 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -30,7 +30,7 @@ jobs: fail-fast: false matrix: python: [38, 39, 310, 311, 312] - os: [ubuntu-latest, macos-13] + os: [ubuntu-latest, macos-13, macos-14] arch: [auto64] include: - python: 38 @@ -62,8 +62,7 @@ jobs: - name: Install compiler tools on macOS if: runner.os == 'macOS' run: | - brew install make automake swig mpfr boost - export PATH="/usr/local/opt/make/libexec/gnubin:$PATH" + brew install make automake swig mpfr boost libtool - name: Clone gmp if: runner.os == 'macOS' diff --git a/setup.py b/setup.py index 5697138..ccb1172 100644 --- a/setup.py +++ b/setup.py @@ -81,7 +81,10 @@ def build_extensions(self): env = os.environ.copy() env["PYTHON"] = sys.executable env["PYTHON_INCLUDE"] = f'-I{sysconfig.get_path("include")}' - env["CXXFLAGS"] = "-O3 -Bstatic -lgmp -Bdynamic -std=c++17" + env["CXX"] = env.get("CXX", "g++") + env["CXXFLAGS"] = "-O3 -Bstatic -Bdynamic -std=c++17 " + env.get( + "CXXFLAGS", "" + ) env["LDFLAGS"] = env.get("LDFLAGS", "") + f" -Wl,-rpath,{_rpath}" env["ORIGIN"] = "$ORIGIN" # if evaluated, it will still be '$ORIGIN' @@ -109,10 +112,6 @@ def build_extensions(self): subprocess.run(["cat", "config.log"], cwd=FASTJET, check=True) raise - env = os.environ.copy() - env["CXX"] = env.get("CXX", "g++") - env["LDFLAGS"] = env.get("LDFLAGS", "") + f" -Wl,-rpath,{_rpath}" - 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) @@ -121,8 +120,7 @@ def build_extensions(self): "./configure", f"--fastjet-config={FASTJET}/fastjet-config", f'CXX={env["CXX"]}', - "CXXFLAGS=-O3 -Bstatic -Bdynamic -std=c++17", - f'LDFLAGS={env["LDFLAGS"]}', + f'CXXFLAGS={env["CXXFLAGS"]}', ], cwd=FASTJET_CONTRIB, env=env, @@ -151,10 +149,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: