* * *

Author Topic: Multiple FPC versions + fpcupdeluxe  (Read 644 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2915
  • I like bugs.
Multiple FPC versions + fpcupdeluxe
« on: May 26, 2017, 02:41:36 pm »
I am finally testing fpcupdeluxe, got from here:
  https://github.com/newpascal/fpcupdeluxe
It successfully built FPC trunk. It downloaded a root compiler which worked well. It did not use my already installed FPC 3.0.2 as a root but that is OK.

I copied the config file ~/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg to directory /etc.
I can use the new compiler by defining its full path ~/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.
I can also build Lazarus from my existing repo by setting the paths.

How do you people easily switch between compiler versions?
This may be a dummy question. I have already forgotten how to tweak the compiler configs.

Some notes about fpcupdeluxe:
The GUI is confusing. It shows settings for Lazarus, too, even if you don't plan to install it.
This tool is most useful for installing FPC. Lazarus is easy to install in any case once FPC works.
There should be sections (GroupBox) for FPC and Lazarus. A checkbox would select if a section gets built. If not checked, the section's settings would be disabled.
Finally a button would build what is selected.

molly

  • Hero Member
  • *****
  • Posts: 1612
Re: Multiple FPC versions + fpcupdeluxe
« Reply #1 on: May 27, 2017, 03:08:19 am »
How do you people easily switch between compiler versions?
afaik there are several options.

In one setup i let every fpc have it's own configuration file set the cfgdir to a common root and include a common fpc.cfg that is used by all FPC versions (correct directory tree is important there). You could also use environment variable PPC_CONFIG_PATH for that of course but, i like to stay flexible just in case it is needed.

Then, inside common fpc.cfg, you can do things like:
-Fu$FPC_ROOT$\$FPCVERSION\units\$FPCTARGET\*

(Shame that CFGDIR does not get 'translated' or there is a common ROOT that can be set, as it would avoid the use of FPC_ROOT environment variable in above example and/or would allow for a more portable solution).

My editor invokes the required FPC version (user configurable tool-menu options), and that is all to it.

In order to "switch" on commandline i use an environment variable for the FPC version and a small script that listens to the name fpc. I try to avoid depending on paths as FPC does not depend on it.

An alternative to using a script might be a small front-end that adds an extra parameter for supplying the version (that get's stripped from the argument list) and then invoke the corresponding fpc with the 'usual' parameters, just passing those to FPC.

Things can get a bit more complicated using multiple installations targeting different processors belonging to the same line (m68k, arm).

« Last Edit: May 27, 2017, 03:43:05 am by molly »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2915
  • I like bugs.
Re: Multiple FPC versions + fpcupdeluxe
« Reply #2 on: May 31, 2017, 12:56:02 pm »
One more thing. Can I build a debug RTL with fpcupdeluxe?
I found an old answer from 2016 and then it was not possible.
 http://forum.lazarus.freepascal.org/index.php/topic,34645.msg229957.html#msg229957

Maybe things have changed?
Debugging RTL is one of the main motivations to build your own compiler instead of installing ready binaries.
« Last Edit: May 31, 2017, 12:59:27 pm by JuhaManninen »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 705
Re: Multiple FPC versions + fpcupdeluxe
« Reply #3 on: May 31, 2017, 01:52:34 pm »
@JuhaManninen

There is no easy switch between compiler versions, once an install-choice has been made.
Some users, including myself, just use different directories for complete FPC/Laz install, with their own local copy of fpcupdeluxe.

In fact and again speaking for myself, I have always 5 installs: stable, fixes, trunk, NewPascal and an old NewPascal.
All in their own directory, with their own cross-compilers and fpcupdeluxe.
In this way, all installs are fully isolated and remain that way.

In general, fpcupdeluxe is made to install both FPC and Lazarus as a working combi, with the correct settings.
In addition to this, you can also choose to only install FPC or Lazarus.
However, I will look into some GUI changes to make the distinction between FPC and Lazarus more clear.

It should also be possible to build a debug-compiler. However I did not check until now.
It should be as easy as adding the debug-settings into the [setup+] FPC compiler options.



Thaddy

  • Hero Member
  • *****
  • Posts: 3640
Re: Multiple FPC versions + fpcupdeluxe
« Reply #4 on: May 31, 2017, 02:26:55 pm »
including myself, just use different directories for complete FPC/Laz install, with their own local copy of fpcupdeluxe.
Which is sheer....... Don't even promote it. Use OS defaults.
But you are doing a great job, you know my opinion.

A better solution is to use different subdirectories from the OS promoted directory.

This only goes wrong with Delphi7 and below, that requires a separation from the default directories and MS keeps informing me the software may be incompatible with the OS. Which it isn't. If you install in a wrong directory... :D
Regards,
Thaddy
Why do the Danish always try to fuck up any programming language?

DonAlfredo

  • Hero Member
  • *****
  • Posts: 705
Re: Multiple FPC versions + fpcupdeluxe
« Reply #5 on: May 31, 2017, 03:05:29 pm »
@Thaddy

If their would exists the absolute truth, naturally fpcupdeluxe would follow it ...
With truth I means the absolute correct way of using fpcupdeluxe.
And any guidance for the above will always be appreciated.

For me, the correct way of installing FPC and Lazarus is using the officially available binaries.
And use them in the prescribed manner.

Fpcupdeluxe reason of existence is twofold:
a: if the official install fails or is unavailable (trunk; NP), fpcupdeluxe could be used, with its own peculiarities.
b: easy cross-compilers.

Thaddy

  • Hero Member
  • *****
  • Posts: 3640
Re: Multiple FPC versions + fpcupdeluxe
« Reply #6 on: May 31, 2017, 03:22:38 pm »
@Thaddy

If their would exists the absolute truth, naturally fpcupdeluxe would follow it ...
With truth I means the absolute correct way of using fpcupdeluxe.
And any guidance for the above will always be appreciated.

For me, the correct way of installing FPC and Lazarus is using the officially available binaries.
And use them in the prescribed manner.

Fpcupdeluxe reason of existence is twofold:
a: if the official install fails or is unavailable (trunk; NP), fpcupdeluxe could be used, with its own peculiarities.
b: easy cross-compilers.
There are at least two semi-absolute truths that I know of:
In linux /usr/lib/<whatever software> or /usr/local/lib<whatever software> and the binaries go there too, except if you do not want to create a symlink to /usr/bin or /usr/local/bin
(BTW DEBIAN LINUX INSTALLS DO IT CORRECT, but Debian lags...)
With Windows it is more or less the same:
<root most often C, should be P> mostly c:\program files\<you get the point....>
Why do the Danish always try to fuck up any programming language?

DonAlfredo

  • Hero Member
  • *****
  • Posts: 705
Re: Multiple FPC versions + fpcupdeluxe
« Reply #7 on: May 31, 2017, 03:46:21 pm »
@Thaddy
Quote
c:\program files\
/usr/lib/
/usr/local/lib
Am I right that your suggestions need elevated rights ?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2915
  • I like bugs.
Re: Multiple FPC versions + fpcupdeluxe
« Reply #8 on: May 31, 2017, 03:48:12 pm »
It should also be possible to build a debug-compiler. However I did not check until now.
It should be as easy as adding the debug-settings into the [setup+] FPC compiler options.
Actually it works, yes. I entered "-g -gl -O-" into "FPC options" field and built again. Now I can debug RTL.
Thanks.
« Last Edit: May 31, 2017, 03:49:46 pm by JuhaManninen »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 705
Re: Multiple FPC versions + fpcupdeluxe
« Reply #9 on: May 31, 2017, 03:50:53 pm »
@JuhaManninen
Thanks for the feedback ... will add it into the Wiki !

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus