Skip to content

Hack for numpy.libs. #50

Hack for numpy.libs.

Hack for numpy.libs. #50

Workflow file for this run

# Create AppImages on a github release event. This assumes that the
# cadabra version is the same as the release name, and it will attempt
# to add the .AppImage files to the release assets.
name: AppImage
on: [push]
# on:
# release:
# types: [created]
jobs:
build:
runs-on: ubuntu-20.04
name: AppImage on ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
distro: ubuntu20.04
# - arch: aarch64
# distro: ubuntu20.04
steps:
- name: Setup GitHub CLI
run: |
sudo apt-get update
sudo apt-get install -y gh
- name: Authenticate GitHub CLI
run: gh auth setup-git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@master
name: Checkout source
- name: Native build
if: ${{ contains(matrix.arch, 'x86') }}
id: build-native
run: |
sudo apt update -q -y
sudo DEBIAN_FRONTEND=noninteractive apt install -y git cmake python3-dev python3-pip g++ libpcre3 libpcre3-dev libgmp3-dev libgtkmm-3.0-dev libboost-all-dev libgmp-dev libsqlite3-dev uuid-dev libmpfr-dev libmpc-dev && python3 --version && which python3 && python3 -m pip install --upgrade pip && python3 -m pip install wheel && python3 -m pip install sympy gmpy2 numpy
mkdir build
cd build
cmake -DENABLE_MATHEMATICA=OFF -DAPPIMAGE_MODE=ON -DCMAKE_INSTALL_PREFIX=/usr ..
make DESTDIR=AppDir
make install DESTDIR=AppDir
ls -laR AppDir/usr/lib/python3.8/
# hack to make linuxdeploy find the numpy.libs libraries
sudo cp AppDir/usr/lib/python3.8/dist-packages/numpy.libs/* /usr/lib
sudo ldconfig -v
make appimage
mkdir -p ${{ github.workspace }}/artifacts
cp Cadabra*.AppImage ${{ github.workspace }}/artifacts
- name: QEMU build ${{ matrix.arch }}
if: ${{ !contains(matrix.arch, 'x86') }}
uses: uraimo/run-on-arch-action@master
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
githubToken: ${{ github.token }}
setup: |
mkdir -p ${{ github.workspace }}/artifacts
dockerRunArgs:
--volume "${{ github.workspace }}/artifacts:/artifacts"
shell: /bin/sh
install: |
apt update -q -y
DEBIAN_FRONTEND=noninteractive apt install -y git wget gpg
# Get current cmake (we need at least 3.21 for linuxdeploy)
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
apt update -y
apt install -y kitware-archive-keyring
apt install -y cmake
apt upgrade -y
cmake --version
# Install the rest.
DEBIAN_FRONTEND=noninteractive apt install -y git cmake python3-dev python3-pip g++ libpcre3 libpcre3-dev libgmp3-dev libgtkmm-3.0-dev libboost-all-dev libgmp-dev libsqlite3-dev uuid-dev libmpfr-dev libmpc-dev python3-gmpy2 && python3 --version && which python3 && python3 -m pip install --upgrade pip && python3 -m pip install wheel && python3 -m pip install sympy numpy
DEBIAN_FRONTEND=noninteractive apt install -y cimg-dev libgtest-dev ca-certificates libgpgme-dev libssh-gcrypt-dev libcurl4-gnutls-dev patchelf squashfs-tools desktop-file-utils
# Build appimagetool, linuxdeploy and linuxdeploy-plugin-appimage, as we
# cannot run the linuxdeploy.AppImage inside QEMU.
mkdir linuxdeploy
cd linuxdeploy
git clone https://github.com/AppImage/appimagetool.git --recurse-submodules
git clone https://github.com/linuxdeploy/linuxdeploy.git --recurse-submodules
git clone https://github.com/linuxdeploy/linuxdeploy-plugin-appimage.git --recurse-submodules
(cd appimagetool && mkdir build && cd build && cmake .. && make install)
(cd linuxdeploy && mkdir build && cd build && cmake -DBUILD_TESTING=OFF .. && make install)
(cd linuxdeploy-plugin-appimage && mkdir build && cd build && cmake -DBUILD_TESTING=OFF .. && make install)
run: |
mkdir build
cd build
git config --global --add safe.directory /home/runner/work/cadabra2/cadabra2
cmake -DENABLE_MATHEMATICA=OFF -DAPPIMAGE_MODE=ON -DCMAKE_INSTALL_PREFIX=/usr ..
make
make install DESTDIR=AppDir
ls -laR AppDir/usr/lib/python3.8/
make appimage
cp Cadabra*.AppImage /artifacts
- name: Set version variables from output of cmake
run: |
VER=$(cat ${{ github.workspace }}/build/VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Upload release assets
run: |
ls ${{ github.workspace }}/artifacts/
gh release upload "${{ env.VERSION }}" ${{ github.workspace }}/artifacts/Cadabra_${{ env.VERSION }}_${{ matrix.arch }}.AppImage --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}