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 307044d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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++"
CPPFLAGS = "-I$(brew --prefix libomp)/include"
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
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,15 @@ def _get_openmp_flags():
elif sys.platform == 'darwin':
if (os.environ.get('CC') is not None and
os.environ.get('CXX') is not None):
return ['-fopenmp'], ['-fopenmp']
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 307044d

Please sign in to comment.