Skip to content

Commit

Permalink
ci(macos): use omp enabled homebrew-llvm-clang
Browse files Browse the repository at this point in the history
  • Loading branch information
nauaneed committed Aug 20, 2024
1 parent 50b56a2 commit 64d2e20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
if: ${{ runner.os != 'Windows' }}
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
export CC="$(brew --prefix llvm@15)/bin/clang"
export CXX="$(brew --prefix llvm@15)/bin/clang++"
export CPPFLAGS="-I$(brew --prefix libomp)/include"
export LDFLAGS="-L$(brew --prefix libomp)/lib"
fi
conda info
conda install -c conda-forge numpy cython h5py
python -m pip install --upgrade pip setuptools wheel
Expand Down
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,16 @@ def _get_openmp_flags():
return ['/openmp'], []
elif sys.platform == 'darwin':
if (os.environ.get('CC') is not None and
os.environ.get('CXX') is not None):
return ['-fopenmp'], ['-fopenmp']
os.environ.get('CXX') is not None):
cppflags = os.environ.get('CPPFLAGS')
ldflags = os.environ.get('LDFLAGS')
if cppflags is not None ldflags is not None:
print('*'*80)
print(cppflags.split(", "))
print(ldflags.split(", "))
return cppflags.split(", "), ldflags.split(", ")
else:
return ['-fopenmp'], ['-fopenmp']
else:
return ['-Xpreprocessor', '-fopenmp'], ['-lomp']
else:
Expand Down

0 comments on commit 64d2e20

Please sign in to comment.