Skip to content

Commit

Permalink
Add debian 9 based armhf cross compile build
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkaiser committed Nov 19, 2020
1 parent 339deb7 commit 1d358fc
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 17 deletions.
82 changes: 65 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,36 @@ debian-cmake-self-contained:

debian-self-contained-armhf:
stage: build
image: iffregistry.fz-juelich.de/docker-images/gr-build-images/$CI_JOB_NAME
tags:
- armhf
image: iffregistry.fz-juelich.de/docker-images/gr-build-images/$CI_JOB_NAME-cross
script:
- wget https://gr-framework.org/downloads/3rdparty/cmake-3.15.3-Linux-armhf.tar.gz
- tar xf cmake-3.15.3-Linux-armhf.tar.gz
- export CMAKE_CMD=`pwd`/cmake-3.15.3-Linux-armhf/bin/cmake
- make self GRDIR=/usr/local/gr
- make -C 3rdparty default extras \
HOST=arm-linux-gnueabihf \
ARCHITECTURE=arm \
OS=arm-linux-gnueabihf \
CC=arm-linux-gnueabihf-gcc \
CXX=arm-linux-gnueabihf-g++ \
AR=arm-linux-gnueabihf-ar \
STRIP=arm-linux-gnueabihf-strip \
PNG_EXTRA_CFLAGS="-DPNG_ARM_NEON_OPT=0" \
GLFW_EXTRA_CMAKE_FLAGS=-DCMAKE_TOOLCHAIN_FILE=`pwd`/cmake/armhf-linux-gnu.cmake \
OGG_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihf \
THEORA_EXTRA_CONFIGURE_FLAGS="--host=arm-linux --disable-asm" \
FFMPEG_EXTRA_CONFIGURE_FLAGS="--cross-prefix=arm-linux-gnueabihf- --arch=armhf --target-os=linux --pkg-config=pkg-config" \
PIXMAN_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihf \
CAIRO_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihfnu \
TIFF_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihf \
OPENH264_EXTRA_MAKE_FLAGS="OS=linux ARCH=armhf" \
ZEROMQ_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihf
- make self \
CC=arm-linux-gnueabihf-gcc \
LD=arm-linux-gnueabihf-ld \
AR=arm-linux-gnueabihf-ar \
CXX=arm-linux-gnueabihf-g++ \
LINK=arm-linux-gnueabihf-g++ \
QT_ARCH=armhf \
QT4_QMAKE=/usr/lib/arm-linux-gnueabihf/qt4/bin/qmake \
QT5_QMAKE=/usr/lib/arm-linux-gnueabihf/qt5/bin/qmake \
GRDIR=/usr/local/gr
- mkdir artifacts
- cp lib/gks/demo artifacts/gksdemo
- cp lib/gks/qt/gksqt artifacts/gksqt
Expand Down Expand Up @@ -325,21 +347,32 @@ debian-cmake-self-contained-aarch64:

debian-cmake-self-contained-armhf:
stage: build
image: iffregistry.fz-juelich.de/docker-images/gr-build-images/debian-self-contained-armhf
tags:
- armhf
image: iffregistry.fz-juelich.de/docker-images/gr-build-images/debian-self-contained-armhf-cross
script:
- wget https://gr-framework.org/downloads/3rdparty/cmake-3.15.3-Linux-armhf.tar.gz
- tar xf cmake-3.15.3-Linux-armhf.tar.gz
- export CMAKE_CMD=`pwd`/cmake-3.15.3-Linux-armhf/bin/cmake
- make -C 3rdparty default extras
- make -C 3rdparty default extras \
HOST=arm-linux-gnueabihf \
ARCHITECTURE=armhf \
OS=arm-linux-gnueabihf \
CC=arm-linux-gnueabihf-gcc \
CXX=arm-linux-gnueabihf-g++ \
AR=arm-linux-gnueabihf-ar \
STRIP=arm-linux-gnueabihf-strip \
PNG_EXTRA_CFLAGS="-DPNG_ARM_NEON_OPT=0" \
GLFW_EXTRA_CMAKE_FLAGS=-DCMAKE_TOOLCHAIN_FILE=`pwd`/cmake/armhf-linux-gnu.cmake \
OGG_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihf \
THEORA_EXTRA_CONFIGURE_FLAGS="--host=arm-linux --disable-asm" \
FFMPEG_EXTRA_CONFIGURE_FLAGS="--cross-prefix=arm-linux-gnueabihf- --arch=armhf --target-os=linux --pkg-config=pkg-config" \
PIXMAN_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihf \
CAIRO_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihf \
TIFF_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihf \
OPENH264_EXTRA_MAKE_FLAGS="OS=linux ARCH=armhf" \
ZEROMQ_EXTRA_CONFIGURE_FLAGS=--host=arm-linux-gnueabihf
- mkdir build
- cd build
- $CMAKE_CMD .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install -DGR_USE_BUNDLED_LIBRARIES=ON
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/gr -DCMAKE_TOOLCHAIN_FILE=../cmake/armhf-linux-gnu.cmake -DCMAKE_BUILD_TYPE=Release -DGR_USE_BUNDLED_LIBRARIES=ON
- make
- make install
- cd ..
- mv install artifacts-debian9-cmake-armhf
- mv /usr/local/gr ${CI_PROJECT_DIR}/artifacts-debian9-cmake-armhf
artifacts:
expire_in: 1 week
paths:
Expand All @@ -351,6 +384,21 @@ debian-system-dependencies:
script:
- make install GRDIR=/usr/local/gr

debian-system-dependencies-armhf:
stage: build
image: iffregistry.fz-juelich.de/docker-images/gr-build-images/$CI_JOB_NAME-cross
script:
- make install \
CC=arm-linux-gnueabihf-gcc \
LD=arm-linux-gnueabihf-ld \
AR=arm-linux-gnueabihf-ar \
CXX=arm-linux-gnueabihf-g++ \
LINK=arm-linux-gnueabihf-g++ \
QT_ARCH=armhf \
QT4_QMAKE=/usr/lib/arm-linux-gnueabihf/qt4/bin/qmake \
QT5_QMAKE=/usr/lib/arm-linux-gnueabihf/qt5/bin/qmake \
GRDIR=/usr/local/gr

debian-cmake-system-dependencies:
stage: build
image: iffregistry.fz-juelich.de/docker-images/gr-build-images/debian-system-dependencies
Expand Down
12 changes: 12 additions & 0 deletions cmake/armhf-linux-gnu.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR armhf)

set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
set(CMAKE_LINKER arm-linux-gnueabihf-ld)
set(CMAKE_STRIP arm-linux-gnueabihf-strip)
set(CMAKE_FIND_ROOT_PATH "/usr/lib/arm-linux-gnueabihf;/usr/arm-linux-gnueabihf")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)

0 comments on commit 1d358fc

Please sign in to comment.