Linux installation, where to put fpc?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Linux installation, where to put fpc?

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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linux installation, where to put fpc?

Bart-48
On 12/31/16, Bo Berglund <[hidden email]> wrote:

> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linux installation, where to put fpc?

Bo Berglund
On Sat, 31 Dec 2016 14:20:27 +0100, Bart
<[hidden email]> 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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linux installation, where to put fpc?

leledumbo
Administrator
In reply to this post by Bo Berglund
> 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.
Reply | Threaded
Open this post in threaded view
|

Re: Linux installation, where to put fpc?

Sven Barth-2
In reply to this post by Bo Berglund

Am 31.12.2016 14:37 schrieb "Bo Berglund" <[hidden email]>:
>
> On Sat, 31 Dec 2016 14:20:27 +0100, Bart
> <[hidden email]> 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


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linux installation, where to put fpc?

Marco van de Voort
In our previous episode, Sven Barth said:
> > 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>


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linux installation, where to put fpc?

Bo Berglund
On Sat, 31 Dec 2016 23:13:22 +0100 (CET),
[hidden email] (Marco van de Voort) wrote:

>> 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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal