Skip to content
Closed
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
18 changes: 11 additions & 7 deletions .github/actions/deploy-ubuntu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ runs:
$SUDO rm -rf /usr/local/lib/android
$SUDO rm -rf /usr/share/dotnet

# Allocate a swapfile on Linux as it's not enabled by default. Needed for pytorch and mkl.
$SUDO fallocate -l 4GB /swapfile
$SUDO chmod 600 /swapfile
$SUDO mkswap /swapfile
$SUDO swapon /swapfile || true

# fallocate fails on arm64 runners
if [[ ! "$CI_DEPLOY_PLATFORM" == "linux-arm64" ]]; then
# Allocate a swapfile on Linux as it's not enabled by default. Needed for pytorch and mkl.
$SUDO fallocate -l 4GB /swapfile
$SUDO chmod 600 /swapfile
$SUDO mkswap /swapfile
$SUDO swapon /swapfile || true
fi
mkdir -p .ccache
echo "max_size = 2.0G" > .ccache/ccache.conf
echo "hash_dir = false" >> .ccache/ccache.conf
Expand Down Expand Up @@ -78,7 +80,9 @@ runs:
source /etc/os-release
export CODENAME=$UBUNTU_CODENAME

if [[ ! "$ARCH" == "amd64" ]]; then
# arm64 runners don't work with apt-spy2,
# the selected mirrors don't have arm64 binaries
if [[ ! "$ARCH" == "amd64" && ! "$ARCH" == "arm64" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this when cross compiling though. Please disable it only when we're running on ARM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

# https://github.com/actions/runner-images/issues/675
$SUDO gem install apt-spy2
$SUDO apt-spy2 check
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
# runs-on: ubuntu-22.04
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# linux-arm64:
# runs-on: ubuntu-22.04
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
linux-arm64:
runs-on: ubuntu-22.04-arm
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# linux-ppc64le:
# runs-on: ubuntu-22.04
# steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/numpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
# runs-on: ubuntu-22.04
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# linux-arm64:
# runs-on: ubuntu-22.04
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
linux-arm64:
runs-on: ubuntu-22.04-arm
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# linux-ppc64le:
# runs-on: ubuntu-22.04
# steps:
Expand Down
7 changes: 6 additions & 1 deletion cpython/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ case $PLATFORM in
linux-arm64)
CFLAGS="-march=armv8-a+crypto -mcpu=cortex-a57+crypto"
cd ../$OPENSSL
./Configure $OS-$ARCH -fPIC no-shared --prefix=$INSTALL_PATH/host --libdir=lib
OPENSSL_PLATFORM=$OS-$ARCH
if [[ "$OPENSSL_PLATFORM" == "linux-arm64" ]]; then
# OpenSSL doesn't recognize arm64 as a valid architecture
OPENSSL_PLATFORM="linux-aarch64"
fi
./Configure $OPENSSL_PLATFORM -fPIC no-shared --prefix=$INSTALL_PATH/host --libdir=lib
make -s -j $MAKEJ
make install_sw
make distclean
Expand Down
7 changes: 5 additions & 2 deletions numpy/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ fi
export PYTHONPATH="$PYTHON_INSTALL_PATH"
mkdir -p "$PYTHON_INSTALL_PATH"

# Pip isn't installed by default, so make sure it is
$PYTHON_BIN_PATH -m ensurepip

TOOLS="setuptools==67.6.1 cython==3.0.10"
if ! $PYTHON_BIN_PATH -m pip install --target=$PYTHON_LIB_PATH $TOOLS; then
echo "extra_link_args = -lgfortran" >> site.cfg
Expand All @@ -93,6 +96,8 @@ if ! $PYTHON_BIN_PATH -m pip install --target=$PYTHON_LIB_PATH $TOOLS; then

# crossenv 1.4 for python 3.11+ support.
# See https://github.com/bytedeco/javacpp-presets/issues/1381
# NOTE: Cross-compilation to arm may not work, it is recommended
# to compile on real hardware using e.g. Github Action's ARM runners
"$CPYTHON_HOST_PATH/bin/python3.13" -m pip install --target="$CPYTHON_HOST_PATH/lib/python3.13/" crossenv==1.4 $TOOLS
"$CPYTHON_HOST_PATH/bin/python3.13" -m crossenv "$PYTHON_BIN_PATH" crossenv
source crossenv/bin/activate
Expand All @@ -108,8 +113,6 @@ case $PLATFORM in
arm-linux-gnueabihf-strip $(find ../ -iname *.so)
;;
linux-arm64)
rm -f meson.build pyproject.toml
mv pyproject.toml.setuppy pyproject.toml
ATLAS=None CC="aarch64-linux-gnu-gcc -mabi=lp64" CFLAGS="-O2" "$PYTHON_BIN_PATH" -m pip install . --prefix $INSTALL_PATH
aarch64-linux-gnu-strip $(find ../ -iname *.so)
;;
Expand Down
Loading