Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,45 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-13]
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install libomp on macOS
if: matrix.os == 'macos-latest'
run: |
brew install libomp
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
pip install "numpy<2.0" numba
pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install torch (mac)
if: matrix.os == 'macos-latest'
run: pip install torch
- name: Install torch (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
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-latest'
run: |
export CXX=$(brew --prefix llvm@15)/bin/clang++
export LDFLAGS="-L/usr/local/opt/libomp/lib"
export CPPFLAGS="-I/usr/local/opt/libomp/include"
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/ \;
Expand Down
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_extensions():
extra_compile_args = {}
if use_openmp:
extra_compile_args["cxx"] = ["-fopenmp"]
extra_link_args.append("-lgomp")
extra_link_args.append("-fopenmp")

this_dir = os.path.abspath(os.path.dirname(__file__))
extensions_dir = os.path.join(this_dir, library_name, "csrc")
Expand All @@ -59,9 +59,6 @@ def get_extensions():
return ext_modules


extra_link_args = []
extra_compile_args = {}

setuptools.setup(
name=library_name,
version=VERSION,
Expand Down