Sign in Join

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

Mailing lists / fpc-pascal / 2010-07

installing or using multiple versions of FPC on linux

5 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Bernd Kreuss

Currently I have the latest svn of FPC installed (make install) which results in all files being installed where they belong, the binary being in the search path and fpc.cfg in /etc and I can easily use it with Lazarus.

Now I want to test something I wrote whether it will compile with an older version of FPC and I even need to recompile the entire Lazarus with the older FPC because it is a patch for Lazarus itself.

What is the easiest way to have a second installation of FPC around that I can easily switch to on the same machine without having to change half a dozen paths and moving config files around?

I have thought about switching compilers system-wide by simply having two compiled versions in two separate directories lying around and then simply "make install" in one of them or in the other one to switch between them. Does this make sense or is there a better (recommended) way of doing this?

Reply by email

Jonas Maebe
to Bernd Kreuss
Bernd Kreuss wrote
What is the easiest way to have a second installation of FPC around that I can easily switch to on the same machine without having to change half a dozen paths and moving config files around?

Personally, I never actually install my development FPC versions (other than manually copying the compiler binaries under different names, since as I work on the compiler it's handy to have multiple versions for comparison purposes).

I have a .fpc.cfg file in my home directory that looks more or less like this:

---
#ifdef VER2_5_1
-vei
-l
-Fu/Data/dev/fpc/rtl/units/$fpctarget
-Fu/Data/dev/fpc/packages/*/units/$fpctarget
#else
#ifdef VER_2_4_3
-vei
-l
-Fu/Data/dev/fpc-fixes/rtl/units/$fpctarget
-Fu/Data/dev/fpc-fixes/packages/*/units/$fpctarget #else
#include /etc/fpc
#endif
#endif
---

You occasionally have to modify the version numbers in the #ifdef statements, but other than that it's fairly hassle-free. How to combine this with Lazarus, I don't know.

Jonas

Reply by email

Lloyd Park
to Bernd Kreuss: Currently I have the latest svn of FPC installed (make install) which results in all…

I use symbolic links. I created /opt/fpc directory which contains subdirectories for each version I have available. /opt/fpc/fpc-current is a symbolic link to the directory of the version of fpc I am currently using. /opt/fpc/bin is a symbolic link to /opt/fpc/fpc-current/bin. In order to switch versions I just need to modify the /opt/fpc/fpc-current link.

My fpc.cfg file has unit/library/include references similar to this: -Fu/opt/k-/fpc/fpc-current/lib/fpc/$fpcversion/units/$fpctarget So it works with any version I install.

Here are the ugly notes I made when I set it up on my development box:

- First time retrieve from Subversion
cd /opt/fpc
- Stable branch
svn checkout http://svn.freepascal.org/svn/fpc/branches/fixes_2_2 fpc
- Development branch (v2.1.1)
svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc mv fpc fpc-<version>-svn
rm fpc-source
ln -s fpc-<version>-svn fpc-source

- Update the source from Subversion
cd /opt/fpc/fpc-<version>-svn
svn update

- Complile
cd /opt/fpc/fpc-<version>-svn
make OPT='-gl' zipinstall

Install the new zip
cd /opt/fpc
rm fpc-current
mkdir v<version>.<date>
ln -s v<version>.<date> fpc-current
cd fpc-current
tar -zxvf ../fpc-source/fpc-<version>.<cpu>-<arch>.tar.gz cd bin
ln -s ../lib/fpc/<version>/ppc386 .

Lloyd B. Park

Bernd Kreuss wrote 20 lines
Currently I have the latest svn of FPC installed (make install) which results in all files being installed where they belong, the binary being in the search path and fpc.cfg in /etc and I can easily use it with Lazarus. Now I want to test something I wrote whether it will compile with an older version of FPC and I even need to recompile the entire Lazarus with the older FPC because it is a patch for Lazarus itself. What is the easiest way to have a second installation of FPC around that I can easily switch to on the same machine without having to change half a dozen paths and moving config files around? I have thought about switching compilers system-wide by simply having two compiled versions in two separate directories lying around and then simply "make install" in one of them or in the other one to switch between them. Does this make sense or is there a better (recommended) way of doing this? _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Mark Morgan Lloyd
to Jonas Maebe: Personally, I never actually install my development FPC versions (other than manually…
Jonas Maebe wrote
... How to combine this with Lazarus, I don't know.

Lazarus has the --pcp= commandline option which defines the primary configuration path, hence the location of the FPC compiler binary and library sources. I've copied the source tree into an appropriate place in /usr/local/lib/fpc (i.e. fpcsrc is next to ppc386) and can generally run the current and preceding versions without problem.

As was pointed out to me a couple of weeks ago Lazarus doesn't have a configuration macro showing the FPC version it was built with, it goes and determines the FPC version using the path it's been told to follow.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mattias Gaertner
to Jonas Maebe: Personally, I never actually install my development FPC versions (other than manually…
Show quoted text 30 lines
On 26 Jul 2010, at 14:18, Bernd Kreuss wrote: > What is the easiest way to have a second installation of FPC around that > I can easily switch to on the same machine without having to change half > a dozen paths and moving config files around? Personally, I never actually install my development FPC versions (other than manually copying the compiler binaries under different names, since as I work on the compiler it's handy to have multiple versions for comparison purposes). I have a .fpc.cfg file in my home directory that looks more or less like this: --- #ifdef VER2_5_1 -vei -l -Fu/Data/dev/fpc/rtl/units/$fpctarget -Fu/Data/dev/fpc/packages/*/units/$fpctarget #else #ifdef VER_2_4_3 -vei -l -Fu/Data/dev/fpc-fixes/rtl/units/$fpctarget -Fu/Data/dev/fpc-fixes/packages/*/units/$fpctarget #else #include /etc/fpc #endif #endif --- You occasionally have to modify the version numbers in the #ifdef statements, but other than that it's fairly hassle-free. How to combine this with Lazarus, I don't know.

Lazarus asks the compiler for its search paths and settings. So the above is also seen by the IDE.
Whenever you change the compiler path in the environment options it asks again.
It has a history list of all used compiler file names, so switching between two compilers is easy.

Mattias

Reply by email