Skip to content

Commit

Permalink
Add aarch64 workflow and patch
Browse files Browse the repository at this point in the history
  • Loading branch information
grimbough committed Apr 3, 2024
1 parent 0a56f04 commit cc47c6b
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 8 deletions.
164 changes: 164 additions & 0 deletions .github/workflows/arm64-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: test build deploy

on:
# push:
# branches:
# - main
# - h5s_unlimited
workflow_dispatch:

env:
PKG: 'Rhdf5lib'

jobs:
install-depdendencies:
name: Install package dependencies
runs-on: ubuntu-22.04

steps:
- name: checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Make R library
run: mkdir -p ${RUNNER_TEMP}/R-lib

- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/R-lib
key: R_lib-ARM64-${{ hashFiles('**/DESCRIPTION') }}
restore-keys: |
R_lib-ARM64-${{ hashFiles('**/DESCRIPTION') }}
R_lib-ARM64-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GRCH_TOKEN }}

- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64
options: |
--platform linux/arm64
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
run: |
uname -a
echo "options(Ncpus=4L, timeout = 300)" >> ~/.Rprofile
Rscript -e "library(remotes)" -e "dev_package_deps('/build/${PKG}', dependencies = TRUE) |> update(upgrade = 'always')"
check-arm64:
name: Test package on ARM64
runs-on: ubuntu-22.04
needs: install-depdendencies
steps:

- name: checkout
uses: actions/checkout@v3

- name: Make R library
run: mkdir -p ${RUNNER_TEMP}/R-lib

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/R-lib
key: R_lib-ARM64-${{ hashFiles('**/DESCRIPTION') }}
restore-keys: |
R_lib-ARM64-${{ hashFiles('**/DESCRIPTION') }}
R_lib-ARM64-
- name: R CMD INSTALL
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64
options: |
--platform linux/arm64
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
--workdir /build
run: |
ls -l
R CMD INSTALL ${PKG} &> ${PKG}.install-out.txt
ls -l
shell: bash

- name: R CMD build
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64
options: |
--platform linux/arm64
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
--workdir /build
run: |
ls -l "${R_LIBS_USER}"
R CMD build --keep-empty-dirs --no-resave-data ${PKG}
ls -l
- name: R CMD check
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64
options: |
--platform linux/arm64
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
--workdir /build
run: |
ls -l
R CMD check --install=check:${PKG}.install-out.txt --library="${R_LIBS_USER}" --no-vignettes --timings ${PKG}*.tar.gz
cat ${PKG}.install-out.txt
ls -l
- name: Build Package Binary
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64
options: |
--platform linux/arm64
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
--workdir /build
run: |
mkdir -p ${PKG}.buildbin-libdir
R CMD INSTALL --build --library=${PKG}.buildbin-libdir ${PKG}*.tar.gz
ls -l
- uses: actions/upload-artifact@v4
if: always()
with:
name: my-artifact
path: |
~/**/*.tar.gz
~/**/*.install-out.txt
~/**/*.Rcheck
if-no-files-found: warn

2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "

## add "-ucrt" to the library directory if needed
## this might be removed in the future - 2021-01-20
if(!is.null(R.version$crt) && R.version$crt == "ucrt") {
if(!is.null(R.version$crt) && R.version$crt == "ucrt" && R.version$arch == "x86_64") {
patharch <- paste0(patharch, "-ucrt")
}

Expand Down
31 changes: 24 additions & 7 deletions configure.ucrt
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
#!/bin/sh

#untar the lib
BASEPBNAME="hdf5"
PBTGZNAME=hdf5_headers_1.10.7.tar.gz
cd src
if test -d ${BASEPBNAME}; then
ARCH=`$R_HOME/bin/Rscript --no-echo -e 'cat(R.version$arch)'`

if [ X$ARCH == Xx86_64 ] ; then
#untar the lib
BASEPBNAME="hdf5"
PBTGZNAME=hdf5_headers_1.10.7.tar.gz
cd src
if test -d ${BASEPBNAME}; then
echo 'found ' $BASEPBNAME ' header sources; using what is there.'
else
else
echo "untarring $PBTGZNAME ...";
## we'll use Rscript to untar the file
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "untar('wininclude/$PBTGZNAME')"
fi;
fi
else
if which lld >/dev/null 2>/dev/null ; then
./configure LD=lld CPPFLAGS=-Wno-implicit-function-declaration $*
else
./configure $*
fi

cp src/Makevars src/Makevars.ucrt
if which lld >/dev/null ; then
sed -i -e 's!LDFLAGS=!LD=lld \0!g' \
-e "s!CPPFLAGS='!CPPFLAGS='-Wno-implicit-function-declaration!g" \
-e 's!PKG_LIBS = .*!\0 -ldl!g' \
src/Makevars.ucrt
fi
fi

0 comments on commit cc47c6b

Please sign in to comment.