diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a996e44..04d44ee 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -25,6 +25,10 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} + - name: Install libomp on macOS + if: matrix.os == 'macos-13' + run: | + brew install libomp - name: Install dependencies run: | python -m pip install --upgrade pip @@ -37,7 +41,14 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Build CPP extension + - name: Build CPP extension with clang++ + if: matrix.os == 'macos-13' + run: | + export CXX=$(brew --prefix llvm@15)/bin/clang++ + python setup.py build + find build/ -name "_C*.so" -exec cp {} ./torchlpc/ \; + - name: Build CPP extension with g++ + if: matrix.os == 'ubuntu-latest' run: | python setup.py build find build/ -name "_C*.so" -exec cp {} ./torchlpc/ \; diff --git a/setup.py b/setup.py index f476167..c72ce9e 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ # check if openmp is available if torch.backends.openmp.is_available(): extra_compile_args["cxx"] = ["-fopenmp"] - extra_link_args.append("-lgomp") + extra_link_args.append("-fopenmp") setuptools.setup( name=NAME,