[fpc-pascal] FPC 3.0.0 seed compiler for Rasperry Pi ARM?

Bo Berglund bo.berglund at gmail.com
Mon Jan 9 15:12:50 CET 2017

I have trouble understanding what I see after my build attempt. Please
say what I am doing wrong...

- Sources for FPC 3.0.2RC1 are in ~/dev/fpc/3.0.2RC1
- Seed compiler ppcarm v. 3.0.0 is in ~/dev/fpc
- ~/bin is empty
- I move into the source dir ~/dev/fpc/3.0.2RC1
- I run this command:
make all install FPC="/home/pi/dev/fpc/ppcarm"
- The command executes for 12 minutes and ends without error
- I look in ~/bin and it now contains a lot of executables
- The compiler is in /home/pi/lib/fpc/3.0.2/ so I link it to bin:
ln -sf "/home/pi/lib/fpc/3.0.2/ppcarm" "/home/pi/bin/ppcarm"

Now if I am in ~ and enter ppcarm the result shows up as:
~ $ ppcarm
Free Pascal Compiler version 3.0.2rc1 [2017/01/09] for arm

Next, if I enter fpc I get this:
~ $ fpc
Free Pascal Compiler version 3.0.0 [2016/03/05] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
/usr/bin/fpc [options] <inputfile> [options]

So I move into the bin dir and repeat the fpc command:
<same result showing the wrong location>

Next I use ./fpc and get a different result:
~/bin $ ./fpc
Free Pascal Compiler version 3.0.2rc1 [2017/01/09] for arm
Copyright (c) 1993-2016 by Florian Klaempfl and others
/home/pi/bin/fpc [options] <inputfile> [options]

My path is:
~/bin $ echo $PATH

Finally back in the home root:
~ $ which fpc
So clearly fpc is here detected in the correct location yet when it
executes it seems to go wrong.

Why is execution of the command fpc picking up the old /usr/bin/fpc
rather than the /home/pi/bin/fpc that is clearly before in the path

Bo Berglund
Developer in Sweden

More information about the fpc-pascal mailing list