Skip to content

Commit

Permalink
Travis-CI: add ARM64 Graviton2 build
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Mar 26, 2021
1 parent ca5ae4f commit 8c3758d
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,25 @@ matrix:
- BUILD_NAME=s390x
- DETAILS=""

- os: linux
arch: arm64-graviton2
virt: lxd
group: edge
compiler: gcc
language: cpp
sudo: false
dist: bionic
cache:
apt: true
directories:
- $HOME/.ccache
apt:
packages:
- ccache
env:
- BUILD_NAME=graviton2
- DETAILS=""

# - os: linux
# compiler: gcc
# language: cpp
Expand Down Expand Up @@ -172,7 +191,7 @@ script:
notifications:
irc:
channels:
- "irc.freenode.org#gdal-activity"
- "irc.freenode.org#gdal-activity"
#- "irc.freenode.org#gdal"
use_notice: true
on_success: change
Expand Down
11 changes: 11 additions & 0 deletions gdal/ci/travis/graviton2/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -e

sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-get update
sudo apt-get install -y --allow-unauthenticated python3-numpy libpng-dev libjpeg-dev libgif-dev liblzma-dev libgeos-dev libcurl4-gnutls-dev libproj-dev libxml2-dev libexpat-dev libxerces-c-dev libnetcdf-dev netcdf-bin libpoppler-dev libpoppler-private-dev libspatialite-dev gpsbabel swig libhdf4-alt-dev libhdf5-serial-dev poppler-utils libfreexl-dev unixodbc-dev libwebp-dev libepsilon-dev liblcms2-2 libpcre3-dev libcrypto++-dev libdap-dev libfyba-dev libkml-dev libmysqlclient-dev mysql-client-core-5.7 libogdi3.2-dev libcfitsio-dev openjdk-8-jdk libzstd1-dev ccache bash zip curl libpq-dev postgresql-client postgis cmake libssl-dev libboost-dev autoconf automake sqlite3 libopenexr-dev make python3-dev g++ fossil libgeotiff-dev libcharls-dev libopenjp2-7-dev libcairo2-dev

# Workaround bug in ogdi packaging
sudo ln -s /usr/lib/ogdi/libvrf.so /usr/lib
37 changes: 37 additions & 0 deletions gdal/ci/travis/graviton2/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh

set -e

SCRIPT_DIR=$(dirname "$0")
case $SCRIPT_DIR in
"/"*)
;;
".")
SCRIPT_DIR=$(pwd)
;;
*)
SCRIPT_DIR=$(pwd)/$(dirname "$0")
;;
esac
$SCRIPT_DIR/../common_install.sh

ccache -M 1G
ccache -s

# Build proj
sh -c "cd $PWD/proj && ./autogen.sh && CC='ccache gcc' CXX='ccache g++' CFLAGS='-DPROJ_RENAME_SYMBOLS' CXXFLAGS='-DPROJ_RENAME_SYMBOLS' ./configure --disable-static --prefix=/usr/local || cat config.log"
sh -c "cd $PWD/proj && CCACHE_CPP2=yes make -j3"
sudo sh -c "cd $PWD/proj && make -j3 install && mv /usr/local/lib/libproj.so.15.0.0 /usr/local/lib/libinternalproj.so.15.0.0 && rm /usr/local/lib/libproj.so* && rm /usr/local/lib/libproj.la && ln -s libinternalproj.so.15.0.0 /usr/local/lib/libinternalproj.so.15 && ln -s libinternalproj.so.15.0.0 /usr/local/lib/libinternalproj.so"

# Configure GDAL
sh -c "cd $PWD/gdal && CCACHE_CPP2=yes CC='ccache gcc' CXX='ccache g++' LDFLAGS='-lstdc++' ./configure --prefix=/usr --without-libtool --with-jpeg12 --with-python=/usr/bin/python3 --with-poppler --with-mysql --with-liblzma --without-webp --with-epsilon --with-proj=/usr/local --with-poppler --with-hdf5 --with-dods-root=/usr --with-sosi --with-mysql"

sh -c "cd $PWD/gdal && CCACHE_CPP2=yes make USER_DEFS=-Werror -j3"
sh -c "cd $PWD/gdal/apps && make USER_DEFS=-Werror -j3 test_ogrsf"
sudo sh -c "rm -f /usr/lib/libgdal.so*"
sudo sh -c "cd $PWD/gdal && make install"
sudo sh -c "sudo ldconfig"
sudo sh -c "ln -s libgdal.so /usr/lib/libgdal.so.20"
sh -c "cd $PWD/autotest/cpp && CCACHE_CPP2=yes make -j3"

ccache -s
19 changes: 19 additions & 0 deletions gdal/ci/travis/graviton2/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

set -e

export PYTEST="python3 -m pytest -vv -p no:sugar --color=no"

(cd "$PWD/autotest/cpp" && make quick_test || echo "error in quick_test")

# install pip and use it to install test dependencies
sudo sh -c "curl -sSL 'https://bootstrap.pypa.io/get-pip.py' | python3"
sudo pip3 install -U -r "$PWD/autotest/requirements.txt"

# Run all the Python autotests

# OSError: /var/snap/lxd/common/lxd/storage-pools/instances/containers/travis-job-osgeo-gdal-494090391/rootfs/usr/lib/aarch64-linux-gnu/libsqlite3.so.0.8.6: cannot open shared object file: No such file or directory
(cd autotest/ogr && pytest ogr_virtualogr.py) || echo "ogr_virtualogr.py failed"
rm autotest/ogr/ogr_virtualogr.py

cd autotest && $PYTEST

0 comments on commit 8c3758d

Please sign in to comment.