Sign in Join

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

Mailing lists / fpc-pascal / 2012-02

How to ? Using two compiler versions.

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Koenraad Lelong

Hi,

I'm searching for some document how to set up a system to use two versions of fpc.
I'm trying to make a working arm-embedded compiler. With 2.6.0 I seem unable to do that, so I want to try it with the svn-version of fpc. But when I just install that, I lose the 2.6.0 version. What have I to do to be able to use the two versions in parallel ?

I tried to make the arm-embedded compiler by compiling the svn-version with fpc-2.6.0, but that fails.

Thanks for any info.

Regards,

Koenraad Lelong.

Reply by email

Rainer Stratmann
to Koenraad Lelong
Koenraad Lelong wrote 13 lines
Hi, I'm searching for some document how to set up a system to use two versions of fpc. I'm trying to make a working arm-embedded compiler. With 2.6.0 I seem unable to do that, so I want to try it with the svn-version of fpc. But when I just install that, I lose the 2.6.0 version. What have I to do to be able to use the two versions in parallel ? I tried to make the arm-embedded compiler by compiling the svn-version with fpc-2.6.0, but that fails. Thanks for any info.

The best would be each version in each separate home/user/fpc/v1 or home/user/fpc/v2 directory. That should be possible. Also to simplify installing.

Reply by email

Henry Vermaak
to Koenraad Lelong: I'm searching for some document how to set up a system to use two versions of fpc. I'm…
Koenraad Lelong wrote 8 lines
Hi, I'm searching for some document how to set up a system to use two versions of fpc. I'm trying to make a working arm-embedded compiler. With 2.6.0 I seem unable to do that, so I want to try it with the svn-version of fpc. But when I just install that, I lose the 2.6.0 version. What have I to do to be able to use the two versions in parallel ?

How do you install it? I use 2.6.0 and trunk, so it's definitely possible. I install to /usr/local on linux (but I have a similar setup on Windows), then I end up with the different versions like this:

/usr/local/lib/fpc/2.6.0
/usr/local/lib/fpc/2.7.1

Make sure you set up fpc.cfg to look at the right directories, e.g.

-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/rtl

Then you can just call the compiler directly, like:

/usr/local/lib/fpc/2.7.1/ppcrossarm

You can also set up symlinks/copies with a version suffix:

ls -l /usr/local/bin/ppcrossarm*
lrwxrwxrwx 1 root root 35 Feb 8 11:48 /usr/local/bin/ppcrossarm-2.7.1 -> /usr/local/lib/fpc/2.7.1/ppcrossarm

Then use it like this:

fpc -Parm -V2.7.1
Free Pascal Compiler version 2.7.1 [2011/09/27] for arm Copyright (c) 1993-2011 by Florian Klaempfl and others /usr/local/lib/fpc/2.7.1/ppcrossarm [options] <inputfile> [options] ...
...

So you can use different versions by just changing the -V parameter.

Henry

Reply by email

Koenraad Lelong
to Henry Vermaak
Henry Vermaak wrote 6 lines
How do you install it? I use 2.6.0 and trunk, so it's definitely possible. I install to /usr/local on linux (but I have a similar setup on Windows), then I end up with the different versions like this: /usr/local/lib/fpc/2.6.0 /usr/local/lib/fpc/2.7.1

On my 64-bit OpenSuse I installed it from the rpm, so it went into /usr/lib64/fpc/...

Show quoted text 5 lines
Make sure you set up fpc.cfg to look at the right directories, e.g. -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/rtl

My fpc.cfg was similar, all pointing to /usr/lib64/fpc/... And that will be a problem. When I installed ppcrossarm (2.6.0 version), I used PREFIX=/usr, so all went into /usr/lib/fpc/... Is there way to select those paths depending on the version ? Like #if $fpcversion=2.7.1
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
...
#else
-Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget
...
#end

Show quoted text 15 lines
Then you can just call the compiler directly, like: /usr/local/lib/fpc/2.7.1/ppcrossarm You can also set up symlinks/copies with a version suffix: ls -l /usr/local/bin/ppcrossarm* lrwxrwxrwx 1 root root 35 Feb 8 11:48 /usr/local/bin/ppcrossarm-2.7.1 -> /usr/local/lib/fpc/2.7.1/ppcrossarm Then use it like this: fpc -Parm -V2.7.1 So you can use different versions by just changing the -V parameter.

That's new to me, interesting.

So how should I make the crosscompiler ? -V seems not to work with the make-command.
If I "make clean build install" svn-trunk I will overwrite 2.6.0. So I should "make clean build", then rename/link /usr/bin/ppcx64 to something e.g. ppcx64-2.6.0, then "make install" and rename/link ppcx64 to ppcx64-2.7.1.
Then to make the crosscompiler how do I specify to use ppcx64-2.7.1 ?

I'll try some things. I use a virtual machine so it would be no big pain if things go wrong.

Thanks for the info,

Koenraad.

Reply by email

Henry Vermaak
to Koenraad Lelong
Koenraad Lelong wrote 11 lines
> Make sure you set up fpc.cfg to look at the right directories, e.g. > > -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget > -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/* > -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/rtl My fpc.cfg was similar, all pointing to /usr/lib64/fpc/... And that will be a problem. When I installed ppcrossarm (2.6.0 version), I used PREFIX=/usr, so all went into /usr/lib/fpc/... Is there way to select those paths depending on the version ? Like #if $fpcversion=2.7.1

#ifdef ver2_7_1

Show quoted text 24 lines
> Then you can just call the compiler directly, like: > > /usr/local/lib/fpc/2.7.1/ppcrossarm > > You can also set up symlinks/copies with a version suffix: > > ls -l /usr/local/bin/ppcrossarm* > lrwxrwxrwx 1 root root 35 Feb 8 11:48 /usr/local/bin/ppcrossarm-2.7.1 -> > /usr/local/lib/fpc/2.7.1/ppcrossarm > > Then use it like this: > > fpc -Parm -V2.7.1 > So you can use different versions by just changing the -V parameter. That's new to me, interesting. So how should I make the crosscompiler ? -V seems not to work with the make-command. If I "make clean build install" svn-trunk I will overwrite 2.6.0. So I should "make clean build", then rename/link /usr/bin/ppcx64 to something e.g. ppcx64-2.6.0, then "make install" and rename/link ppcx64 to ppcx64-2.7.1. Then to make the crosscompiler how do I specify to use ppcx64-2.7.1 ?

I'm afraid I don't understand the question.

Henry

Reply by email

Koenraad Lelong
to Henry Vermaak

On 08-02-12 14:31, Henry Vermaak wrote:
...

> Then to make the crosscompiler how do I specify to use ppcx64-2.7.1 ? I'm afraid I don't understand the question.

Never mind. I now remember that the buildprocess first builds it's own compiler, using the 'old' compiler. Then the new compiler is used to compile itself, then that compiler is used to compile the rest.

Anyway, trying to build a crosscompiler for cortexm3 fails.

Thanks,

Koenraad.

Reply by email