Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[actions] rpi changes #7928

Merged
merged 63 commits into from
May 6, 2024
Merged

[actions] rpi changes #7928

merged 63 commits into from
May 6, 2024

Conversation

dimitre
Copy link
Member

@dimitre dimitre commented May 3, 2024

This PR intends to fix RPI github actions
[hopefully] modernizing and fixing cross compiling issues
it replaces compilers installed via ci.openframeworks.cc with apt installable ones (and cached via github actions)

Status:

  • aarch64 emptyexample
  • aarch64 alladdonsexample
  • armv6l emptyexample
  • armv6l alladdonsexample

Errors - all fixed:
~~Using armv6l actions it doesnt find <bcm_host.h>, it is not installable via firmware.zip anymore.
Maybe it is possible to install via apt packages, have to research more about this one.

aarch64 alladdonsexample linking errors:

/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: warning: liblapack.so.3, needed by /home/runner/work/openFrameworks/openFrameworks/scripts/ci/linuxrpi/raspbian/usr/lib/aarch64-linux-gnu/libopencv_core.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: warning: libblas.so.3, needed by /home/runner/work/openFrameworks/openFrameworks/scripts/ci/linuxrpi/raspbian/usr/lib/aarch64-linux-gnu/libopencv_core.so, not found (try using -rpath or -rpath-link)
/home/runner/work/openFrameworks/openFrameworks/scripts/ci/linuxrpi/raspbian/usr/lib/aarch64-linux-gnu/libm.a(s_sin.o): in function `__sin':
(.text+0x10): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol `__stack_chk_guard@@GLIBC_2.17' defined in .data.rel.ro section in /home/runner/work/openFrameworks/openFrameworks/scripts/ci/linuxrpi/raspbian/lib/ld-linux-aarch64.so.1
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: (.text+0x10): warning: too many GOT entries for -fpic, please recompile with -fPIC
collect2: error: ld returned 1 exit status

~~

@dimitre
Copy link
Member Author

dimitre commented May 3, 2024

Hello @ofTheo @danoli3 @artificiel can you help with some ideas for this one?

@artificiel
Copy link
Contributor

not in a Pi position right now but for bcm_host.h if these changes have implications that go "way back", a few years ago it became necessary to install libraspberrypi-dev and maybe raspberrypi-kernel-headers to get things in general to compile.

@dimitre
Copy link
Member Author

dimitre commented May 3, 2024

Thanks. for what I've seen there are some headers in this repo / folder
https://github.com/raspberrypi/userland
host_applications/linux/libs/bcm_host/include

@ofTheo
Copy link
Member

ofTheo commented May 3, 2024

@dimitre - I'll have a look!
I think I tried doing things without firmware.zip and ran into the same issues with bcm_host.h

@artificiel
Copy link
Contributor

for liblaplack (CV dependency), is liblapack-dev already in there?

depending on how deep you want to dig maybe it's simpler to keep the old pre-packaged toolchain for armv6 and your updated approach from aarch64?

@dimitre
Copy link
Member Author

dimitre commented May 4, 2024

I suggest we drop armv6l architecture since aarch64 will run in most RPI versions including
Pi Zero 2
Pi 3
Pi 4
Pi 5

@dimitre
Copy link
Member Author

dimitre commented May 6, 2024

bcm_host.h solved and other fixes. it is finishing compilation here locally,
still issues on allAddons, only a matter of passing the correct library paths I think

@dimitre
Copy link
Member Author

dimitre commented May 6, 2024

Great! everything good with allAddons in all platforms.
I'll be tidying up for merging. any objections?

@dimitre dimitre merged commit c191d35 into openframeworks:master May 6, 2024
11 checks passed
PLATFORM_HEADER_SEARCH_PATHS += $(RPI_ROOT)/opt/vc/include/interface/vcos/pthreads
PLATFORM_HEADER_SEARCH_PATHS += $(RPI_ROOT)/opt/vc/include/interface/vmcs_host/linux
PLATFORM_HEADER_SEARCH_PATHS += $(RPI_ROOT)/userland/host_applications/linux/libs/bcm_host/include
PLATFORM_HEADER_SEARCH_PATHS += $(RPI_ROOT)/userland
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work for people working with the device itself ( as opposed to building in the CI )?
ie: does userland exist for Pi device users?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. maybe I should put back the includes with /opt/vc in armv6l
easy to do

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and enclose this in ifdef CROSS_COMPILE

@ofTheo
Copy link
Member

ofTheo commented May 6, 2024

congrats @dimitre !!
ooof - that was a gnarly one.

@dimitre dimitre deleted the rpiact branch May 6, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants