Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Musllinux #73

Merged
merged 7 commits into from
Mar 17, 2022
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
13 changes: 13 additions & 0 deletions .github/workflows/multibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ jobs:
PLAT: arm64
INTERFACE64: ''
platform: [x64]
- os: ubuntu-latest
PLAT: x86_64
INTERFACE64: '1'
MB_ML_LIBC: musllinux
MB_ML_VER: _1_1
platform: [x64]
- os: ubuntu-latest
PLAT: x86_64
INTERFACE64: ''
MB_ML_LIBC: musllinux
MB_ML_VER: _1_1
platform: [x64]
exclude:
- os: macos-latest
PLAT: i686
Expand All @@ -44,6 +56,7 @@ jobs:
MACOSX_DEPLOYMENT_TARGET: 10.9
MB_PYTHON_VERSION: ${{ matrix.python-version }}
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }}
MB_ML_VER: ${{ matrix.MB_ML_VER }}
INTERFACE64: ${{ matrix.INTERFACE64 }}
BUILD_DIR: ${{ github.workspace }}
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
url = https://github.com/xianyi/OpenBLAS.git
[submodule "multibuild"]
path = multibuild
url = https://github.com/matthew-brett/multibuild.git
url = https://github.com/multi-build/multibuild.git
[submodule "gfortran-install"]
path = gfortran-install
url = https://github.com/MacPython/gfortran-install.git
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ services: docker

matrix:
include:
- os: linux
arch: arm64
env:
- PLAT=aarch64
- MB_ML_VER=_1_1
- MB_ML_LIBC=musllinux
- DOCKER_TEST_IMAGE=multibuild/xenial_{PLAT}
- os: linux
arch: arm64
env:
- PLAT=aarch64
- INTERFACE64=1
- MB_ML_VER=_1_1
- MB_ML_LIBC=musllinux
- DOCKER_TEST_IMAGE=multibuild/xenial_{PLAT}
- os: linux
arch: arm64
env:
Expand Down
33 changes: 31 additions & 2 deletions travis-ci/build_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,33 @@ function before_build {
fi
}

function get_plat_tag {
# Copied from gfortran-install/gfortran_utils.sh, modified for MB_ML_LIBC

# Modify fat architecture tags on macOS to reflect compiled architecture
# For non-darwin, report manylinux version
local plat=$1
local mb_ml_ver=${MB_ML_VER:-1}
local mb_ml_libc=${MB_ML_LIBC:-manylinux}
case $plat in
i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le) ;;
*) echo Did not recognize plat $plat; return 1 ;;
esac
local uname=${2:-$(uname)}
if [ "$uname" != "Darwin" ]; then
if [ "$plat" == "intel" ]; then
echo plat=intel not allowed for Manylinux
return 1
fi
echo "${mb_ml_libc}${mb_ml_ver}_${plat}"
return
fi
# macOS 32-bit arch is i386
[ "$plat" == "i686" ] && plat="i386"
local target=$(echo $MACOSX_DEPLOYMENT_TARGET | tr .- _)
echo "macosx_${target}_${plat}"
}

function build_lib {
# OSX or manylinux build
#
Expand All @@ -48,7 +75,8 @@ function build_lib {
return
fi
# Manylinux wrapper
local docker_image=quay.io/pypa/manylinux${manylinux}_${plat}
local libc=${MB_ML_LIBC:-manylinux}
local docker_image=quay.io/pypa/${libc}${manylinux}_${plat}
docker pull $docker_image
# Docker sources this script, and runs `do_build_lib`
docker run --rm \
Expand All @@ -57,6 +85,7 @@ function build_lib {
-e INTERFACE64="${interface64}" \
-e PYTHON_VERSION="$MB_PYTHON_VERSION" \
-e MB_ML_VER=${manylinux} \
-e MB_ML_LIBC=${libc} \
-v $PWD:/io \
$docker_image /io/travis-ci/docker_build_wrap.sh
}
Expand Down Expand Up @@ -137,7 +166,7 @@ function do_build_lib {
&& make PREFIX=$BUILD_PREFIX $interface64_flags install )
stop_spinner
local version=$(cd OpenBLAS && git describe --tags --abbrev=8)
local plat_tag=$(get_distutils_platform_ex $plat)
local plat_tag=$(get_plat_tag $plat)
local suff=""
[ -n "$suffix" ] && suff="-$suffix"
if [ "$interface64" = "1" ]; then
Expand Down