Skip to content

Commit af60234

Browse files
authored
Upgrade arm - closes #7573 (#7611)
#changelog #armv6
1 parent 11cdc79 commit af60234

8 files changed

Lines changed: 69 additions & 42 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: build-linux-arm
2+
3+
# make the action not run on the local repo if the branch is also in a pull request to OF/OF
4+
on:
5+
push:
6+
if: github.event_name == 'push' && github.event.pull_request == null
7+
paths-ignore:
8+
- '**/*.md'
9+
- 'examples/**'
10+
pull_request:
11+
if: github.event_name == 'pull_request' && github.repository == 'openframeworks/openFrameworks'
12+
paths-ignore:
13+
- '**/*.md'
14+
- 'examples/**'
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build-linux-platforms:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
cfg:
26+
- {target: linuxarmv6l, libs: armv6l}
27+
# - {target: linuxarmv7l, libs: armv7l}
28+
env:
29+
TARGET: ${{matrix.cfg.target}}
30+
steps:
31+
- uses: actions/checkout@v3
32+
- name: Download libs
33+
run: ./scripts/linux/download_libs.sh -a ${{matrix.cfg.libs}};
34+
- name: Install dependencies
35+
run: ./scripts/ci/$TARGET/install.sh;
36+
- name: Build
37+
run: ./scripts/ci/$TARGET/build.sh;

.github/workflows/build-linux.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-linux64-and-arm
1+
name: build-linux64
22

33
# make the action not run on the local repo if the branch is also in a pull request to OF/OF
44
on:
@@ -25,8 +25,6 @@ jobs:
2525
matrix:
2626
cfg:
2727
- {target: linux64, libs: 64gcc6}
28-
- {target: linuxarmv6l, libs: armv6l}
29-
# - {target: linuxarmv7l, libs: armv7l}
3028
env:
3129
TARGET: ${{matrix.cfg.target}}
3230
steps:
@@ -39,12 +37,6 @@ jobs:
3937
fi
4038
- name: Install dependencies
4139
run: ./scripts/ci/$TARGET/install.sh;
42-
# - name: Install gcc4
43-
# run: if [ ${{matrix.cfg.target}} = "64gcc4" ]; then
44-
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
45-
# sudo apt-get update -q;
46-
# sudo apt-get install gcc-4.9 g++-4.9;
47-
# fi
4840
- name: Build
4941
run: if [ "$TARGET" = "linux64" ]; then
5042
scripts/ci/$TARGET/build.sh;

addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void ofxAssimpModelLoader::calculateDimensions(){
218218
normalizedScale = scene_max.x-scene_min.x;
219219
normalizedScale = std::max(double(scene_max.y - scene_min.y), normalizedScale);
220220
normalizedScale = std::max(double(scene_max.z - scene_min.z), normalizedScale);
221-
if (abs(normalizedScale) < std::numeric_limits<float>::epsilon()){
221+
if (fabs(normalizedScale) < std::numeric_limits<float>::epsilon()){
222222
ofLogWarning("ofxAssimpModelLoader") << "Error calculating normalized scale of scene" << std::endl;
223223
normalizedScale = 1.0;
224224
} else {

addons/ofxOpenCv/addon_config.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ linux:
7373
ADDON_INCLUDES_EXCLUDE += libs/opencv/%
7474

7575
linuxarmv6l:
76-
ADDON_PKG_CONFIG_LIBRARIES = opencv
76+
ADDON_PKG_CONFIG_LIBRARIES = opencv4
7777
ADDON_LIBS_EXCLUDE = libs/opencv/%
7878
ADDON_INCLUDES_EXCLUDE = libs/opencv
7979
ADDON_INCLUDES_EXCLUDE += libs/opencv/%

libs/openFrameworksCompiled/project/linuxarmv6l/config.linuxarmv6l.default.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ endif
5757

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

192192
ifdef USE_ATOMIC
193193
PLATFORM_LDFLAGS += -latomic
194-
endif
194+
endif
195195

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

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

224-
225224
################################################################################
226225
# PLATFORM CORE EXCLUSIONS
227226
# During compilation, these makefiles will generate lists of sources, headers
@@ -271,10 +270,11 @@ endif
271270
PLATFORM_CFLAGS += --sysroot=$(SYSROOT)
272271

273272
PLATFORM_HEADER_SEARCH_PATHS += $(SYSROOT)/usr/include/c++
274-
PLATFORM_HEADER_SEARCH_PATHS += $(SYSROOT)/usr/include/$(GCC_PREFIX)/c++/7
273+
PLATFORM_HEADER_SEARCH_PATHS += $(TOOLCHAIN_ROOT)/lib/gcc/$(GCC_PREFIX)/$(GCC_VERSION)/include
275274

276275
PLATFORM_LIBRARY_SEARCH_PATHS += $(SYSROOT)/usr/lib/$(GCC_PREFIX)
277-
PLATFORM_LIBRARY_SEARCH_PATHS += $(SYSROOT)/usr/lib/gcc/$(GCC_PREFIX)/7
276+
PLATFORM_LIBRARY_SEARCH_PATHS += $(SYSROOT)/lib/$(GCC_PREFIX)
277+
PLATFORM_LIBRARY_SEARCH_PATHS += $(TOOLCHAIN_ROOT)/lib/gcc/$(GCC_PREFIX)/$(GCC_VERSION)
278278

279279
PLATFORM_LDFLAGS += --sysroot=$(SYSROOT)
280280
PLATFORM_LDFLAGS += -Xlinker -rpath-link=$(SYSROOT)/usr/lib/$(GCC_PREFIX)

scripts/ci/linuxarmv6l/build.sh

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
#!/bin/bash
22
set -ev
33
OF_ROOT=$( cd "$(dirname "$0")/../../.." ; pwd -P )
4-
PROJECTS=$OF_ROOT/libs/openFrameworksCompiled/project
5-
# source $OF_ROOT/scripts/ci/ccache.sh
64

7-
# Add compiler flag to reduce memory usage to enable builds to complete
8-
# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746#c7
9-
# the "proper" way does not work currently:
10-
export CXXFLAGS="${CXXFLAGS} -ftrack-macro-expansion=0"
11-
12-
echo "**** Building OF core ****"
13-
cd $OF_ROOT
14-
# this carries over to subsequent compilations of examples
15-
sed -i "s/PLATFORM_OPTIMIZATION_CFLAGS_DEBUG = .*/PLATFORM_OPTIMIZATION_CFLAGS_DEBUG = -g0/" $PROJECTS/makefileCommon/config.linux.common.mk
16-
cd $PROJECTS
175
export GCC_PREFIX=arm-linux-gnueabihf
186
export GST_VERSION=1.0
7+
#NOTE: GCC_VERSION should match the version present in the downloaded toolchain
8+
export GCC_VERSION=9.4.0
199
export RPI_ROOT=${OF_ROOT}/scripts/ci/$TARGET/raspbian
2010
export TOOLCHAIN_ROOT=${OF_ROOT}/scripts/ci/$TARGET/rpi_toolchain
2111
export PLATFORM_OS=Linux
@@ -25,10 +15,16 @@ export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++"
2515
export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc"
2616
export AR=${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar
2717
export LD=${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld
28-
make Debug -j2
18+
export CROSS_COMPILING=1
2919

20+
export PATH=/rpi_toolchain/bin/:$PATH
21+
export LD_LIBRARY_PATH=/rpi_toolchain/lib:$LD_LIBRARY_PATH
22+
3023
echo "**** Building emptyExample ****"
31-
cd $OF_ROOT/scripts/templates/linuxarmv6l
24+
cd $OF_ROOT
25+
cp scripts/templates/linuxarmv6l/Makefile examples/templates/emptyExample/
26+
cp scripts/templates/linuxarmv6l/config.make examples/templates/emptyExample/
27+
cd examples/templates/emptyExample/
3228
make Debug -j2
3329

3430
echo "**** Building allAddonsExample ****"
@@ -37,6 +33,3 @@ cp scripts/templates/linuxarmv6l/Makefile examples/templates/allAddonsExample/
3733
cp scripts/templates/linuxarmv6l/config.make examples/templates/allAddonsExample/
3834
cd examples/templates/allAddonsExample/
3935
make Debug -j2
40-
41-
git checkout $PROJECTS/makefileCommon/config.linux.common.mk
42-
git checkout $PROJECTS/linuxarmv6l/config.linuxarmv6l.default.mk

scripts/ci/linuxarmv6l/install.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ if [[ ! -d "$SCRIPT_DIR" ]]; then SCRIPT_DIR="$PWD"; fi
3030
. "$SCRIPT_DIR/../../dev/downloader.sh"
3131

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

3839
downloadFirmware(){
@@ -69,8 +70,12 @@ createRaspbianImg
6970
downloadToolchain
7071
downloadFirmware
7172

73+
#needed for some of the toolchain libs
74+
cp -rn rpi_toolchain/arm-linux-gnueabihf/libc/lib/* $ROOT/raspbian/usr/lib/
75+
cp -rn rpi_toolchain/arm-linux-gnueabihf/libc/usr/lib/* $ROOT/raspbian/usr/lib/
76+
cp -rn rpi_toolchain/arm-linux-gnueabihf/lib/* $ROOT/raspbian/usr/lib/
77+
7278
cd $ROOT/raspbian/usr/lib
7379
relativeSoftLinks
7480
cd $ROOT/raspbian/usr/lib/arm-linux-gnueabihf
7581
relativeSoftLinks
76-
cd $ROOT/raspbian/usr/lib/gcc/arm-linux-gnueabihf/4.9

scripts/ci/linuxarmv6l/multistrap.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ packages=busybox busybox-syslogd udhcpc
1212
source=http://archive.raspbian.org/raspbian
1313
keyring=raspbian-archive-keyring
1414
components=main contrib non-free rpi
15-
suite=stretch
15+
suite=bullseye
1616

1717
[Raspbian-Base]
18-
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
18+
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
1919
source=http://archive.raspbian.org/raspbian
2020
keyring=raspbian-archive-keyring
2121
components=main contrib non-free rpi
22-
suite=stretch
22+
suite=bullseye
2323

2424
[OpenFrameworks]
25-
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
25+
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
2626
source=http://archive.raspbian.org/raspbian
2727
keyring=raspbian-archive-keyring
2828
components=main contrib non-free rpi
29-
suite=stretch
29+
suite=bullseye

0 commit comments

Comments
 (0)