Original date:2017-03-28 11:48:26 Edited by: ghaberek Subject: Re: Raspberry Pi

Here is the hello.ex file that I reference below. I am using the Euphoria 4.1.0 Beta 2 downloads from the DownloadEuphoria page.

-- hello.ex 
procedure main() 
    puts( 1, "Hello, world!\n" ) 
end procedure 
irv said...

For some reason, however, the compiler takes a LONG time to run (I finally got it working).

Use the translator to create a makefile and then you can run make -j4 to use all four cores of the RPi3.

$ euc -build-dir build -makefile hello.ex 
$ make -j4 -C build/ -f hello.mak 

irv said...

So, is it possible to cross-compile for the Arm on an x86-64?

Yes! What I assume you mean is "cross-translating" with Euphoria. It's quite easy actually, although I haven't thoroughly tested it. (And I'm not sure what's going on here.)

You will need the following things:

  • Euphoria 4.1 for 64-bit Linux (this may be possible with 32-bit, I have not tried it) - I installed to /usr/local/euphoria-4.1.0-Linux-x64/.
  • Euphoria 4.1 for ARMv6 hardfloat (for the pre-compiled eu.a library) - I installed to /usr/local/euphoria-4.1.0-ARMv6-hardfloat/.
  • The GCC ARM hardfloat cross-compiler for you Linux distro (I am using Ubuntu) - I installed with sudo apt install build-essential gcc-arm-linux-gnueabihf.

# install the build tools and cross-compiler for ARM 
$ sudo apt install build-essential gcc-arm-linux-gnueabihf 
# translate the code for the ARM platform, and use the ARM library 
$ euc -build-dir build-arm -makefile -arch ARM -cc-prefix arm-linux-gnueabihf- -lib /usr/local/euphoria-4.1.0-ARMv6-hardfloat/bin/eu.a hello.ex 
# build the code! 
$ make -j4 -C build-arm -f hello.mak 
# copy to your RPi3 via SSH 
$ scp hello pi@raspberrypi:/home/pi/ 

Now go run hello on the RPi3 and it should work just fine! blink

jmduro said...

I don't know. I compiled it on a 32-bit Raspbian even if the Pi has 64-bit hardware.

IMHO, there's little benefit to running a 64-bit OS on the RPi3 hardware. Technically you can support very large integers, but without oodles of RAM, I don't see the point.


Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu