Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-12

Linux installation, where to put fpc?

7 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

On a Linux distro like for example Raspbian one could place the fpc compiler below /usr/xxx or in ~/fpc/xxx
As far as I can see using /usr makes the installation need sudo and the resulting files are owned by root, generally causing problems down the line when updating fpc...

Is there some reason I have overlooked for not installing fpc into say ~/fpc/<versionnumber>/?

Bo Berglund Developer in Sweden
Bart
to Bo Berglund
Bo Berglund wrote 5 lines
On a Linux distro like for example Raspbian one could place the fpc compiler below /usr/xxx or in ~/fpc/xxx As far as I can see using /usr makes the installation need sudo and the resulting files are owned by root, generally causing problems down the line when updating fpc...

Typically I install fpc using the fpc-x.y.z.i386-linux.tar file that has an install script.
I install it in /usr/local (needs sudo or su).
I never had any problem with updating using this method. After installing, the command "fpc" will open the last installed version.

Note: I never build fpc or change it's source files, so I'm with them being in a location that I have no write access to.

Bart

Bo Berglund
to Bart
Bart wrote
Note: I never build fpc or change it's source files, so I'm with them being in a location that I have no write access to.

Yes, in that case one could work that way.

But I am building fpc from sources (like I do for Lazarus too) and my script for this puts fpc at the same location as you are giving. Has to switch to sudo to do it...
But Lazarus goes right into the ~/dev/lazarus directory and works just fine.
I might add that on my Linux box (Raspberry Pi3 with Raspbian) there is only one user (pi) so it is not about having one installation that is shared amongst users...

Bo Berglund Developer in Sweden
leledumbo
to Bo Berglund: On a Linux distro like for example Raspbian one could place the fpc compiler below…
Is there some reason I have overlooked for not installing fpc into say ~/fpc/<versionnumber>/?

In your case, I see none. Since you don't want to share it among users, it's perfectly fine to install under your only user home directory.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Linux-installation-where-to-put-fpc-tp5727156p5727162.html Sent from the Free Pascal - General mailing list .
Sven Barth
"Bo Berglund" wrote 17 lines
On Sat, 31 Dec 2016 14:20:27 +0100, Bart wrote: >Note: I never build fpc or change it's source files, so I'm with them >being in a location that I have no write access to. Yes, in that case one could work that way. But I am building fpc from sources (like I do for Lazarus too) and my script for this puts fpc at the same location as you are giving. Has to switch to sudo to do it... But Lazarus goes right into the ~/dev/lazarus directory and works just fine. I might add that on my Linux box (Raspberry Pi3 with Raspbian) there is only one user (pi) so it is not about having one installation that is shared amongst users...

You can specify the installation directory to the Makefile using INSTALL_PREFIX. You then need to have the bin and (AFAIK) lib/<version> directory of that directory in PATH (and a suitable config as ~/.fpc.cfg).

Regards,
Sven

Marco van de Voort
to Sven Barth

In our previous episode, Sven Barth said:

Show quoted text 6 lines
> is only one user (pi) so it is not about having one installation that > is shared amongst users... You can specify the installation directory to the Makefile using INSTALL_PREFIX. You then need to have the bin and (AFAIK) lib/<version> directory of that directory in PATH.....

Yesno. On *nix a symlink should be made from the bin directory to the lib/<version>/ppc<arch> binary.

If you have multiple versions, the default one gets the symlink above, the rest get them with version number attached (e.g. ppc386-3.0 -> /usr/local/lib/fpc/3.0.0/ppc386)

Such versioned ones can be selected with fpc -V3.0 <file to compile>

Bo Berglund
to Marco van de Voort
Show quoted text 13 lines
> You can specify the installation directory to the Makefile using > INSTALL_PREFIX. You then need to have the bin and (AFAIK) lib/<version> > directory of that directory in PATH..... Yesno. On *nix a symlink should be made from the bin directory to the lib/<version>/ppc<arch> binary. If you have multiple versions, the default one gets the symlink above, the rest get them with version number attached (e.g. ppc386-3.0 -> /usr/local/lib/fpc/3.0.0/ppc386) Such versioned ones can be selected with fpc -V3.0 <file to compile>

My script has a line like this after compiling FPC:

sudo ln -sf /usr/lib/fpc/$FPCVER/ppcarm /usr/bin/ppcarm

In this case $FPCVER is a value like 3.0.0

Is this what you mean? And if so can I create the same just altering the source dir:

sudo ln -sf /home/pi/fpc/$FPCVER/ppcarm /usr/bin/ppcarm

/home/pi/fpc/ would be the top node of the fpc sources and the compiled binary.

Bo Berglund Developer in Sweden