From 294cac48907eaf00f4eb0726acc4ee1098fed19b Mon Sep 17 00:00:00 2001 From: Boris Bolliet Date: Sat, 28 Sep 2024 19:21:05 +0100 Subject: [PATCH] Update and rename build_wheels_macos.yml to build_wheels.yml --- .github/workflows/build_wheels.yml | 101 +++++++++++++++++++++++ .github/workflows/build_wheels_macos.yml | 101 ----------------------- 2 files changed, 101 insertions(+), 101 deletions(-) create mode 100644 .github/workflows/build_wheels.yml delete mode 100644 .github/workflows/build_wheels_macos.yml diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 00000000..355c6d43 --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,101 @@ +name: Build wheels + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + release: + types: [published] + +permissions: # Ensure the workflow has permission to push changes + contents: write # Allow write access for pushing to the repository + +jobs: + build_wheels: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + python-version: ["3.9"] + + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Clean up previous builds (if any) + run: | + rm -rf build dist *.egg-info class-sz/python/classy_sz.*so class-sz/python/classy_sz.*egg-info + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.14.1 + + # # Build wheels for Linux (with custom build options) + # - name: Build wheels for Linux + # if: matrix.os == 'ubuntu-latest' + # env: + # CIBW_BEFORE_BUILD: "yum install -y gsl-devel fftw-devel" + # CIBW_ARCHS: aarch64 + # CIBW_BUILD: cp39-manylinux_aarch64 + # run: python -m cibuildwheel --output-dir wheelhouse + + # - name: Install dependencies on macOS + # if: matrix.os == 'macos-latest' + # run: | + # brew install gsl fftw libomp + # chmod +x select_makefile.sh + # ./select_makefile.sh + # make clean + + # # Check that omp.h is available in the include directory + # if [ -f /opt/homebrew/opt/libomp/include/omp.h ]; then + # echo "omp.h found" + # else + # echo "omp.h not found" && exit 1 + # fi + + # # Check that gsl_integration.h and fftw3.h are available + # if [ -f /opt/homebrew/opt/gsl/include/gsl/gsl_integration.h ]; then + # echo "gsl_integration.h found" + # else + # echo "gsl_integration.h not found" && exit 1 + # fi + + # if [ -f /opt/homebrew/opt/fftw/include/fftw3.h ]; then + # echo "fftw3.h found" + # else + # echo "fftw3.h not found" && exit 1 + # fi + + + # export LIBRARY_PATH=/opt/homebrew/opt/libomp/lib:$LIBRARY_PATH + # export C_INCLUDE_PATH=/opt/homebrew/opt/libomp/include:$C_INCLUDE_PATH + # export DYLD_LIBRARY_PATH=/opt/homebrew/opt/libomp/lib:$DYLD_LIBRARY_PATH # (Mac M1 users only) + # working-directory: class-sz + + # # Build wheels for macOS (with Apple Silicon support) + # - name: Build wheels for macOS + # if: matrix.os == 'macos-latest' + # env: + # CIBW_ARCHS: "arm64" + # LDFLAGS: "-L/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/gsl/lib -L/opt/homebrew/opt/fftw/lib" + # CPPFLAGS: "-I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/gsl/include -I/opt/homebrew/opt/fftw/include" + # LIBRARY_PATH: "/opt/homebrew/opt/libomp/lib:/opt/homebrew/opt/gsl/lib:/opt/homebrew/opt/fftw/lib:$LIBRARY_PATH" + # C_INCLUDE_PATH: "/opt/homebrew/opt/libomp/include:/opt/homebrew/opt/gsl/include:/opt/homebrew/opt/fftw/include:$C_INCLUDE_PATH" + # DYLD_LIBRARY_PATH: "/opt/homebrew/opt/libomp/lib:/opt/homebrew/opt/gsl/lib:/opt/homebrew/opt/fftw/lib:$DYLD_LIBRARY_PATH" + + # run: python -m cibuildwheel --output-dir wheelhouse + + - name: Build source distribution (sdist) + run: python setup.py sdist bdist_wheel + + - uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }}-${{ matrix.python-version }} + path: wheelhouse/*.whl diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml deleted file mode 100644 index aa73874d..00000000 --- a/.github/workflows/build_wheels_macos.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: Build wheels - -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - release: - types: [published] - -permissions: # Ensure the workflow has permission to push changes - contents: write # Allow write access for pushing to the repository - -jobs: - build_wheels: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest] - python-version: ["3.9"] - - steps: - - name: Checkout the code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Clean up previous builds (if any) - run: | - rm -rf build dist *.egg-info class-sz/python/classy_sz.*so class-sz/python/classy_sz.*egg-info - - - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.14.1 - - # Build wheels for Linux (with custom build options) - - name: Build wheels for Linux - if: matrix.os == 'ubuntu-latest' - env: - CIBW_BEFORE_BUILD: "yum install -y gsl-devel fftw-devel" - CIBW_ARCHS: aarch64 - CIBW_BUILD: cp39-manylinux_aarch64 - run: python -m cibuildwheel --output-dir wheelhouse - - - name: Install dependencies on macOS - if: matrix.os == 'macos-latest' - run: | - brew install gsl fftw libomp - chmod +x select_makefile.sh - ./select_makefile.sh - make clean - - # Check that omp.h is available in the include directory - if [ -f /opt/homebrew/opt/libomp/include/omp.h ]; then - echo "omp.h found" - else - echo "omp.h not found" && exit 1 - fi - - # Check that gsl_integration.h and fftw3.h are available - if [ -f /opt/homebrew/opt/gsl/include/gsl/gsl_integration.h ]; then - echo "gsl_integration.h found" - else - echo "gsl_integration.h not found" && exit 1 - fi - - if [ -f /opt/homebrew/opt/fftw/include/fftw3.h ]; then - echo "fftw3.h found" - else - echo "fftw3.h not found" && exit 1 - fi - - - export LIBRARY_PATH=/opt/homebrew/opt/libomp/lib:$LIBRARY_PATH - export C_INCLUDE_PATH=/opt/homebrew/opt/libomp/include:$C_INCLUDE_PATH - export DYLD_LIBRARY_PATH=/opt/homebrew/opt/libomp/lib:$DYLD_LIBRARY_PATH # (Mac M1 users only) - working-directory: class-sz - - # Build wheels for macOS (with Apple Silicon support) - - name: Build wheels for macOS - if: matrix.os == 'macos-latest' - env: - CIBW_ARCHS: "arm64" - LDFLAGS: "-L/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/gsl/lib -L/opt/homebrew/opt/fftw/lib" - CPPFLAGS: "-I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/gsl/include -I/opt/homebrew/opt/fftw/include" - LIBRARY_PATH: "/opt/homebrew/opt/libomp/lib:/opt/homebrew/opt/gsl/lib:/opt/homebrew/opt/fftw/lib:$LIBRARY_PATH" - C_INCLUDE_PATH: "/opt/homebrew/opt/libomp/include:/opt/homebrew/opt/gsl/include:/opt/homebrew/opt/fftw/include:$C_INCLUDE_PATH" - DYLD_LIBRARY_PATH: "/opt/homebrew/opt/libomp/lib:/opt/homebrew/opt/gsl/lib:/opt/homebrew/opt/fftw/lib:$DYLD_LIBRARY_PATH" - - run: python -m cibuildwheel --output-dir wheelhouse - - - name: Build source distribution (sdist) - run: python setup.py sdist bdist_wheel - - - uses: actions/upload-artifact@v4 - with: - name: wheels-${{ matrix.os }}-${{ matrix.python-version }} - path: wheelhouse/*.whl