rudiratlos
Posts: 160
Joined: Tue May 01, 2012 8:47 am

Re: freepascal on RPi

Tue May 01, 2012 1:46 pm

Hi,

1. Has anyone tried to install FreePascal (FPC) on the RPI?

2. Has anyone tried to run a crosscompiled FPC program on the RPI?

Thanks

plugwash
Forum Moderator
Forum Moderator
Posts: 3517
Joined: Wed Dec 28, 2011 11:45 pm

Re: freepascal on RPi

Tue May 01, 2012 2:31 pm

rudiratlos said:


1. Has anyone tried to install FreePascal (FPC) on the RPI?


I would have done if I had managed to get my hands on the bloody thing. I have however used it on other arm hardware with no problems.

If you are running debian armel it should be a simple matter of apt-get install fpc.


2. Has anyone tried to run a crosscompiled FPC program on the RPI?


Never had much luck with cross compiling myself, i'm sure it can be made to work but it's a PITA getting everything in the right places.

rudiratlos
Posts: 160
Joined: Tue May 01, 2012 8:47 am

Re: freepascal on RPi

Thu May 03, 2012 1:36 pm

Does anyone have installed FPC on the RPI with apt-get install fpc ?

and run the compiler and a hello-world program ?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24934
Joined: Sat Jul 30, 2011 7:41 pm

Re: freepascal on RPi

Thu May 03, 2012 2:30 pm

I'll try and remember to try it this evening.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24934
Joined: Sat Jul 30, 2011 7:41 pm

Re: freepascal on RPi

Thu May 03, 2012 7:57 pm

OK, tried this....seems to work fine.

[email protected]:~$ cat test.pas
program temperature(output) ;
{ Program to convert temperatures from
Fahrenheit to Celsius. }
const
MIN = 32 ;
MAX = 50 ;
CONVERT = 5 / 9 ;
var
fahren: integer ;
celsius: real ;
begin
writeln('Fahrenheit Celsius') ;
writeln('---------- -------') ;
for fahren := MIN to MAX do begin
celsius := CONVERT * (fahren - 32) ;
writeln(fahren: 5, celsius: 18: 2) ;
end ;
end.
[email protected]:~$ fpc test.pas
Free Pascal Compiler version 2.4.0-2 [2010/02/20] for arm
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARMEL
Compiling test.pas
Assembling temperature
Linking test
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
18 lines compiled, 1.4 sec
[email protected]:~$ ls
Desktop test test.o test.pas
[email protected]:~$ ./test
Fahrenheit Celsius
---------- -------
32 0.00
33 0.56
34 1.11
35 1.67
36 2.22
37 2.78
38 3.33
39 3.89
40 4.44
41 5.00
42 5.56
43 6.11
44 6.67
45 7.22
46 7.78
47 8.33
48 8.89
49 9.44
50 10.00
[email protected]:~$
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

KenP
Posts: 14
Joined: Sun Jun 17, 2012 6:13 am

Re: freepascal on RPi

Thu Jun 21, 2012 1:14 pm

rudiratlos wrote:Hi,

1. Has anyone tried to install FreePascal (FPC) on the RPI?

2. Has anyone tried to run a crosscompiled FPC program on the RPI?

Thanks
1. Not yet, but will do tonight!

2. No, and once FPC is up and running, no reason (for me) to bother, really.

IMO, the Pi and FPC are ideal bed-mates. Pascal was invented as a teaching language, and encourages good coding habits. The OO that was later added was done (again, IMO) right. Not over-complicated, easy to understand, and extremely powerful. Being open-source is a major bonus, and I can easily see somebody packaging up a PascalPi, with OS and FPC pre-installed and ready to go.

BTW, FPC includes a simple IDE (FP), which runs beautifully in text mode (i.e. over an SSH connection), and you can add Lazarus for Delphi-style GUI development, although I'm so unimpressed with the GUI desktops looked at so far on the Pi that I'll probably keep mine headless.
Opinions expressed in this message are not necessarily those of the author.
I don't know where they come from.
It scares me sometimes.

forumisto
Posts: 386
Joined: Fri Mar 16, 2012 8:41 am

Re: freepascal on RPi

Thu Jun 21, 2012 6:08 pm

sudo apt-get install fpc
......
It needs 139MB :shock: :shock: :shock:

KenP
Posts: 14
Joined: Sun Jun 17, 2012 6:13 am

Re: freepascal on RPi

Thu Jun 21, 2012 9:07 pm

...and hangs and apparently kills the Pi

Just being overly dramatic - my Pi isn't well, I have a feeling I've got a dodgy SD card; it hangs up for a minute or two periodically, and hung up permanently while trying to install FP. I'll try again, otherwise will wait for my new SDs from Amazon.
Opinions expressed in this message are not necessarily those of the author.
I don't know where they come from.
It scares me sometimes.

forumisto
Posts: 386
Joined: Fri Mar 16, 2012 8:41 am

Re: freepascal on RPi

Thu Jun 21, 2012 9:26 pm

maybe the reason is a bad power supply

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: freepascal on RPi

Fri Jun 22, 2012 12:41 am

forumisto wrote:sudo apt-get install fpc
......
It needs 139MB :shock: :shock: :shock:
To be fair, it's all the development libraries that fpc relies on that use up all the diskspace, rather than fpc itself. More libraries = more features that fpc supports :)

KenP
Posts: 14
Joined: Sun Jun 17, 2012 6:13 am

Re: freepascal on RPi

Fri Jun 22, 2012 9:33 am

forumisto wrote:maybe the reason is a bad power supply
I think the biggest problem was a dodgy USB hub, as a lot of things which were going squiffy have now resolved themselves.

Now.... talking to a Velleman K8055 over USB in Pascal....hmmm....
Opinions expressed in this message are not necessarily those of the author.
I don't know where they come from.
It scares me sometimes.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: freepascal on RPi

Fri Jun 22, 2012 10:27 am

KenP wrote:Now.... talking to a Velleman K8055 over USB in Pascal....hmmm....
You need to split it down into two problems:
1) get http://libk8055.sourceforge.net/ working on the RPi ( http://www.raspberrypi.org/phpBB3/viewt ... =37&t=8598 )
2) get Pascal talking to libk8055

Return to “General discussion”