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 5656ddf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ jobs:
conda install -c conda-forge pocl pyopencl
python -c 'import pyopencl as cl'
if: ${{ runner.os != 'Windows' }}
- name: Setup compyle config on MacOS to use openmp enabled clang from homebrew
run: |
mkdir -p ~/.compyle
touch ~/.compyle/config.py
echo "import os" >> ~/.compyle/config.py
echo "os.environ['CC'] = '$(brew --prefix llvm@15)/bin/clang'" >> ~/.compyle/config.py
echo "os.environ['CXX'] = '$(brew --prefix llvm@15)/bin/clang++'" >> ~/.compyle/config.py
export CPPFLAGS="-I$(brew --prefix libomp)/include"
export LDFLAGS="-L$(brew --prefix libomp)/lib"
python -c "import os; OMP_CFLAGS=os.environ.get('CPPFLAGS').split(', '); print(f'{OMP_CFLAGS=}')" >> ~/.compyle/config.py
python -c "import os; OMP_LINK=os.environ.get('LDFLAGS').split(', '); print(f'{OMP_LINK=}')" >> ~/.compyle/config.py
if: ${{ runner.os == 'macOS' }}
- name: Install dependencies
run: |
conda info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zoltan-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install mpi4py
python -m pip install https://github.com/pypr/cyarray/zipball/master
python -m pip install --no-build-isolation https://github.com/pypr/pyzoltan/zipball/master
python -m pip install https://github.com/pypr/compyle/zipball/master
python -m pip install --no-build-isolation https://github.com/pypr/pyzoltan/zipball/master
python -m pip install -r requirements.txt
python -m pip install -r requirements-test.txt
python setup.py develop
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ 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):
os.environ.get('CXX') is not None):
return ['-fopenmp'], ['-fopenmp']
else:
return ['-Xpreprocessor', '-fopenmp'], ['-lomp']
Expand Down

0 comments on commit 5656ddf

Please sign in to comment.