From 715cf5372149c5f3e954367efcadf3d0be437409 Mon Sep 17 00:00:00 2001 From: Navaneet Villodi <11260095+nauaneed@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:29:14 +0530 Subject: [PATCH] ci(macos): use omp enabled homebrew-llvm-clang Ref - https://github.com/Rdatatable/data.table/wiki/Installation/370c4629742886190c08de5e199a8ca8d3d86b24 - https://github.com/actions/runner-images/blob/5c04ad10e394b07619bd68a62b3cd7665e7a3cb3/images/macos/macos-14-arm64-Readme.md --- .github/workflows/tests.yml | 12 ++++++++++++ .github/workflows/zoltan-tests.yml | 2 +- setup.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) 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']