actondev / s7-imgui

Using s7 scheme alongside Dear ImGui to (interactively) build (cross platform) GUI apps.
40 stars 4 forks source link

Building for Raspberry Pi with Raspbian #10

Closed paines closed 3 years ago

paines commented 3 years ago

In order that the project compiles the meson.build must be altered with link_args = ['-lstdc++fs'] in line 21. The tests still faill, but at least the repls are all build.

actondev commented 3 years ago

Hey! Nice to hear this being used in some raspberry. I guess the flag is needed cause raspbian has on older g++ version.

Other than that, maybe you'll find cross building useful. That's what I did to build this for rpi zero (since building it on the board itself would take forever)

file: cross-rpi0.ini

# cross compiler from https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2010.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-10.2.0-pi_0-1.tar.gz/download
# adjust accordingly
[binaries]
c = '/opt/cross-pi-gcc-10.2.0-0/bin/arm-linux-gnueabihf-gcc'
cpp = '/opt/cross-pi-gcc-10.2.0-0/bin/arm-linux-gnueabihf-c++'
ar = '/opt/cross-pi-gcc-10.2.0-0/bin/arm-linux-gnueabihf-ar'
ld = '/opt/cross-pi-gcc-10.2.0-0/bin/arm-linux-gnueabihf-ld'
strip = '/opt/cross-pi-gcc-10.2.0-0/bin/arm-linux-gnueabihf-strip'

[properties]
# statically linking against c++ cause the board itself might have an outdated version
cpp_link_args= ['-static-libstdc++']

and then

meson setup build-rpi0 --cross-file cross-rpi0.ini
meson compile -C build-rpi0

If I may ask, what's your project about?

PS I added a note that this project is deprecated, but will leave the issue open for visibility

paines commented 3 years ago

Hi, thanks for your nice comment. Cool to learn about the cross compiling. This is truly powerful. I fiddle at the moment with the idea of building an audio looper. The other day I found some chicken scheme tutorial with TK which is also a nice starting point, same as your project. So I haven't decided yet between those two. I really like how easily you can cross-compile your project. This too, was once possible in the past with chicken. So that point goes definetly to you. One big obstacle for my project will be to make some portaudio bindings. With chicken I know where to look and how to start as I did some other bindings for it in the past, but with s7 I am quite unsure as I have never done it.

actondev commented 3 years ago

I guess you could cross-compile chicken, haven't even dealt with it ever, but they do mention in here https://wiki.call-cc.org/man/5/Cross%20development

Anyhow, I did some portaudio bindings once so here's some relevant snippets to get you started.

portaudio-example.zip

Good luck with your project!

paines commented 3 years ago

Thanks man. Highly appreciate it!