From 19825e8f0a8809df70928d3dd7eb8b39543df1fd Mon Sep 17 00:00:00 2001 From: Sourav Bhattacharjee Date: Wed, 1 Apr 2026 21:25:30 +0200 Subject: [PATCH 1/5] Remove libomp brew install --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 65b2bac..e09c76b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,8 +84,8 @@ repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}" [tool.cibuildwheel.macos] archs = ["native"] -before-all = "brew install libomp" -environment = {MACOSX_DEPLOYMENT_TARGET = "15.0"} +#before-all = "brew install libomp" +#environment = {MACOSX_DEPLOYMENT_TARGET = "15.0"} repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" From bbc96f6f142c112e502e7038e8d0d7dce2c97c7f Mon Sep 17 00:00:00 2001 From: Sourav Bhattacharjee Date: Wed, 1 Apr 2026 21:43:14 +0200 Subject: [PATCH 2/5] Update setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 12597fb..a161dd8 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ def extra_link_args() -> List[str]: extra_link_args = ["/openmp"] elif sys.platform == "darwin": _, lib_dir = _find_libomp() - extra_link_args = ["-lomp", f"-L{lib_dir}"] + extra_link_args = ["-lomp", f"-L{lib_dir}", f"-Wl,-rpath,{lib_dir}"] else: extra_link_args = ["-fopenmp"] @@ -140,4 +140,4 @@ def generate_extensions(package_path, includes=[]): packages=find_packages(where="src"), package_dir={"": "src"}, ext_modules=ext_modules, -) \ No newline at end of file +) From e21b969c14b2ec51316037e948681d7a1017f15c Mon Sep 17 00:00:00 2001 From: Sourav Bhattacharjee Date: Wed, 1 Apr 2026 22:12:38 +0200 Subject: [PATCH 3/5] prevent delocate from bundling libomp for Mac --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f09164..7206385 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,10 +29,15 @@ jobs: uses: docker/setup-qemu-action@v3 with: platforms: all + - name: Install libomp on macOS + if: runner.os == 'macOS' + run: brew install libomp - name: Build wheels uses: pypa/cibuildwheel@v3.1.2 env: CIBW_BUILD: ${{ matrix.python }}-* + CIBW_REPAIR_WHEEL_COMMAND_MACOS: > + delocate-wheel --exclude libomp -w {dest_dir} {wheel} - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }}-${{ matrix.python }} From 395e6617bc7ac920b6d756c7e0d5fde33558121b Mon Sep 17 00:00:00 2001 From: Sourav Bhattacharjee Date: Thu, 2 Apr 2026 10:34:13 +0200 Subject: [PATCH 4/5] prevent libomp bundling in Mac --- pyproject.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e09c76b..d4c40b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,9 +84,7 @@ repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}" [tool.cibuildwheel.macos] archs = ["native"] -#before-all = "brew install libomp" -#environment = {MACOSX_DEPLOYMENT_TARGET = "15.0"} -repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" +repair-wheel-command = "delocate-wheel --exclude libomp --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" [tool.cibuildwheel.windows] From 577015aac335f41d0bf014694b161971b07a4b6e Mon Sep 17 00:00:00 2001 From: Sourav Bhattacharjee Date: Thu, 2 Apr 2026 10:35:13 +0200 Subject: [PATCH 5/5] libomp exclusion in Mac shift to .toml --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7206385..7459c7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,8 +36,6 @@ jobs: uses: pypa/cibuildwheel@v3.1.2 env: CIBW_BUILD: ${{ matrix.python }}-* - CIBW_REPAIR_WHEEL_COMMAND_MACOS: > - delocate-wheel --exclude libomp -w {dest_dir} {wheel} - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }}-${{ matrix.python }}