diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index 067eba1..21d197d 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -10,7 +10,7 @@ on: - cron: '0 0 * * 0' env: - OPENBLAS_COMMIT: "v0.3.30-349-gf6df9beb" + OPENBLAS_COMMIT: "v0.3.30-359-g29fab2b9" MACOSX_DEPLOYMENT_TARGET: 10.9 jobs: @@ -39,12 +39,16 @@ jobs: - { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} - { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '1', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} - - { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '0', MB_ML_VER: '_2_28', MB_ML_LIBC: manylinux} - - { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '1', MB_ML_VER: '_2_28', MB_ML_LIBC: manylinux} - { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '0', MB_ML_VER: '_1_2', MB_ML_LIBC: musllinux} - { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '1', MB_ML_VER: '_1_2', MB_ML_LIBC: musllinux} + - { os: ubuntu-24.04-arm, PLAT: ppc64le, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} + - { os: ubuntu-24.04-arm, PLAT: ppc64le, INTERFACE64: '1', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} + + - { os: ubuntu-24.04-arm, PLAT: s390x, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} + - { os: ubuntu-24.04-arm, PLAT: s390x, INTERFACE64: '1', MB_ML_VER: '2014', MB_ML_LIBC: manylinux} + env: NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }} @@ -70,6 +74,12 @@ jobs: with: xcode-version: '15.4' + - name: Set up QEMU + if: matrix.PLAT == 'ppc64le' || matrix.PLAT == 's390x' + uses: docker/setup-qemu-action@v3 + with: + platforms: all + - name: Print some Environment variable run: | echo "PLAT: ${PLAT}" @@ -81,7 +91,8 @@ jobs: # limit-access-to-actor: true - name: Build and Test wheels - uses: pypa/cibuildwheel@v3.1.4 + uses: pypa/cibuildwheel@v3.3.0 + timeout-minutes: 60 with: output-dir: dist env: diff --git a/.github/workflows/windows-arm.yml b/.github/workflows/windows-arm.yml index 2b56e82..fc700c8 100644 --- a/.github/workflows/windows-arm.yml +++ b/.github/workflows/windows-arm.yml @@ -7,7 +7,7 @@ on: branches: [ main ] env: - OPENBLAS_COMMIT: "v0.3.30-349-gf6df9beb" + OPENBLAS_COMMIT: "v0.3.30-359-g29fab2b9" OPENBLAS_ROOT: "c:\\opt" # Preserve working directory for calls into bash # Without this, invoking bash will cd to the home directory diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 09599c6..e7caa9d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: null env: - OPENBLAS_COMMIT: "v0.3.30-349-gf6df9beb" + OPENBLAS_COMMIT: "v0.3.30-359-g29fab2b9" OPENBLAS_ROOT: "c:\\opt" # Preserve working directory for calls into bash # Without this, invoking bash will cd to the home directory diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6ca6247..0000000 --- a/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -env: - global: - # The archive that gets built has name from ``git describe`` on this - # commit. - - OPENBLAS_COMMIT: "v0.3.30-349-gf6df9beb" - -dist: jammy -services: docker - -jobs: - include: - - os: linux - arch: s390x - env: - - PLAT=s390x - - MB_ML_VER=2014 - - INTERFACE64=0 - - os: linux - arch: s390x - env: - - PLAT=s390x - - INTERFACE64=1 - - MB_ML_VER=2014 - - os: linux - arch: ppc64le - env: - - PLAT=ppc64le - - MB_ML_VER=2014 - - INTERFACE64=0 - - os: linux - arch: ppc64le - env: - - PLAT=ppc64le - - INTERFACE64=1 - - MB_ML_VER=2014 - -before_install: - - source tools/build_steps.sh - - before_build - -install: - # Maybe get and clean and patch source - - | - if [ ${TRAVIS_EVENT_TYPE} == "cron" ]; then - clean_code develop - else - clean_code $OPENBLAS_COMMIT - fi - echo done install step - -script: - # Build library and collect into libs subdirectory - - travis_wait 30 build_on_travis - - libc=${MB_ML_LIBC:-manylinux} - - docker_image=quay.io/pypa/${libc}${MB_ML_VER}_${PLAT} - - docker run --rm -e INTERFACE64="${INTERFACE64}" -e MB_ML_LIBC="${MB_ML_LIBC}" -v $(pwd):/openblas "${docker_image}" /bin/bash -xe /openblas/tools/build_wheel.sh - -after_success: - - set +ex - - sudo chmod -R a+w /home/travis/.cache - - pip install -q git+https://github.com/Anaconda-Platform/anaconda-client@1.13.0 - # Upload libraries to the shared staging area on anaconda.org - - sudo chmod -R a+w dist - - source tools/upload_to_anaconda_staging.sh - - upload_wheels diff --git a/OpenBLAS b/OpenBLAS index f6df9be..29fab2b 160000 --- a/OpenBLAS +++ b/OpenBLAS @@ -1 +1 @@ -Subproject commit f6df9bebbb4259aa61ab5634c0f1269fb152cc0e +Subproject commit 29fab2b912d3130b3caa84c2c1178f94ed25d1a6 diff --git a/ci-before-build.sh b/ci-before-build.sh index f2dc8a3..354f69d 100755 --- a/ci-before-build.sh +++ b/ci-before-build.sh @@ -1,7 +1,7 @@ #! /bin/bash -# Most of the content in this file comes from https://github.com/multi-build/multibuild, with some modifications +# Most of the content in this file comes from https://github.com/multi-build/multibuild, with some modifications # Follow the license below @@ -87,6 +87,8 @@ else # Default Manylinux version MB_ML_VER=${MB_ML_VER:-2014} fi + ./tools/install-static-clang.sh + export PATH=/opt/clang/bin:$PATH fi # Work round bug in travis xcode image described at diff --git a/pyproject.toml b/pyproject.toml index c956d4c..58a9f25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,8 +8,8 @@ build-backend = "setuptools.build_meta" [project] name = "scipy-openblas64" -# v0.3.30-349-gf6df9beb -version = "0.3.30.349.0" +# v0.3.30-359-g29fab2b9 +version = "0.3.30.359.0" requires-python = ">=3.7" description = "Provides OpenBLAS for python packaging" readme = "README.md" @@ -43,7 +43,7 @@ scipy_openblas64 = ["lib/*", "include/*", "lib/pkgconfig/*", "lib/cmake/openblas [tool.cibuildwheel] before-build = "bash ci-before-build.sh" repair-wheel-command = "bash ci-repair-wheel.sh {dest_dir} {wheel}" -test-command = "cd {package} && bash ci-test.sh " +test-command = "cd {package} && bash ci-test.sh" environment-pass = [ "OPENBLAS_COMMIT", "MACOSX_DEPLOYMENT_TARGET", @@ -54,4 +54,7 @@ environment-pass = [ "BUILD_DIR", "PLAT", "OS-NAME", + "RUNNER_ARCH", ] +[tool.cibuildwheel.linux] +environment = { CC = "/opt/clang/bin/clang", CXX = "/opt/clang/bin/clang++", LDFLAGS = "-fuse-ld=lld" } diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 6aacb01..8489cba 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -58,7 +58,7 @@ function clean_code { echo after git fetch origin git checkout $build_commit echo after git checkout $build_commit - git clean -fxd + git clean -fxd echo after git clean git submodule update --init --recursive echo after git submodule update @@ -171,11 +171,6 @@ EOF Linux-aarch64) local bitness=64 local target="ARMV8" - # manylinux2014 image uses gcc-10, which miscompiles ARMV8SVE and up - if [ "$MB_ML_VER" == "2014" ]; then - echo setting DYNAMIC_LIST for manylinux2014 to ARMV8 only - local dynamic_list="ARMV8" - fi ;; Darwin-arm64) local bitness=64 @@ -186,7 +181,10 @@ EOF export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH ;; *-s390x) + # The TargetList.txt has only ZARCH_GENERIC, Z13, Z14. Not worth + # messing with dynamic lists. local bitness=64 + local target="ZARCH_GENERIC" ;; *-ppc64le) local bitness=64 @@ -222,6 +220,13 @@ EOF echo -n > utest/test_dsdot.c echo "Due to the qemu versions 7.2 causing utest cases to fail," echo "the utest dsdot:dsdot_n_1 have been temporarily disabled." + elif [ "$plat" == "s390x" ]; then + sed -i 's/CTEST(samin, positive_step_1_N_70){/CTEST_SKIP(samin, positive_step_1_N_70){/g' ./utest/test_extensions/test_samin.c + sed -i 's/CTEST(samin, negative_step_1_N_70){/CTEST_SKIP(samin, negative_step_1_N_70){/g' ./utest/test_extensions/test_samin.c + sed -i 's/CTEST(damin, positive_step_1_N_70){/CTEST_SKIP(damin, positive_step_1_N_70){/g' ./utest/test_extensions/test_damin.c + sed -i 's/CTEST(damin, negative_step_1_N_70){/CTEST_SKIP(damin, negative_step_1_N_70){/g' ./utest/test_extensions/test_damin.c + echo "the utest samin/damin have been temporarily disabled." + echo "QEMU does not support the 'lper' /'lpdr' instructions used" fi if [ -n "$dynamic_list" ]; then CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \ diff --git a/tools/install-static-clang.sh b/tools/install-static-clang.sh new file mode 100755 index 0000000..b146b20 --- /dev/null +++ b/tools/install-static-clang.sh @@ -0,0 +1,90 @@ +#!/bin/bash + +# Stop at any error, show all commands +set -exuo pipefail + +TOOLCHAIN_PATH=/opt/clang + +# Download static-clang +DEFAULT_ARCH="$(uname -m)" +if [ "${STATIC_CLANG_ARCH:-}" == "" ]; then + STATIC_CLANG_ARCH="${RUNNER_ARCH:-${DEFAULT_ARCH}}" +fi +case "${STATIC_CLANG_ARCH}" in + ARM64|aarch64|arm64|arm64/*) GO_ARCH=arm64;; + ARM|armv7l|armv8l|arm|arm/v7) GO_ARCH=arm;; # assume arm/v7 for arm + X64|x86_64|amd64|amd64/*) GO_ARCH=amd64;; + X86|i686|386) GO_ARCH=386;; + ppc64le) GO_ARCH=ppc64le;; + riscv64) GO_ARCH=riscv64;; + s390x) GO_ARCH=s390x;; + *) echo "No static-clang toolchain for ${CLANG_ARCH}">2; exit 1;; +esac +STATIC_CLANG_VERSION=21.1.6.0 +STATIC_CLANG_FILENAME="static-clang-linux-${GO_ARCH}.tar.xz" +STATIC_CLANG_URL="https://github.com/mayeut/static-clang-images/releases/download/v${STATIC_CLANG_VERSION}/${STATIC_CLANG_FILENAME}" +pushd /tmp +cat<<'EOF' | grep "${STATIC_CLANG_FILENAME}" > "${STATIC_CLANG_FILENAME}.sha256" +3f92a131d27ca606dae8230550236a0c897a7f5990d61a293814e0abea8d0e1f static-clang-linux-386.tar.xz +3fc6a3500cb9514b2c3af6d4a95676842769c301f872b6cea8c15576a64e756c static-clang-linux-amd64.tar.xz +82ea0c148ec75f72a2f6f61cc877561efe9675c6e59a1a2c4d130f088f9dc868 static-clang-linux-arm.tar.xz +9b5ad28877b6d56aff530164f7f88590e5d3441a1fddd7a73370539783056120 static-clang-linux-arm64.tar.xz +2adccbcad99d033222c8a63872739919375a7aef2339ce2e8ab7dcfc938502b1 static-clang-linux-loong64.tar.xz +5f551911ad73ecbbcf278e6d05a04bc68bd0dc4918a6a145352072f7734959c6 static-clang-linux-ppc64le.tar.xz +90f5beda1004bec124607df1f9fc0a70c2b9f382b82ab1db2703ebd131c920ef static-clang-linux-riscv64.tar.xz +e4047765a5e64bace4be36f6aae4d859e96bc1298d3ff5ba6b7d6100ea7d23f7 static-clang-linux-s390x.tar.xz +EOF +curl -fsSLO "${STATIC_CLANG_URL}" +sha256sum -c "${STATIC_CLANG_FILENAME}.sha256" +tar -C /opt -xf "${STATIC_CLANG_FILENAME}" +popd + +# configure target triple +case "${AUDITWHEEL_POLICY}-${AUDITWHEEL_ARCH}" in + manylinux*-armv7l) TARGET_TRIPLE=armv7-unknown-linux-gnueabihf;; + musllinux*-armv7l) TARGET_TRIPLE=armv7-alpine-linux-musleabihf;; + manylinux*-ppc64le) TARGET_TRIPLE=powerpc64le-unknown-linux-gnu;; + musllinux*-ppc64le) TARGET_TRIPLE=powerpc64le-alpine-linux-musl;; + manylinux*-*) TARGET_TRIPLE=${AUDITWHEEL_ARCH}-unknown-linux-gnu;; + musllinux*-*) TARGET_TRIPLE=${AUDITWHEEL_ARCH}-alpine-linux-musl;; +esac +case "${AUDITWHEEL_POLICY}-${AUDITWHEEL_ARCH}" in + *-riscv64) M_ARCH="-march=rv64gc";; + *-x86_64) M_ARCH="-march=x86-64";; + *-armv7l) M_ARCH="-march=armv7a";; + manylinux*-i686) M_ARCH="-march=k8 -mtune=generic";; # same as gcc manylinux2014 / manylinux_2_28 + musllinux*-i686) M_ARCH="-march=pentium-m -mtune=generic";; # same as gcc musllinux_1_2 +esac +GCC_TRIPLE=$(gcc -dumpmachine) + +cat<"${TOOLCHAIN_PATH}/bin/${AUDITWHEEL_PLAT}.cfg" + -target ${TARGET_TRIPLE} + ${M_ARCH:-} + --gcc-toolchain=${DEVTOOLSET_ROOTPATH:-}/usr + --gcc-triple=${GCC_TRIPLE} +EOF + +cat<"${TOOLCHAIN_PATH}/bin/clang.cfg" + @${AUDITWHEEL_PLAT}.cfg +EOF + +cat<"${TOOLCHAIN_PATH}/bin/clang++.cfg" + @${AUDITWHEEL_PLAT}.cfg +EOF + +cat<"${TOOLCHAIN_PATH}/bin/clang-cpp.cfg" + @${AUDITWHEEL_PLAT}.cfg +EOF + +# override entrypoint to add the toolchain to PATH +mv /usr/local/bin/manylinux-entrypoint /usr/local/bin/manylinux-entrypoint-org +cat</usr/local/bin/manylinux-entrypoint +#!/bin/bash + +set -eu + +export PATH="${TOOLCHAIN_PATH}/bin:\${PATH}" +exec /usr/local/bin/manylinux-entrypoint-org "\$@" +EOF + +chmod +x /usr/local/bin/manylinux-entrypoint