diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f09164..7459c7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,9 @@ 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: diff --git a/pyproject.toml b/pyproject.toml index 65b2bac..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] 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 +)