Skip to content

Commit

Permalink
Upgrade arm - closes #7573 (#7611)
Browse files Browse the repository at this point in the history
#changelog #armv6
  • Loading branch information
ofTheo committed Aug 23, 2023
1 parent 11cdc79 commit af60234
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 42 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-linux-armv6.yml
@@ -0,0 +1,37 @@
name: build-linux-arm

# make the action not run on the local repo if the branch is also in a pull request to OF/OF
on:
push:
if: github.event_name == 'push' && github.event.pull_request == null
paths-ignore:
- '**/*.md'
- 'examples/**'
pull_request:
if: github.event_name == 'pull_request' && github.repository == 'openframeworks/openFrameworks'
paths-ignore:
- '**/*.md'
- 'examples/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-linux-platforms:
runs-on: ubuntu-latest
strategy:
matrix:
cfg:
- {target: linuxarmv6l, libs: armv6l}
# - {target: linuxarmv7l, libs: armv7l}
env:
TARGET: ${{matrix.cfg.target}}
steps:
- uses: actions/checkout@v3
- name: Download libs
run: ./scripts/linux/download_libs.sh -a ${{matrix.cfg.libs}};
- name: Install dependencies
run: ./scripts/ci/$TARGET/install.sh;
- name: Build
run: ./scripts/ci/$TARGET/build.sh;
10 changes: 1 addition & 9 deletions .github/workflows/build-linux.yml
@@ -1,4 +1,4 @@
name: build-linux64-and-arm
name: build-linux64

# make the action not run on the local repo if the branch is also in a pull request to OF/OF
on:
Expand All @@ -25,8 +25,6 @@ jobs:
matrix:
cfg:
- {target: linux64, libs: 64gcc6}
- {target: linuxarmv6l, libs: armv6l}
# - {target: linuxarmv7l, libs: armv7l}
env:
TARGET: ${{matrix.cfg.target}}
steps:
Expand All @@ -39,12 +37,6 @@ jobs:
fi
- name: Install dependencies
run: ./scripts/ci/$TARGET/install.sh;
# - name: Install gcc4
# run: if [ ${{matrix.cfg.target}} = "64gcc4" ]; then
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
# sudo apt-get update -q;
# sudo apt-get install gcc-4.9 g++-4.9;
# fi
- name: Build
run: if [ "$TARGET" = "linux64" ]; then
scripts/ci/$TARGET/build.sh;
Expand Down
2 changes: 1 addition & 1 deletion addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp
Expand Up @@ -218,7 +218,7 @@ void ofxAssimpModelLoader::calculateDimensions(){
normalizedScale = scene_max.x-scene_min.x;
normalizedScale = std::max(double(scene_max.y - scene_min.y), normalizedScale);
normalizedScale = std::max(double(scene_max.z - scene_min.z), normalizedScale);
if (abs(normalizedScale) < std::numeric_limits<float>::epsilon()){
if (fabs(normalizedScale) < std::numeric_limits<float>::epsilon()){
ofLogWarning("ofxAssimpModelLoader") << "Error calculating normalized scale of scene" << std::endl;
normalizedScale = 1.0;
} else {
Expand Down
2 changes: 1 addition & 1 deletion addons/ofxOpenCv/addon_config.mk
Expand Up @@ -73,7 +73,7 @@ linux:
ADDON_INCLUDES_EXCLUDE += libs/opencv/%

linuxarmv6l:
ADDON_PKG_CONFIG_LIBRARIES = opencv
ADDON_PKG_CONFIG_LIBRARIES = opencv4
ADDON_LIBS_EXCLUDE = libs/opencv/%
ADDON_INCLUDES_EXCLUDE = libs/opencv
ADDON_INCLUDES_EXCLUDE += libs/opencv/%
Expand Down
Expand Up @@ -57,7 +57,7 @@ endif

#check if we are newer than Stretch and use the new system
ifeq ($(shell expr $(VER_ID) \>= 9), 1)
# comment the line below if you want to use the non X window based system - currently compatible with RPi 1-3 only
# comment the line below if you want to use the non X window based system - currently compatible with RPi 1-3 only
USE_PI_LEGACY = 0
USE_ATOMIC = 1
endif
Expand Down Expand Up @@ -191,7 +191,7 @@ PLATFORM_LDFLAGS += -pthread

ifdef USE_ATOMIC
PLATFORM_LDFLAGS += -latomic
endif
endif

################################################################################
# PLATFORM HEADER SEARCH PATHS
Expand Down Expand Up @@ -221,7 +221,6 @@ PLATFORM_HEADER_SEARCH_PATHS += $(RPI_ROOT)/opt/vc/include/interface/vmcs_host/l

PLATFORM_LIBRARY_SEARCH_PATHS += $(RPI_ROOT)/opt/vc/lib


################################################################################
# PLATFORM CORE EXCLUSIONS
# During compilation, these makefiles will generate lists of sources, headers
Expand Down Expand Up @@ -271,10 +270,11 @@ endif
PLATFORM_CFLAGS += --sysroot=$(SYSROOT)

PLATFORM_HEADER_SEARCH_PATHS += $(SYSROOT)/usr/include/c++
PLATFORM_HEADER_SEARCH_PATHS += $(SYSROOT)/usr/include/$(GCC_PREFIX)/c++/7
PLATFORM_HEADER_SEARCH_PATHS += $(TOOLCHAIN_ROOT)/lib/gcc/$(GCC_PREFIX)/$(GCC_VERSION)/include

PLATFORM_LIBRARY_SEARCH_PATHS += $(SYSROOT)/usr/lib/$(GCC_PREFIX)
PLATFORM_LIBRARY_SEARCH_PATHS += $(SYSROOT)/usr/lib/gcc/$(GCC_PREFIX)/7
PLATFORM_LIBRARY_SEARCH_PATHS += $(SYSROOT)/lib/$(GCC_PREFIX)
PLATFORM_LIBRARY_SEARCH_PATHS += $(TOOLCHAIN_ROOT)/lib/gcc/$(GCC_PREFIX)/$(GCC_VERSION)

PLATFORM_LDFLAGS += --sysroot=$(SYSROOT)
PLATFORM_LDFLAGS += -Xlinker -rpath-link=$(SYSROOT)/usr/lib/$(GCC_PREFIX)
Expand Down
27 changes: 10 additions & 17 deletions scripts/ci/linuxarmv6l/build.sh
@@ -1,21 +1,11 @@
#!/bin/bash
set -ev
OF_ROOT=$( cd "$(dirname "$0")/../../.." ; pwd -P )
PROJECTS=$OF_ROOT/libs/openFrameworksCompiled/project
# source $OF_ROOT/scripts/ci/ccache.sh

# Add compiler flag to reduce memory usage to enable builds to complete
# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746#c7
# the "proper" way does not work currently:
export CXXFLAGS="${CXXFLAGS} -ftrack-macro-expansion=0"

echo "**** Building OF core ****"
cd $OF_ROOT
# this carries over to subsequent compilations of examples
sed -i "s/PLATFORM_OPTIMIZATION_CFLAGS_DEBUG = .*/PLATFORM_OPTIMIZATION_CFLAGS_DEBUG = -g0/" $PROJECTS/makefileCommon/config.linux.common.mk
cd $PROJECTS
export GCC_PREFIX=arm-linux-gnueabihf
export GST_VERSION=1.0
#NOTE: GCC_VERSION should match the version present in the downloaded toolchain
export GCC_VERSION=9.4.0
export RPI_ROOT=${OF_ROOT}/scripts/ci/$TARGET/raspbian
export TOOLCHAIN_ROOT=${OF_ROOT}/scripts/ci/$TARGET/rpi_toolchain
export PLATFORM_OS=Linux
Expand All @@ -25,10 +15,16 @@ export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++"
export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc"
export AR=${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar
export LD=${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld
make Debug -j2
export CROSS_COMPILING=1

export PATH=/rpi_toolchain/bin/:$PATH
export LD_LIBRARY_PATH=/rpi_toolchain/lib:$LD_LIBRARY_PATH

echo "**** Building emptyExample ****"
cd $OF_ROOT/scripts/templates/linuxarmv6l
cd $OF_ROOT
cp scripts/templates/linuxarmv6l/Makefile examples/templates/emptyExample/
cp scripts/templates/linuxarmv6l/config.make examples/templates/emptyExample/
cd examples/templates/emptyExample/
make Debug -j2

echo "**** Building allAddonsExample ****"
Expand All @@ -37,6 +33,3 @@ cp scripts/templates/linuxarmv6l/Makefile examples/templates/allAddonsExample/
cp scripts/templates/linuxarmv6l/config.make examples/templates/allAddonsExample/
cd examples/templates/allAddonsExample/
make Debug -j2

git checkout $PROJECTS/makefileCommon/config.linux.common.mk
git checkout $PROJECTS/linuxarmv6l/config.linuxarmv6l.default.mk
13 changes: 9 additions & 4 deletions scripts/ci/linuxarmv6l/install.sh
Expand Up @@ -30,9 +30,10 @@ if [[ ! -d "$SCRIPT_DIR" ]]; then SCRIPT_DIR="$PWD"; fi
. "$SCRIPT_DIR/../../dev/downloader.sh"

downloadToolchain(){
downloader http://ci.openframeworks.cc/rpi_toolchain_gcc6.tar.bz2
tar xjf rpi_toolchain_gcc6.tar.bz2
rm rpi_toolchain_gcc6.tar.bz2
wget https://github.com/openframeworks/openFrameworks/releases/download/tools/cross-gcc-9.4.0-pi_0-1.tar.gz
tar xvf cross-gcc-9.4.0-pi_0-1.tar.gz
mv cross-pi-gcc-9.4.0-0 rpi_toolchain
rm cross-gcc-9.4.0-pi_0-1.tar.gz
}

downloadFirmware(){
Expand Down Expand Up @@ -69,8 +70,12 @@ createRaspbianImg
downloadToolchain
downloadFirmware

#needed for some of the toolchain libs
cp -rn rpi_toolchain/arm-linux-gnueabihf/libc/lib/* $ROOT/raspbian/usr/lib/
cp -rn rpi_toolchain/arm-linux-gnueabihf/libc/usr/lib/* $ROOT/raspbian/usr/lib/
cp -rn rpi_toolchain/arm-linux-gnueabihf/lib/* $ROOT/raspbian/usr/lib/

cd $ROOT/raspbian/usr/lib
relativeSoftLinks
cd $ROOT/raspbian/usr/lib/arm-linux-gnueabihf
relativeSoftLinks
cd $ROOT/raspbian/usr/lib/gcc/arm-linux-gnueabihf/4.9
10 changes: 5 additions & 5 deletions scripts/ci/linuxarmv6l/multistrap.conf
Expand Up @@ -12,18 +12,18 @@ packages=busybox busybox-syslogd udhcpc
source=http://archive.raspbian.org/raspbian
keyring=raspbian-archive-keyring
components=main contrib non-free rpi
suite=stretch
suite=bullseye

[Raspbian-Base]
packages=base-files dbus dpkg dropbear initscripts iputils-ping isc-dhcp-client kmod login locales lsb-base lsb-release makedev netbase net-tools sysvinit-utils sysv-rc udev
packages=base-files dbus dpkg dropbear initscripts iputils-ping isc-dhcp-client kmod login locales lsb-base lsb-release makedev netbase net-tools sysvinit-utils sysv-rc udev libudev-dev
source=http://archive.raspbian.org/raspbian
keyring=raspbian-archive-keyring
components=main contrib non-free rpi
suite=stretch
suite=bullseye

[OpenFrameworks]
packages=libasound2-dev libxmu-dev libxxf86vm-dev g++ libgl1-mesa-dev libglu1-mesa-dev libraw1394-dev libudev-dev libdrm-dev libglew-dev libopenal-dev libsndfile-dev libfreeimage-dev libcairo2-dev libfreetype6-dev libssl-dev libpulse-dev libusb-1.0-0-dev libopencv-dev libegl1-mesa-dev libgles1-mesa-dev libgles2-mesa-dev libassimp-dev librtaudio-dev libboost-filesystem-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav gstreamer1.0-pulseaudio gstreamer1.0-x gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good liburiparser-dev libcurl4-openssl-dev libxml2-dev libpugixml-dev libpoco-dev libglfw3-dev
packages=libasound2-dev libxmu-dev libxxf86vm-dev g++ libgl1-mesa-dev libglu1-mesa-dev libraw1394-dev libudev-dev libdrm-dev libglew-dev libopenal-dev libsndfile-dev libfreeimage-dev libcairo2-dev libfreetype6-dev libssl-dev libpulse-dev libusb-1.0-0-dev libopencv-dev libegl1-mesa-dev libglvnd-dev libgles2-mesa-dev libassimp-dev librtaudio-dev libboost-filesystem-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav gstreamer1.0-pulseaudio gstreamer1.0-x gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good liburiparser-dev libcurl4-openssl-dev libxml2-dev libpugixml-dev libpoco-dev libglfw3-dev libxrandr-dev libxinerama-dev libxcursor-dev gfortran
source=http://archive.raspbian.org/raspbian
keyring=raspbian-archive-keyring
components=main contrib non-free rpi
suite=stretch
suite=bullseye

0 comments on commit af60234

Please sign in to comment.