diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 853420fc..abe8da8e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.github/workflows/zoltan-tests.yml b/.github/workflows/zoltan-tests.yml index 7fe2d7b2..2209c800 100644 --- a/.github/workflows/zoltan-tests.yml +++ b/.github/workflows/zoltan-tests.yml @@ -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 diff --git a/setup.py b/setup.py index ffd82ef1..fdb67727 100644 --- a/setup.py +++ b/setup.py @@ -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']