I just got a Raspberry Pi 2 and would love to test it with OpenFL / Lime. I’ve seen other people having success running some of the samples with the first model (i think).
How would i go about compiling it for Raspberry Pi 2 Model B?
Any help is very much appreciated.
I would like to see Raspberry Pi 2 support as well
I believe that it supports the “armhf” architecture, which I have built from a desktop Ubuntu system using the additional GCC toolchain (I forget the package name) and the current
lime rebuild linux -rpi command
I forget if it required modifications to HXCPP or not.
My big problem was no Haxe or Neko for armhf so I did not test on a real device. I think it would be neat to have something similar to “Python Games” and a ready-to-go package to work on the Pi
So, if i want to test this i should try to compile from Linux?
Or did i understand it wrong and currently there is no way to compile due to lack of support for armhf processors?
I believe I’ve built already using a desktop Ubuntu install, I think I also compiled using Ubuntu on the Raspberry Pi. If you can build Lime for armhf using -rpi, then it’s a matter of getting armhf builds of Neko and Haxe from somewhere, primarily
I started on this a while ago, but so far no luck on raspian wheezy.
I did manage to compile neko ( you will have to compile the targets from the makefile manually in a specific order) and dowloaded the haxe binary. I then got as far as installing haxelib. But I get some path errors ( weird double // in path) when trying to installing lime.
Maybe we can make it a joint effort. I’ll document what I’ve done and where I get stuck. If anyone else is willing to have a go…
I can try the whole process here the next weekend - i’ll follow both of your recommendations and then post my results here. If we can find what is missing maybe we can make this work.
Thanks for the responses guys,
Here’s what I did to get haxelib working:
[ you’ll need basic ‘make’ tools, and some more dependencies like ‘libgc-dev’ ]
tar zxf neko-2.0.0.tar.gz
I’m doing individual make steps because ‘make all’ won’t work for me
make libs ( interactive, you will be asked to skip if a package is not avaiblable)
sudo make install
tar zxf haxe-3.1.3-raspi.tar.gz
This all seems to work well and
haxelib install openfl
haxelib run openfl setup
Uncaught exception - load.c(237) : Failed to load library : /usr/lib/haxe/lib/lime/2,5,2//ndll/Linux/lime.ndll (/usr/lib/haxe/lib/lime/2,5,2//ndll/Linux/lime.ndll: cannot open shared object file: No such file or directory)
note the double forwardslash before ndll.
Maybe this info helps you …
The openfl tool is trying to load the linux ndll, which even if it dit find it, wouldn’t work.
You’ll have to add
-nocffi to the openfl command for now.
There’s a need to improve os detection to realise this is not a x86.
If you use a development version of lime do
haxelib run lime rebuild linux -rpi works?
git clone --recursive https://github.com/openfl/lime
haxelib run lime rebuild linux -rpi
but it fails:
arm-linux-gnueabihf-g++ -o …/ndll/RPi/lime.ndll -shared -fpic -fPIC -Xlinker --no-undefined @obj/linux-rpi-hfp//all_objs /usr/lib/haxe/lib/hxcpp/3,2,102/lib/RPi/liblinuxcompat.a -lpthread -lrt -ldl
arm-linux-gnueabihf-g++: error: /usr/lib/haxe/lib/hxcpp/3,2,102/lib/RPi/liblinuxcompat.a: No such file or directory
Error: error running arm-linux-gnueabihf-g++ -o …/ndll/RPi/lime.ndll -shared -fpic -fPIC -Xlinker --no-undefined @obj/linux-rpi-hfp//all_objs /usr/lib/haxe/lib/hxcpp/3,2,102/lib/RPi/liblinuxcompat.a -lpthread -lrt -ldl
there is no RPI dir in /usr/lib/haxe/lib/hxcpp/3,2,102/lib/
Do i need to install hxcpp with some other options?
[ Sorry if I’m asking noob questions, I’m new to all this ]
So hxcpp doesn’t ship with these.
In that case get a dev version of it and hopefully the architecture auto-detection will work.
git clone https://github.com/HaxeFoundation/hxcpp.git
haxelib dev hxcpp hxcpp
got the dev version from git, but
neko build.n goes into an endless loop:
Usage : neko build.n [clean] [link-]target[-arch][-arch] …] [-debug] [-verbose] [-D…]
target : ios, android, windows, linux, mac, mingw
default (=current system)
link : ndll- or static-
(none specified = both link types, mingw static only
arch : -armv5 -armv6 -armv7 -arm64 -x86 -x86_64 -m32 -m64
(none specified = all valid architectures
-D… : defines passed to hxcpp build system
eg: neko build.n clean ndll-mac-m32-m64 = rebuild both mac ndlls
Specify target or ‘default’ to remove this message
Using default = linux
neko run.n Build.xml -Dlinux -DHXCPP_M64 /home/pi/software/hxcpp/project/
This version of hxcpp (/home/pi/software/hxcpp/) appears to be a source/developement version.
Before this can be used, you need to:
- Rebuild the main command-line tool, this can be done with:
- Build the binaries appropriate to your system(s), this can be done with:
Would you like to do this now [y/n]y
Compiling hxcpp tool…
Standard library not found
after this it repeats itself
If you do
cd tools/hxcpp && haxe compile.hxml manually you get
Standard library not found?
Maybe it’s having trouble find haxe, there’s the
HAXEPATH environment variable you could use to specify where is your haxe folder, worth a try.
Hehe I was just typing this , it looks like I didn’t install Haxe properly on this SD-card (got too many) …
I have been trying to find a proper installation guide for haxe on rpi2 but no luck so far.
I just got the binaries and copied them over to
Is there a default path for the std directory that Haxe looks for, or should I add a variable to my .profile ?
By default it’ll look into
HAXE_STD_PATH does exists.
Ok, it finds the standard library now.
tries to run
neko run.n Build.xml -Dlinux -DHXCPP_M64
so it’s not finding the architecture ( looks like it thinks it’s 64bit)
neko build.n ndll-linux-armv7
does nothing: no errors, no output, it just returns to the prompt
neko build.n ndll-linux-m32
does start compiling (without errors), but I don’t know if this will build anything useful
lime rebuild hxcpp linux -rpi
lime rebuild hxcpp linux -rpi -static
Ok Joshua, they both compile.
I can now even do:
haxelib run lime rebuild linux -rpi without errors
but I still don’t know how to tie it all together.
I now have hxcpp and lime in a subdirectory in my home dir and I can see the lime ndlls and the libcompat.a from hxcpp.
When I just run
lime I get:
Uncaught exception - load.c(237) : Failed to load library : lime.ndll (lime.ndll: cannot open shared object file: No such file or directory)
Do I need to copy some files or run an extra command?
By the way thanks for helping guys!
What is the folder where the ndll is located?
Looking at some code it seems the tools want you to specify
-rpi for every commands.
So I guess retry with
At the moment it’s in
and you’r right lime -rpi does run!
I was now able to do
haxelib run openfl setup -rpi
Feels like we’re getting close
You can also try
lime -nocffi if you want, so the tools don’t look for the RPi binary, only projects would.