Skip to content

Commit

Permalink
update pip.yml for building wheels for PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Sep 11, 2024
1 parent a610480 commit ff4a352
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 51 deletions.
72 changes: 37 additions & 35 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- name: checkout vcell-solvers repo
- name: checkout vcell-fvsolvers repo
uses: actions/checkout@v4
with:
submodules: true
Expand Down Expand Up @@ -104,6 +104,42 @@ jobs:
brew info boost
brew info hdf5
- name: Install Windows Dependencies
if: matrix.platform == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: CLANG64
update: true
install: >
zip
git
mingw-w64-clang-x86_64-curl
mingw-w64-clang-x86_64-toolchain
mingw-w64-clang-x86_64-flang
mingw-w64-clang-x86_64-cmake
mingw-w64-clang-x86_64-boost
mingw-w64-clang-x86_64-hdf5
mingw-w64-clang-x86_64-libzip
mingw-w64-clang-x86_64-zlib
mingw-w64-clang-x86_64-libaec
- name: Install Linux Dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libboost-all-dev
sudo apt-get install -y libhdf5-dev
sudo apt-get install -y libzip-dev
sudo apt-get install -y ninja-build
gcc --version
gfortran --version
cmake --version
dpkg -s libboost-all-dev
dpkg -s libhdf5-dev
- name: Build Macos ARM
if: matrix.platform == 'macos-14'
run: |
Expand Down Expand Up @@ -182,25 +218,6 @@ jobs:
# limit-access-to-actor: false


- name: Install Windows Dependencies
if: matrix.platform == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: CLANG64
update: true
install: >
zip
git
mingw-w64-clang-x86_64-curl
mingw-w64-clang-x86_64-toolchain
mingw-w64-clang-x86_64-flang
mingw-w64-clang-x86_64-cmake
mingw-w64-clang-x86_64-boost
mingw-w64-clang-x86_64-hdf5
mingw-w64-clang-x86_64-libzip
mingw-w64-clang-x86_64-zlib
mingw-w64-clang-x86_64-libaec
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
Expand Down Expand Up @@ -249,21 +266,6 @@ jobs:
./bin/FiniteVolume_x64 || true
echo
- name: Install Linux Dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libboost-all-dev
sudo apt-get install -y libhdf5-dev
sudo apt-get install -y libzip-dev
sudo apt-get install -y ninja-build
gcc --version
gfortran --version
cmake --version
dpkg -s libboost-all-dev
dpkg -s libhdf5-dev
- name: Build Linux
if: matrix.platform == 'ubuntu-latest'
run: |
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,27 @@ jobs:
run: |
brew install boost
brew install hdf5
brew install libzip
brew install ninja
brew install llvm
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> /Users/runner/.bash_profile
source /Users/runner/.bash_profile
ln -s $(which gfortran-14) /usr/local/bin/gfortran
gcc --version
gfortran --version
cmake --version
brew info boost
brew info hdf5
- name: Install ARM MacOS dependencies
if: matrix.platform == 'macos-14'
shell: bash
run: |
brew install boost
brew install hdf5
brew install libzip
brew install ninja
brew install llvm
Expand All @@ -68,7 +70,6 @@ jobs:
brew info boost
brew info hdf5
- name: Install Windows Dependencies
if: matrix.platform == 'windows-latest'
uses: msys2/setup-msys2@v2
Expand All @@ -93,28 +94,31 @@ jobs:
with:
python-version: "${{ matrix.python-version }}"

- name: Build and install macos-13

- name: Build and install macos-14
if: matrix.platform == 'macos-14'
run: |
export MACOSX_DEPLOYMENT_TARGET=13.0
PATH="/usr/local/opt/llvm/bin:$PATH"
PATH="/opt/homebrew/opt/llvm/bin:$PATH"
pip wheel . -w dist
ls -al dist
pip install delocate
delocate-listdeps dist/*.whl
delocate-wheel -v dist/*.whl
pip install dist/*.whl
if: matrix.platform == 'macos-13'
- name: Build and install macos-14
- name: Build and install macos-13
if: matrix.platform == 'macos-13'
run: |
PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export MACOSX_DEPLOYMENT_TARGET=13.0
PATH="/usr/local/opt/llvm/bin:$PATH"
pip wheel . -w dist
ls -al dist
pip install delocate
delocate-listdeps dist/*.whl
delocate-wheel -v dist/*.whl
pip install dist/*.whl
if: matrix.platform == 'macos-14'
- name: Build and install windows-latest
shell: msys2 {0}
Expand All @@ -134,7 +138,7 @@ jobs:
run: |
docker run --rm -v $(pwd):/io quay.io/pypa/manylinux2014_x86_64 \
/bin/bash -c \
"yum install -y boost-devel hdf5-devel ninja-build && \
"yum install -y boost-devel hdf5-devel libzip-devel ninja-build && \
/opt/python/cp39-cp39/bin/pip wheel /io/ -w /io/dist && \
auditwheel repair /io/dist/*.whl -w /io/dist/"
echo "keeping only the manylinux wheels, remove those with -linux_x86_64.whl in the name"
Expand All @@ -146,7 +150,7 @@ jobs:
run: |
docker run --rm -v $(pwd):/io quay.io/pypa/manylinux2014_x86_64 \
/bin/bash -c \
"yum install -y boost-devel hdf5-devel ninja-build && \
"yum install -y boost-devel hdf5-devel libzip-devel ninja-build && \
/opt/python/cp310-cp310/bin/pip wheel /io/ -w /io/dist && \
auditwheel repair /io/dist/*.whl -w /io/dist/"
echo "keeping only the manylinux wheels, remove those with -linux_x86_64.whl in the name"
Expand All @@ -158,7 +162,7 @@ jobs:
run: |
docker run --rm -v $(pwd):/io quay.io/pypa/manylinux2014_x86_64 \
/bin/bash -c \
"yum install -y boost-devel hdf5-devel ninja-build && \
"yum install -y boost-devel hdf5-devel libzip-devel ninja-build && \
/opt/python/cp311-cp311/bin/pip wheel /io/ -w /io/dist && \
auditwheel repair /io/dist/*.whl -w /io/dist/"
echo "keeping only the manylinux wheels, remove those with -linux_x86_64.whl in the name"
Expand All @@ -170,7 +174,7 @@ jobs:
run: |
docker run --rm -v $(pwd):/io quay.io/pypa/manylinux2014_x86_64 \
/bin/bash -c \
"yum install -y boost-devel hdf5-devel ninja-build && \
"yum install -y boost-devel hdf5-devel libzip-devel ninja-build && \
/opt/python/cp312-cp312/bin/pip wheel /io/ -w /io/dist && \
auditwheel repair /io/dist/*.whl -w /io/dist/"
echo "keeping only the manylinux wheels, remove those with -linux_x86_64.whl in the name"
Expand Down
16 changes: 13 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
FROM ubuntu:22.04

RUN apt-get -y update && apt-get install -y apt-utils && \
apt-get install -y -qq -o=Dpkg::Use-Pty=0 build-essential gfortran \
libhdf5-dev libzip-dev ninja-build libcurl4-openssl-dev libboost-all-dev libbz2-dev cmake python3
RUN apt-get -y update && \
apt-get install -y apt-utils && \
apt-get install -y -qq -o=Dpkg::Use-Pty=0 \
build-essential \
cmake \
ninja-build \
gfortran \
libcurl4-openssl-dev \
libhdf5-dev \
libzip-dev \
libboost-all-dev \
libbz2-dev \
python3

# Install an alternative Fortran compiler
RUN apt-get install -y gfortran-10
Expand Down

0 comments on commit ff4a352

Please sign in to comment.