diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d202a33 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 7c15046..e941b90 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -6,40 +6,23 @@ on: branches: [ main ] workflow_dispatch: -jobs: - build_x86_64: - name: Build image for x86_64 - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true - - name: Build and push - uses: docker/build-push-action@v6 - with: - platforms: linux/amd64 - push: ${{ github.ref_name == 'main' }} - tags: ghcr.io/cantera/manylinux_2_28_x86_64-hdf5-boost - build-args: | - TARGET_ARCH=x86_64 - cache-from: type=gha - cache-to: type=gha,mode=max - - build_aarch64: - name: Build image for aarch64 +jobs: + build: + name: Build image for ${{ matrix.arch }} runs-on: ubuntu-latest - + strategy: + matrix: + include: + - arch: x86_64 + plat: linux/amd64 + - arch: aarch64 + plat: linux/arm64 steps: - uses: actions/checkout@v4 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry @@ -48,19 +31,19 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup up QEMU + - name: Set up QEMU + if: matrix.arch == 'aarch64' uses: docker/setup-qemu-action@v3 with: platforms: arm64 - - name: Build and push uses: docker/build-push-action@v6 with: - platforms: linux/arm64 - push: ${{ github.ref_name == 'main' }} - tags: ghcr.io/cantera/manylinux_2_28_aarch64-hdf5-boost + platforms: ${{ matrix.plat }} + push: ${{ github.event_name != 'pull_request' }} + tags: ghcr.io/cantera/cantera-base-manylinux_2_28-${{ matrix.arch }} build-args: | - TARGET_ARCH=aarch64 + TARGET_ARCH=${{ matrix.arch }} + target: builder cache-from: type=gha cache-to: type=gha,mode=max diff --git a/CMakeLists.txt b/CMakeLists.txt index eb5ffbf..1e39402 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,11 +6,11 @@ include(ExternalProject) set(DOWNLOAD_DIR "/cache") -set(BOOST_VERSION 1.85.0) +set(BOOST_VERSION 1.86.0) ExternalProject_Add( boost URL https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-cmake.tar.xz - URL_HASH SHA256=0a9cc56ceae46986f5f4d43fe0311d90cf6d2fa9028258a95cab49ffdacf92ad + URL_HASH SHA256=2c5ec5edcdff47ff55e27ed9560b0a0b94b07bd07ed9928b476150e16b0efc57 CMAKE_GENERATOR Ninja CMAKE_CACHE_ARGS -DCMAKE_BUILD_TYPE:STRING=Release @@ -19,27 +19,13 @@ ExternalProject_Add( DOWNLOAD_DIR ${DOWNLOAD_DIR} ) -set(LIBAEC_VERSION 1.0.6) -set(LIBAEC_PATCHFILE) -ExternalProject_Add( - libaec - URL https://gitlab.dkrz.de/k202009/libaec/uploads/45b10e42123edd26ab7b3ad92bcf7be2/libaec-${LIBAEC_VERSION}.tar.gz - URL_HASH SHA256=032961877231113bb094ef224085e6d66fd670f85a3e17f53d0f131abf24f2fd - PATCH_COMMAND patch -p0 < ${LIBAEC_PATCHFILE} - CMAKE_GENERATOR Ninja - CMAKE_CACHE_ARGS - -DCMAKE_BUILD_TYPE:STRING=Release - -DCMAKE_INSTALL_LIBDIR:STRING=lib - -DBUILD_TESTING:BOOL=OFF - DOWNLOAD_DIR ${DOWNLOAD_DIR} -) - -set(LIBHDF5_VERSION 1.14.2) -set(LIBHDF5_SHORT_VERSION 1.14) +set(LIBHDF5_VERSION 1.14.5) +set(ZLIB_VERSION 1.3) +set(LIBAEC_VERSION 1.1.3) ExternalProject_Add( libhdf5 - URL https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${LIBHDF5_SHORT_VERSION}/hdf5-${LIBHDF5_VERSION}/src/hdf5-${LIBHDF5_VERSION}.tar.gz - URL_HASH SHA256=1c342e634008284a8c2794c8e7608e2eaf26d01d445fb3dfd7f33cb2fb51ac53 + URL https://github.com/HDFGroup/hdf5/releases/download/hdf5_${LIBHDF5_VERSION}/hdf5-${LIBHDF5_VERSION}.tar.gz + URL_HASH SHA256=ec2e13c52e60f9a01491bb3158cb3778c985697131fc6a342262d32a26e58e44 CMAKE_GENERATOR Ninja CMAKE_CACHE_ARGS -DCMAKE_BUILD_TYPE:STRING=Release @@ -47,8 +33,18 @@ ExternalProject_Add( -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON -DHDF5_BUILD_EXAMPLES:BOOL=OFF + -DHDF5_BUILD_TOOLS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF - DEPENDS libaec + -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ + -DZLIB_PACKAGE_NAME:STRING=zlib + -DZLIB_TGZ_NAME:STRING=zlib-${ZLIB_VERSION}.tar.gz + -DZLIB_TGZ_ORIGPATH:STRING=https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION} + -DZLIB_USE_LOCALCONTENT:BOOL=OFF + -DLIBAEC_PACKAGE_NAME:STRING=libaec + -DLIBAEC_TGZ_NAME:STRING=libaec-${LIBAEC_VERSION}.tar.gz + -DLIBAEC_TGZ_ORIGPATH:STRING=https://github.com/MathisRosenhauer/libaec/releases/download/v${LIBAEC_VERSION} + -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF + -DHDF_PACKAGE_NAMESPACE:STRING=ct DOWNLOAD_DIR ${DOWNLOAD_DIR} ) @@ -72,7 +68,7 @@ ExternalProject_Add( URL_HASH SHA256=fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16 CMAKE_GENERATOR Ninja CMAKE_CACHE_ARGS - -DCMAKE_BUILD_TYPE:STRING=release + -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_LIBDIR:STRING=lib -DYAML_CPP_DISABLE_UNINSTALL:BOOL=OFF -DYAML_CPP_FORMAT_SOURCE:BOOL=OFF @@ -93,6 +89,8 @@ ExternalProject_Add( -DBUILD_SHARED_LIBS:BOOL=OFF -DEXAMPLES_ENABLE_C:BOOL=OFF -DEXAMPLES_INSTALL:BOOL=OFF + -DENABLE_LAPACK:BOOL=ON + -DBLA_VENDOR:STRING=OpenBLAS DOWNLOAD_DIR ${DOWNLOAD_DIR} ) @@ -111,11 +109,11 @@ ExternalProject_Add( DOWNLOAD_DIR ${DOWNLOAD_DIR} ) -set(HIGHFIVE_VERSION 2.9.0) +set(HIGHFIVE_VERSION 2.10.0) ExternalProject_Add( highfive URL https://github.com/BlueBrain/HighFive/archive/refs/tags/v${HIGHFIVE_VERSION}.tar.gz - URL_HASH SHA256=6301def8ceb9f4d7a595988612db288b448a3c0546f6c83417dab38c64994d7e + URL_HASH SHA256=c29e8e1520e7298fabb26545f804e35bb3af257005c1c2df62e39986458d7c38 CMAKE_GENERATOR Ninja CMAKE_CACHE_ARGS -DCMAKE_BUILD_TYPE:STRING=Release diff --git a/Dockerfile b/Dockerfile index 62ffc19..d936b61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,14 @@ # from TARGETARCH which is defined by docker. The reason is because TARGETARCH=amd64 # but we need TARGET_ARCH=x86_64 ARG TARGET_ARCH -FROM quay.io/pypa/manylinux_2_28_${TARGET_ARCH}:2024-07-15-c746fd8 +FROM quay.io/pypa/manylinux_2_28_${TARGET_ARCH}:2024-10-05-46a4cc2 AS builder ARG NINJA_VERSION=1.12.1 # Has to be repeated here so it's imported from the "top level" above the FROM ARG TARGET_ARCH -COPY CMakeLists.txt libaec_cmakelists.patch /tmp/ +COPY CMakeLists.txt /build/ +WORKDIR /build/ RUN --mount=type=cache,target=/cache \ if [[ "$TARGET_ARCH" == "aarch64" ]]; then NINJA_ARCH="-aarch64"; else NINJA_ARCH=""; fi \ @@ -16,9 +17,24 @@ RUN --mount=type=cache,target=/cache \ && curl -fsSL -o /cache/ninja-linux.zip https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux${NINJA_ARCH}.zip \ && unzip /cache/ninja-linux.zip -d /usr/local/bin \ && ninja --version \ - && mkdir build \ + && yum install -y openblas-devel \ + && cmake -G Ninja -S . -B build \ && pushd build \ - && cmake -G Ninja -DLIBAEC_PATCHFILE=/tmp/libaec_cmakelists.patch ../tmp \ && ninja \ && popd \ && rm -rf build + +# FROM builder AS tester + +# RUN yum install -y python3.12-pip \ +# && python3.12 -m pip install --root-user-action=ignore build auditwheel + +# COPY cantera-3.1.0a4.tar.gz /project/ + +# RUN --mount=type=cache,target=/root/.cache \ +# pushd project \ +# && tar --strip-components=1 -zxf cantera-*.tar.gz \ +# && rm -f cantera-*.tar.gz \ +# && python3.12 -m build --wheel . \ +# && pushd dist \ +# && auditwheel repair -w . cantera*.whl diff --git a/README.md b/README.md index 14ebc60..3ec52fc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -'manylinux' Docker images are used to build Python extension modules compatible with many popular Linux distributions. This repository builds several dependencies on top of the standard manylinux images, for using in building Cantera. +'manylinux' Docker images are used to build Python extension modules compatible with many popular Linux distributions. This repository builds several dependencies on top of the standard manylinux images, for use in building Cantera. -Images are published on GitHub container registry: +Images are published on the GitHub container registry: -- [manylinux_2_28_x86_64-hdf5-boost](https://github.com/orgs/cantera/packages/container/package/manylinux_2_28_x86_64-hdf5-boost). -- [manylinux_2_28_aarch64-hdf5-boost](https://github.com/orgs/cantera/packages/container/package/manylinux_2_28_aarch64-hdf5-boost). +- [cantera-base-manylinux_2_28-x86_64](https://github.com/orgs/cantera/packages/container/package/manylinux_2_28_x86_64-hdf5-boost). +- [cantera-base-manylinux_2_28-aarch64](https://github.com/orgs/cantera/packages/container/package/manylinux_2_28_aarch64-hdf5-boost). diff --git a/libaec_cmakelists.patch b/libaec_cmakelists.patch deleted file mode 100644 index 71ae14c..0000000 --- a/libaec_cmakelists.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt 2024-07-16 15:43:44.268427707 +0000 -+++ CMakeLists.txt.new 2024-07-16 15:43:38.540403952 +0000 -@@ -12,6 +12,8 @@ - include(TestBigEndian) - test_big_endian(WORDS_BIGENDIAN) - -+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) -+ - # Check for __builtin_clzll for faster decoding - include(CheckCSourceCompiles) - check_c_source_compiles(