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 15e977e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ jobs:
conda info
conda install -c conda-forge pocl pyopencl
python -c 'import pyopencl as cl'
if [ "$RUNNER_OS" == "macOS" ]; then
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
fi
if: ${{ runner.os != 'Windows' }}
- name: Install dependencies
run: |
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 15e977e

Please sign in to comment.