molul
Posts: 6
Joined: Mon Jun 11, 2018 5:42 am

Building LÖVE on a Raspberry to use it on another ARMv7 device

Mon Jun 11, 2018 5:57 am

Hi everyone. I'm working on a project to run on a Rockchip RK3066 (ARMv7, same as Raspberri Pi 2).

We're using LÖVE framework (https://love2d.org/) for the UI, and after struggling a lot with cross-building from an Ubuntu laptop, we're considering building LÖVE on Raspberry Pi 2, then copy the binaries to the RK3066 board.

The only consideration I'm still doubtful about is this I was told on the LÖVE forums: "the trick is to make sure you don't accidentally link your code to a raspberry pi-specific library. As the only one that comes to mind is the GLES driver you'll probably be fine".

I've seen someone on these forums that was able to build LÖVE on the Raspberry Pi (viewtopic.php?f=67&t=90184), but I don't think I've seen any clear indication on how to avoid building LÖVE against the GLES driver.

Any hint is greatly appreciated :)

User avatar
topguy
Posts: 4427
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Building LÖVE on a Raspberry to use it on another ARMv7 device

Mon Jun 11, 2018 11:13 am

What OS will be running on the Rockchip ?

molul
Posts: 6
Joined: Mon Jun 11, 2018 5:42 am

Re: Building LÖVE on a Raspberry to use it on another ARMv7 device

Mon Jun 11, 2018 11:31 am

Oh yes, sorry. It's Linux. uname -a says:

Linux marsboard-rk3066 4.4.103+ #38 SMP PREEMPT Thu May 31 13:54:25 CST 2018 armv7l GNU/Linux

User avatar
The Traveler
Posts: 168
Joined: Sat Oct 21, 2017 3:48 pm

Re: Building LÖVE on a Raspberry to use it on another ARMv7 device

Mon Jun 11, 2018 1:40 pm

"the trick is to make sure you don't accidentally link your code to a raspberry pi-specific library. As the only one that comes to mind is the GLES driver you'll probably be fine".
Unless your compiling and linking to build a monolithic, or static, executable, (all code included in one executable), it's shouldn't be much trouble. Most applications use dynamic linking of libraries at runtime, ie; .so files in linux. So, if you're making graphics function calls to GLES routines, usually via the Mesa lib, you just need to be sure there is a GLES compliant shared .so lib on both devices. You compile and link your code with the appropriate header files that contain the GLES function declarations and any macros needed.

I checked the RK3066 and it uses a ARM Mali-400 GPU which supports the OpenGL ES 2.0 specification. So, if there is a Mesa library for it, which is likely as Mesa has been around linux for many years now, your code should work.

Cheers.
Last edited by The Traveler on Mon Jun 11, 2018 6:40 pm, edited 1 time in total.
Retired IT professional, programmer and "beardie weirdie".
RPi interests: Artificial neural networks using clustered devices.
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

molul
Posts: 6
Joined: Mon Jun 11, 2018 5:42 am

Re: Building LÖVE on a Raspberry to use it on another ARMv7 device

Mon Jun 11, 2018 6:16 pm

Thanks, The Traveler. Do you know how could I check if there's a Mesa library on the device?

User avatar
The Traveler
Posts: 168
Joined: Sat Oct 21, 2017 3:48 pm

Re: Building LÖVE on a Raspberry to use it on another ARMv7 device

Mon Jun 11, 2018 6:25 pm

molul wrote:
Mon Jun 11, 2018 6:16 pm
Thanks, The Traveler. Do you know how could I check if there's a Mesa library on the device?
You can check the linux distro that you intend to have on the RK3066. Most mainline distros have repositories that list what applications and libraries ship with them. For instance, a Ubuntu repository: https://launchpad.net/ubuntu/+source/mesa As far as being on the device, you can try this on the command line: ldconfig -p | grep libgl2-mesa for instance. If the driver is there, you'll have output.

Locate the Mesa lib for each device and compare the versions. As long as the version major number is the same, you should be ok. If the version minor number differs, it usually means small code changes or bugfixes, not compatibility breakers.

Ie; Mesa 18.1.0 and 18.1.1 wouldn't be a problem. Mesa 17.3.9 and 18.1.0 could have some significant changes.

Cheers.
Retired IT professional, programmer and "beardie weirdie".
RPi interests: Artificial neural networks using clustered devices.
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

User avatar
Imperf3kt
Posts: 907
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Building LÖVE on a Raspberry to use it on another ARMv7 device

Mon Jun 11, 2018 9:22 pm

No Raspberry Pi includes any RockChip components, where did you hear that?
Stephen Hawking, rest in peace.
8 January 1942 – 14 March 2018


User avatar
The Traveler
Posts: 168
Joined: Sat Oct 21, 2017 3:48 pm

Re: Building LÖVE on a Raspberry to use it on another ARMv7 device

Mon Jun 11, 2018 9:55 pm

Imperf3kt wrote:
Mon Jun 11, 2018 9:22 pm
No Raspberry Pi includes any RockChip components, where did you hear that?
I don't believe that was the issue. The OP is compiling code on an RPi to install on another ARM device. The question arose about a potential issue concerning GLES compatibility and how to avoid it. Hardware is not the issue.

Cheers.
Retired IT professional, programmer and "beardie weirdie".
RPi interests: Artificial neural networks using clustered devices.
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

User avatar
Imperf3kt
Posts: 907
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Building LÖVE on a Raspberry to use it on another ARMv7 device

Tue Jun 12, 2018 12:17 am

Oops, sorry, I misread the first line of the first post.
Stephen Hawking, rest in peace.
8 January 1942 – 14 March 2018


molul
Posts: 6
Joined: Mon Jun 11, 2018 5:42 am

Re: Building LÖVE on a Raspberry to use it on another ARMv7 device

Thu Jun 14, 2018 4:04 pm

Well, unfortunately I got LÖVE built on the Raspberry and copied the binaries and dependencies to the RK3066... and got a Segementation fault when I run it.

I've reached the LÖVE community for any hint to still try to make it run, but it looks like I'm going to have to learn SDL2 and build the UI from scratch ^_^U

Anyway, thanks everyone for your help :)

Return to “Graphics programming”

Who is online

Users browsing this forum: No registered users and 0 guests