1. Raspberry Pi
- Posted by irv Mar 21, 2017
- 2445 views
I bought a Pi 3 today, and it runs Euphoria and EuGTK with no problem so far.
Pretty good for a $37 computer the size of a pack of cigarettes, and nearly as fast as my desktop.
2. Re: Raspberry Pi
- Posted by ChrisB (moderator) Mar 21, 2017
- 2428 views
Hi Irv
What steps did you do for installing Eu and GTK to the Pi. I'm sure it would make a great wiki entry along with the current Pi entries.
Cheers
Chris
3. Re: Raspberry Pi
- Posted by jmduro Mar 21, 2017
- 2424 views
This is what I did to install OpenEuphoria on Raspbian Jessie:
wget http://www.russelldavis.org/Files/files/RaspberryPi/euphoria-4.1.0-RaspberryPi.tar.gz cd /usr/local sudo tar -xzf ~/euphoria-4.1.0-RaspberryPi.tar.gz cd vi .bashrc export PATH=$PATH:/usr/local/euphoria-4.1.0-RaspberryPi/bin
Jean-Marc
4. Re: Raspberry Pi
- Posted by ChrisB (moderator) Mar 21, 2017
- 2398 views
Hi, yes, that we good to add as another section to the current Wiki article (not my article, so am reluctant to add it), but it would be nice, if there was an instruction set (yes I do mean baby steps) to add GTK and Eu to a fresh Raspberry Pi. What a great way to a great programming onto a device designed for experimentation by youngsters.
Pity there's not a GPIO library yet......
(Currently doing some thought experiments on setting up Python as a server with it's GPIO module, but am having to learn Python now too!)
Cheers
Chris
5. Re: Raspberry Pi
- Posted by irv Mar 21, 2017
- 2386 views
Wrapping the GPIO should be "child's play" compared to wrapping GTK, so...
Perhaps someone here has more experience with Raspberry than my 1 day's worth; they might volunteer. Otherwise, I will give it a try.
Since EuGTK makes designing gauges and such pretty simple, being able to connect them to actual real-world sensors would be more than nice.
6. Re: Raspberry Pi
- Posted by irv Mar 21, 2017
- 2394 views
The only addition to Jean-Marc's instructions would be to add a eu.cfg to point to the includes, e.g:
(tilde)/demos
/usr/local/euphoria-4.1.0-RaspberryPi/include
Otherwise, eui won't find includes such as dll.e
Note that you'll need this in your home folder if you want to run EuGTK programs by clicking on the icon from a file manager. The same file should be in the demos folder.
Someone probably has a better way to set this up, please contribute.
7. Re: Raspberry Pi
- Posted by jmduro Mar 21, 2017
- 2376 views
Should be better adding eu.cfg, that's sure, but yet nothing special is defined and it finds includes such as dll.e. The eu.cfg file that is in OEU bin folder is probably enough to begin. Another in /demos is needed for GTK.
Jean-Marc
8. Re: Raspberry Pi
- Posted by irv Mar 21, 2017
- 2354 views
Without the added line, I get:
pi@raspberrypi: $ eui demos/test0
/home/pi/demos/GtkEnums.e:8 <0052>:: can't find 'std/io.e' in any of ...
/home/pi/demos
/home/pi/demos/test0.ex
public include std/io.e
Very strange.
EDIT: or maybe not. I'm using Raspian today, instead of Ubuntu, as a test. Forgot that, maybe debian works differently.
9. Re: Raspberry Pi
- Posted by ghaberek (admin) Mar 21, 2017
- 2406 views
I have several Raspberry Pis:
- one Raspberry Pi Model A (original 256MB model)
- one Rapsberry Pi 3
- two Raspberry Pi Zero 1.3
Edit: I am running the ARM build of 4.1 from the DownloadEuphoria page.
I started wrapping wiringPi last year but I've got nothing to test it with right now.
I've posted the code to GitHub in case anyone wants to help test or contribute.
https://github.com/ghaberek/wiringPi-euphoria
-Greg
10. Re: Raspberry Pi
- Posted by ryanj Mar 21, 2017
- 2340 views
DOH! I just started making my own wiringPi.e wrapper a few days ago, and almost finished it! I successfully blinked leds with it so far. I am looking forward to using euphoria on the raspberry pi 3 (and Zero) for many projects in the future.
11. Re: Raspberry Pi
- Posted by jmduro Mar 22, 2017
- 2295 views
Without the added line, I get:
pi@raspberrypi: $ eui demos/test0
/home/pi/demos/GtkEnums.e:8 <0052>:: can't find 'std/io.e' in any of ...
/home/pi/demos
/home/pi/demos/test0.ex
public include std/io.e
Very strange.
EDIT: or maybe not. I'm using Raspian today, instead of Ubuntu, as a test. Forgot that, maybe debian works differently.
That is because there is an eu.cfg in demos, which misses the include folder. Without any eu.cfg, includes are found. There is no eu.cfg in my /usr/local/euphoria-4.1.0-RaspberryPi/bin/ folder.
I added EuGTK on my Raspberry Pi Model B Plus Rev 1.2 with following lines in /demos/eu.cfg. It works fine.
~/demos /usr/local/euphoria-4.1.0-RaspberryPi/include
Jean-Marc
12. Re: Raspberry Pi
- Posted by irv Mar 22, 2017
- 2319 views
Trying to compile the usual Hello World program:
pi@raspberrypi: $ euc hello
Build directory: build-203778/
Translating code, pass: 1 2 3 4 5 6 7 8 9 10 11 generating
Supplied directory '' is not a valid EUDIR
pi@raspberrypi: $
I've never seen that error before, what does it mean and how can I supply a correct one?
Note: eui hello runs fine.
13. Re: Raspberry Pi
- Posted by ChrisB (moderator) Mar 24, 2017
- 2250 views
Nice Wiki entry there Irv. Thanks.
Chris
14. Re: Raspberry Pi
- Posted by jmduro Mar 27, 2017
- 2147 views
I've never seen that error before, what does it mean and how can I supply a correct one?
I had to create EUDIR environment variable before it could compile:
export EUDIR=/usr/local/euphoria-4.1.0-RaspberryPi
I wonder if it is worth the job: one has to be very patient before the job gets done: the Pi doesn't have enough computing power (model B+). Regards
Jean-Marc
15. Re: Raspberry Pi
- Posted by irv Mar 27, 2017
- 2148 views
True. Running interpreted programs works acceptably well, there's a delay on startup, but from then on it's fine. For some reason, however, the compiler takes a LONG time to run (I finally got it working).
So, is it possible to cross-compile for the Arm on an x86-64?
16. Re: Raspberry Pi
- Posted by jmduro Mar 27, 2017
- 2207 views
True. Running interpreted programs works acceptably well, there's a delay on startup, but from then on it's fine. For some reason, however, the compiler takes a LONG time to run (I finally got it working).
So, is it possible to cross-compile for the Arm on an x86-64?
I don't know. I compiled it on a 32-bit Raspbian even if the Pi has 64-bit hardware.
Jean-Marc
17. Re: Raspberry Pi
- Posted by ghaberek (admin) Mar 28, 2017
- 2540 views
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 main()
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
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!
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.
http://raspberrypi.stackexchange.com/questions/43921/raspbian-moving-to-64-bit-mode
-Greg
18. Re: Raspberry Pi
- Posted by irv Mar 28, 2017
- 2159 views
It appears I've got missing or incorrect paths somewhere: I'm sure I could figure it out eventually, but would appreciate a hint if you have time :)
Translating code, pass: 1 2 3 4 generating 3.c files were created. To build your project, change directory to build-arm/ and type make -f hello.mak make: Entering directory `/home/irv/build-arm' arm-linux-gnueabihf-gcc -fomit-frame-pointer -c -w -fsigned-char -O2 -I/usr/local/share/euphoria -ffast-math init-.c -o init-.o arm-linux-gnueabihf-gcc -fomit-frame-pointer -c -w -fsigned-char -O2 -I/usr/local/share/euphoria -ffast-math hello.c -o hello.o arm-linux-gnueabihf-gcc -fomit-frame-pointer -c -w -fsigned-char -O2 -I/usr/local/share/euphoria -ffast-math main-.c -o main-.o In file included from /usr/include/stdint.h:25:0, from /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include/stdint.h:9, from /usr/local/share/euphoria/include/euphoria.h:15, from init-.c:1: /usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory # include <sys/cdefs.h> ^ compilation terminated.
19. Re: Raspberry Pi
- Posted by ghaberek (admin) Mar 28, 2017
- 2049 views
It appears I've got missing or incorrect paths somewhere: I'm sure I could figure it out eventually, but would appreciate a hint if you have time :)
Which distro are you using? I am doing this on Ubuntu 16.04.1 LTS and Raspbian 8 Jessie. Not sure if the gcc-arm-linux-gnueabihf package is available on your system but I noticed that on Ubuntu there is also a gcc-arm-linux-gnueabi package available and that is not the correct one (see ARM Ports). Can you do a search for cdefs.h on your system? (locate cdefs.h) Also, could you include the commands you ran in addition to the output?
-Greg
20. Re: Raspberry Pi
- Posted by irv Mar 28, 2017
- 2024 views
Thanks for the help. Here's the info:
irv@Mint17 ~ $ uname -a Linux Mint17 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux irv@Mint17 ~ $ sudo apt-get install gcc-arm-linux-gnueabihf [sudo] password for irv: Reading package lists... Done Building dependency tree Reading state information... Done gcc-arm-linux-gnueabihf is already the newest version. irv@Mint17 ~ $ locate cdefs.h /usr/include/x86_64-linux-gnu/sys/cdefs.h /usr/src/virtualbox-guest-4.3.36/include/VBox/cdefs.h /usr/src/virtualbox-guest-4.3.36/include/iprt/cdefs.h /var/lib/dkms/virtualbox-guest/4.3.36/build/include/VBox/cdefs.h /var/lib/dkms/virtualbox-guest/4.3.36/build/include/iprt/cdefs.h
21. Re: Raspberry Pi
- Posted by ghaberek (admin) Mar 28, 2017
- 2035 views
irv@Mint17 ~ $ locate cdefs.h /usr/include/x86_64-linux-gnu/sys/cdefs.h /usr/src/virtualbox-guest-4.3.36/include/VBox/cdefs.h /usr/src/virtualbox-guest-4.3.36/include/iprt/cdefs.h /var/lib/dkms/virtualbox-guest/4.3.36/build/include/VBox/cdefs.h /var/lib/dkms/virtualbox-guest/4.3.36/build/include/iprt/cdefs.h
Interesting. Linux Mint 17 is based on Ubuntu 14.04, so there are probably some packaging differences between the two versions.
It looks like you need to install libc6-dev-armhf-cross, which I probably got automatically and you did not.
This is what I show on my system:
$ locate cdefs.h /usr/arm-linux-gnueabihf/include/sys/cdefs.h /usr/include/x86_64-linux-gnu/sys/cdefs.h $ dpkg -l | grep armhf ii cpp-arm-linux-gnueabihf 4:5.3.1-1ubuntu1 amd64 GNU C preprocessor (cpp) for the armhf architecture ii gcc-arm-linux-gnueabihf 4:5.3.1-1ubuntu1 amd64 GNU C compiler for the armhf architecture ii libasan2-armhf-cross 5.4.0-6ubuntu1~16.04.4cross1 all AddressSanitizer -- a fast memory error detector ii libatomic1-armhf-cross 5.4.0-6ubuntu1~16.04.4cross1 all support library providing __atomic built-in functions ii libc6-armhf-cross 2.23-0ubuntu3cross1 all GNU C Library: Shared libraries (for cross-compiling) ii libc6-dev-armhf-cross 2.23-0ubuntu3cross1 all GNU C Library: Development Libraries and Header Files (for cross-compiling) ii libgcc-5-dev-armhf-cross 5.4.0-6ubuntu1~16.04.4cross1 all GCC support library (development files) ii libgcc1-armhf-cross 1:5.4.0-6ubuntu1~16.04.4cross1 all GCC support library ii libgomp1-armhf-cross 5.4.0-6ubuntu1~16.04.4cross1 all GCC OpenMP (GOMP) support library ii libstdc++6-armhf-cross 5.4.0-6ubuntu1~16.04.4cross1 all GNU Standard C++ Library v3 ii libubsan0-armhf-cross 5.4.0-6ubuntu1~16.04.4cross1 all UBSan -- undefined behaviour sanitizer (runtime) ii linux-libc-dev-armhf-cross 4.4.0-18.34cross1 all Linux Kernel Headers for development (for cross-compiling)
-Greg
22. Re: Raspberry Pi
- Posted by irv Mar 28, 2017
- 2039 views
It works!
Translating on the desktop (8megs memory) and cross-compiling results in a EuGTK program which loads in about 1 second on the Raspberry.
Compiling on the Raspberry with euc and -j4 works almost instantly for small programs, but I guess 1meg of memory is just not enough to compile a larger EuGTK program with any reasonable speed. That isn't a show stopper, I've compiled WEE and a couple other programs I use a lot, so they pop up immediately. The rest run ok when interpreted (5 sec or so to startup).
Thanks again for your help.
23. Re: Raspberry Pi
- Posted by rkdavis Mar 30, 2017
- 1980 views
bit late to the party as my posting privs were revoked as i've only been lurking for a few months. anyway a couple of years ago I started work on wrapping wiringpi for euphoria. it isn't complete and is very simple but at the time it worked.
https://github.com/ukscone/wiringPi-for-euphoria
however i've moved on from wiringPi for gpio use on the raspberry pi and now use pigpiod http://abyz.co.uk/rpi/pigpio/pigpiod.html as it can be used remotely as well as locally and can be used if you can write a file or to a socket in fact i use it with bash, GnuCOBOL, pretty much everything
24. Re: Raspberry Pi
- Posted by ryanj Mar 30, 2017
- 1982 views
bit late to the party as my posting privs were revoked as i've only been lurking for a few months. anyway a couple of years ago I started work on wrapping wiringpi for euphoria. it isn't complete and is very simple but at the time it worked.
https://github.com/ukscone/wiringPi-for-euphoria
however i've moved on from wiringPi for gpio use on the raspberry pi and now use pigpiod http://abyz.co.uk/rpi/pigpio/pigpiod.html as it can be used remotely as well as locally and can be used if you can write a file or to a socket in fact i use it with bash, GnuCOBOL, pretty much everything
Sounds interesting. I decided to create a RaspberryPi wiki page. Feel free to add content. I will try to work on content, too. I'm glad other people are working on wrappers for GPIO.