Skip to content

Commit

Permalink
meson 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ameli committed Dec 6, 2023
1 parent b3e7245 commit f702a86
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
CIBW_BUILD: "*-macosx_arm64 *-macosx_x86_64"
CIBW_SKIP: "pp* cp36-* cp37-* cp38-*"
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_BUILD: brew reinstall gcc
with:
output-dir: wheelhouse

Expand Down
99 changes: 90 additions & 9 deletions .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
with:
python-version: '3.12'

# Without this, installing cuda give error: no much space left on device
- name: Clear Cache
if: matrix.os != 'windows-latest'
run: rm -rf /opt/hostedtoolcache

- name: Install OpenMP and numpy for mac
if: runner.os == 'macos'
run: |
Expand All @@ -41,29 +46,105 @@ jobs:
python -m pip install --upgrade pip
python -m pip install --upgrade numpy
- name: Install fortran compiler on mac
if: runner.os == 'macos'
run: brew reinstall gcc
# Test
- name: Install package and dependencies
if: runner.os != 'macos'
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade numpy
- name: Build wheels
# Build wheel for windows with CUDA enabled. Note that cibuildwheel
# does not need manylinux docker, thuns, CUDA can be installed in
# the github action's virtual machine using the Jimver's action
# in the previous action (see above).
- name: Build wheels in windows with CUDA support (X86_64)
if: matrix.os == 'windows-latest'
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_ARCHS_WINDOWS: "AMD64 x86"
CIBW_BUILD: "*-win_amd64"
CIBW_SKIP: "pp* cp36-* cp37-* cp38-*"
CIBW_BUILD_VERBOSITY: 1
with:
output-dir: wheelhouse

# Build wheel for windows with CUDA enabled. Note that cibuildwheel
# does not need manylinux docker, thuns, CUDA can be installed in
# the github action's virtual machine using the Jimver's action
# in the previous action (see above).
- name: Build wheels in windows without CUDA support (ARM64)
if: matrix.os == 'windows-latest'
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_ARCHS_WINDOWS: "ARM64"
CIBW_BUILD: "*-win_arm64"
CIBW_SKIP: "pp* cp36-* cp37-* cp38-*"
CIBW_BUILD_VERBOSITY: 1
with:
output-dir: wheelhouse

# Do not enable compiling with CUDA for macos since NIVDIA no
# longer supports CUDA in the macos.
- name: Build wheels in mac without CUDA support (X86_64 and arm64)
if: matrix.os == 'macos-latest'
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_BUILD: "*-macosx_arm64 *-macosx_x86_64"
CIBW_SKIP: "pp* cp36-* cp37-* cp38-*"
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_BUILD: brew reinstall gcc
with:
output-dir: wheelhouse

# Enable compiling with CUDA, only for linux. Note that cuda must
# be installed "inside" the manylinux docker image, not in the main
# github virtual machine. Also, we should use manylinux2014, but
# not manylinux1. Because of this, we will not install CUDA with
# the Jimver's action (unlike we did so for the windows wheel in
# the above). The ``CUDA_DYNAMIC_LOADING=0`` disables dynamic
# loading of CUDA library. Base of this, when the wheels are
# created in manylinux platform, the cuda's libraries
# (libcudart.so, libcublas.so, libcusparse.so) will bundle to
# the wheel. This is increases the wheel size, bit since the
# anaconda cloud upload size is 1GB, the large wheel size will not
# be a problem. The advantage of bundling cuda libraries to the
# wheel is that the end-user does not have to install cuda toolkit.
- name: Build wheels in linux with CUDA support (X86_64)
if: matrix.os == 'ubuntu-latest'
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_MANYLINUX_X86_64_IMAGE: sameli/manylinux2014_x86_64_cuda_12.2
# CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# CIBW_BEFORE_ALL_LINUX: chmod +x .github/scripts/install_cuda.sh && .github/scripts/install_cuda.sh
CIBW_ARCHS_LINUX: "x86_64"
CIBW_BUILD: "*-manylinux_x86_64 *-macosx_arm64 *-macosx_x86_64 *-win_amd64 *-win_arm64"
# CIBW_SKIP: "pp3*-macosx* pp3*-win* pp37* pp310-* cp36-* cp37-* cp38-*"
CIBW_SKIP: "pp3*-macosx* pp3*-win* pp* pp310-* cp36-* cp37-* cp38-*"
CIBW_BUILD: "*-manylinux_x86_64"
CIBW_SKIP: "pp* cp36-* cp37-* cp38-*"
CIBW_BUILD_VERBOSITY: 1
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_BUILD_LINUX: yum update; yum install gcc-gfortran openblas-devel.x86_64 lapack-devel.x86_64 -y; python -m pip install --upgrade pip; python -m pip install --upgrade numpy
# CIBW_BEFORE_BUILD_WINDOWS: pip install --upgrade pip; pip install --upgrade numpy
with:
output-dir: wheelhouse

# This does not work, the compilation takes several hours, then fails, even without enabling cuda.
# - name: Build wheels in linux without CUDA support (AARCH64)
# if: matrix.os == 'ubuntu-latest'
# uses: pypa/cibuildwheel@v2.15.0
# env:
# # CIBW_MANYLINUX_X86_64_IMAGE: sameli/manylinux2014_x86_64_cuda_12.2
# CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# # CIBW_BEFORE_ALL_LINUX: chmod +x .github/scripts/install_cuda.sh && .github/scripts/install_cuda.sh
# CIBW_ARCHS_LINUX: "aarch64"
# CIBW_BUILD: "*-manylinux_aarch64"
# CIBW_SKIP: "pp* cp36-* cp37-* cp38-*"
# CIBW_BUILD_VERBOSITY: 1
# CIBW_BEFORE_BUILD_LINUX: yum update; yum install gcc-gfortran openblas-devel.x86_64 lapack-devel.x86_64 -y; python -m pip install --upgrade pip; python -m pip install --upgrade numpy
# with:
# output-dir: wheelhouse

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wheel-artifacts
path: ./wheelhouse/*.whl
retention-days: 1

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires = ["meson-python", "numpy>1.11", "scipy>=1.5", "cython>=0.29.35"]
name = "special_functions"
license = {file = "LICENSE.txt"}
readme = "README.rst"
version = "0.2.6"
version = "0.2.7"
authors = [
{name = "Siavash Ameli", email = "sameli@berkeley.edu" }
]
Expand Down
Loading

0 comments on commit f702a86

Please sign in to comment.