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

I am finally testing fpcupdeluxe, got from here:https://github.com/newpascal/fpcupdeluxeIt 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.

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

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.

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... Regards,Thaddy

Logged

"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

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.

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

Logged

"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

There is no easy switch between compiler versions, once an install-choice has been made.

The latter remark seems untrue.

For some obscure reason i came across something interesting in the sources. That led me to this wiki-page.

These seem to be undocumented options, that allow you to switch between different compilers.

Having said that, it works unlogically and counterproductive for me atm (i'm still experimenting) and might perhaps not be a solution for DonAlfredo's setup (because using different compilers as well as different versions).

However, being undocumented i wonder if these options are deprecated for actual usage ?

it is always possible to write a simple front-end that passes along fpc options and let the front-end remove the undocumented options to 'switch' directories, e.g. invoking the fpc from desired location.