Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches:
- main
- maintenance/**
workflow_dispatch: null
schedule:
- cron: '0 0 * * 0'

env:
OPENBLAS_COMMIT: "v0.3.30-349-gf6df9beb"
MACOSX_DEPLOYMENT_TARGET: 10.9

jobs:
build:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/windows-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches:
- main
- maintenance/**

env:
OPENBLAS_COMMIT: "v0.3.30-349-gf6df9beb"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches:
- main
- maintenance/**
workflow_dispatch: null

env:
Expand Down
40 changes: 1 addition & 39 deletions ci-before-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# Most of the content in this file comes from https://github.com/multi-build/multibuild, with some modifications
# Follow the license below



# .. _license:

# *********************
Expand Down Expand Up @@ -41,9 +39,6 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



#! /bin/bash
set -xe

if [[ "$NIGHTLY" = "true" ]]; then
Expand All @@ -55,40 +50,6 @@ if [[ "$NIGHTLY" = "true" ]]; then
sed -e "s/^version = .*/version = \"${version}\"/" -i.bak pyproject.toml
fi


#!/bin/bash
# Utilities for both OSX and Docker Linux
# python or python3 should be on the PATH

# Only source common_utils once
if [ -n "$COMMON_UTILS_SOURCED" ]; then
return
fi
COMMON_UTILS_SOURCED=1

# Turn on exit-if-error
set -e

MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
DOWNLOADS_SDIR=downloads
PYPY_URL=https://downloads.python.org/pypy

if [ $(uname) == "Darwin" ]; then
IS_MACOS=1; IS_OSX=1;
else
# In the manylinux_2_24 image, based on Debian9, "python" is not installed
# so link in something for the various system calls before PYTHON_EXE is set
which python || export PATH=/opt/python/cp39-cp39/bin:$PATH

if [ "$MB_ML_LIBC" == "musllinux" ]; then
IS_ALPINE=1;
MB_ML_VER=${MB_ML_VER:-"_1_2"}
else
# Default Manylinux version
MB_ML_VER=${MB_ML_VER:-2014}
fi
fi

# Work round bug in travis xcode image described at
# https://github.com/direnv/direnv/issues/210
shell_session_update() { :; }
Expand All @@ -103,4 +64,5 @@ unset -f popd
# Build OpenBLAS
source build-openblas.sh

# Build wheel
source tools/build_prepare.sh
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "scipy-openblas64"
# v0.3.30-349-gf6df9beb
version = "0.3.30.349.0"
version = "0.3.30.349.1"
requires-python = ">=3.7"
description = "Provides OpenBLAS for python packaging"
readme = "README.md"
Expand Down Expand Up @@ -46,7 +46,6 @@ repair-wheel-command = "bash ci-repair-wheel.sh {dest_dir} {wheel}"
test-command = "cd {package} && bash ci-test.sh "
environment-pass = [
"OPENBLAS_COMMIT",
"MACOSX_DEPLOYMENT_TARGET",
"NIGHTLY",
"MB_ML_LIBC",
"MB_ML_VER",
Expand Down
82 changes: 27 additions & 55 deletions tools/build_steps.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
#!bash

# Build script for manylinux and OSX
BUILD_PREFIX=${BUILD_PREFIX:-/usr/local}

ROOT_DIR=$(dirname $(dirname "${BASH_SOURCE[0]}"))

MB_PYTHON_VERSION=3.9

function any_python {
for cmd in $PYTHON_EXE python3 python; do
if [ -n "$(type -t $cmd)" ]; then
echo $cmd
return
fi
done
echo "Could not find python or python3"
exit 1
}

function get_os {
# Report OS as given by uname
# Use any Python that comes to hand.
$(any_python) -c 'import platform; print(platform.uname()[0])'
}


function before_build {
# Manylinux Python version set in build_lib
if [ -n "$IS_OSX" ]; then
if [ "$(uname -s)" == "Darwin" ]; then
if [ ! -e /usr/local/lib ]; then
sudo mkdir -p /usr/local/lib
sudo chmod 777 /usr/local/lib
Expand All @@ -39,29 +23,39 @@ function before_build {
# get_macpython_environment ${MB_PYTHON_VERSION} venv
python3.9 -m venv venv
source venv/bin/activate
alias gfortran=gfortran-15

unalias gfortran 2>/dev/null || true
source tools/gfortran_utils.sh
download_and_unpack_gfortran ${PLAT} native
export FC=/opt/gfortran/gfortran-darwin-${PLAT}-native/bin/gfortran
which ${FC}
${FC} --version
local libdir=/opt/gfortran/gfortran-darwin-${PLAT}-native/lib
# Remove conflicting shared objects
rm -fv ${libdir}/libiconv*
export FFLAGS="-L${libdir} -Wl,-rpath,${libdir}"
# Not clear why this is needed for tests on arm64...
export LDFLAGS="$FFLAGS"

# Deployment target set by gfortran_utils
echo "Deployment target $MACOSX_DEPLOYMENT_TARGET"

# Build the objconv tool
(cd ${ROOT_DIR}/objconv && bash ../tools/build_objconv.sh)
if [[ ! -x objconv/objconv ]]; then
(cd ${ROOT_DIR}/objconv && bash ../tools/build_objconv.sh)
fi
fi
}

function clean_code {
set -ex
# Copied from common_utils.sh, with added debugging
local build_commit=$1
[ -z "$build_commit" ] && echo "build_commit not defined" && exit 1
pushd OpenBLAS
git fetch origin --tags
echo after git fetch origin
git checkout $build_commit
echo after git checkout $build_commit
git clean -fxd
echo after git clean
git submodule update --init --recursive
echo after git submodule update
popd
}

Expand Down Expand Up @@ -108,12 +102,7 @@ function build_lib {
local interface64=${2:-$INTERFACE64}
local nightly=${3:0}
local manylinux=${MB_ML_VER:-1}
if [ -n "$IS_OSX" ]; then
# Do build, add gfortran hash to end of name
do_build_lib "$plat" "gf_${GFORTRAN_SHA:0:7}" "$interface64" "$nightly"
else
do_build_lib "$plat" "" "$interface64" "$nightly"
fi
do_build_lib "$plat" "$interface64" "$nightly"
}

function patch_source {
Expand All @@ -129,19 +118,16 @@ function do_build_lib {
# Build openblas lib
# Input arg
# plat - one of i686, x86_64, arm64
# suffix (optional) - suffix for output archive name
# Suffix added with hyphen prefix
# interface64 (optional) - whether to build ILP64 openblas
# with 64_ symbol suffix
# nightly (optional) - whether to build for nightlies
#
# Depends on globals
# BUILD_PREFIX - install suffix e.g. "/usr/local"
local plat=$1
local suffix=$2
local interface64=$3
local nightly=$4
case $(get_os)-$plat in
local interface64=$2
local nightly=$3
case $(uname -s)-$plat in
Linux-x86_64)
local bitness=64
local target="PRESCOTT"
Expand All @@ -150,16 +136,8 @@ function do_build_lib {
Darwin-x86_64)
local bitness=64
local target="CORE2"
# Use gfortran-11
unalias gfortran
# Since install_fortran uses `uname -a` to determine arch,
# force the architecture
arch -${PLAT} bash -s << EOF
source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh
install_gfortran
EOF
export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH
CFLAGS="$CFLAGS -arch x86_64"
MACOSX_DEPLOYMENT_TARGET="10.9"
export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)}
local dynamic_list="CORE2 NEHALEM SANDYBRIDGE HASWELL SKYLAKEX"
;;
Expand All @@ -171,8 +149,8 @@ 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
# manylinux2014 image uses gcc-10, which miscompiles ARMV8SVE and up
echo setting DYNAMIC_LIST for manylinux2014 to ARMV8 only
local dynamic_list="ARMV8"
fi
Expand All @@ -183,7 +161,6 @@ EOF
CFLAGS="$CFLAGS -ftrapping-math -mmacos-version-min=11.0"
MACOSX_DEPLOYMENT_TARGET="11.0"
export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)}
export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH
;;
*-s390x)
local bitness=64
Expand All @@ -201,9 +178,6 @@ EOF
1)
local interface_flags="INTERFACE64=1 SYMBOLSUFFIX=64_ LIBNAMESUFFIX=64_ OBJCONV=$PWD/objconv/objconv";
local symbolsuffix="64_";
if [ -n "$IS_OSX" ]; then
$PWD/objconv/objconv --help
fi
;;
*)
local interface_flags="OBJCONV=$PWD/objconv/objconv"
Expand Down Expand Up @@ -246,8 +220,6 @@ EOF
fi
mv $BUILD_PREFIX/lib/pkgconfig/openblas*.pc $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc
local plat_tag=$(get_plat_tag $plat)
local suff=""
[ -n "$suffix" ] && suff="-$suffix"
if [ "$interface64" = "1" ]; then
# OpenBLAS does not install the symbol suffixed static library,
# do it ourselves
Expand All @@ -260,7 +232,7 @@ EOF
rm $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc.bak
fi

local out_name="openblas${symbolsuffix}-${version}-${plat_tag}${suff}.tar.gz"
local out_name="openblas${symbolsuffix}-${version}-${plat_tag}.tar.gz"
tar zcvf libs/$out_name \
$BUILD_PREFIX/include/*blas* \
$BUILD_PREFIX/include/*lapack* \
Expand Down
5 changes: 3 additions & 2 deletions tools/docker_build_wrap.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash
# Depends on:
# BUILD_PREFIX
# PLAT
# INTERFACE64 (could be missing or empty)
# NIGHTLY (could be missing or empty)
set -e

# Change into root directory of repo
if [[ ! -e tools/build_steps.sh ]];then
cd /io
fi
source tools/build_steps.sh
do_build_lib "$PLAT" "" "$INTERFACE64" "$NIGHTLY"
do_build_lib "$PLAT" "$INTERFACE64" "$NIGHTLY"
Loading
Loading