Recent

Author Topic: [SOLVED] Lazarus+FPC SVN: FPC version in "About" does not match FPC version  (Read 2851 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Today I did get the idea to update fpc (3.0.4) and run the fpc version from SVN (3.3.1).
After tinkering for several hours, it kept amazing me that Lazarus just refused to switch FPC version.
Well, that is until I noticed this:
  • The FPC version shown in the About box is 3.0.4.
  • When compiling a project, the "Messages" window shows "Verbose: Free Pascal Compiler version 3.3.1 [2020/01/08] for x86_64"
(see screenshot)


I'm not a Linux expert, so I could possibly have done something wrong (I followed the steps on this Wiki page for Linux).


Things I've tried and verified:


In "options" the "Compiler executable" is set to "/usr/bin/fpc".
Executing "/usr/bin/fpc" in a shell gives version 3.3.1.

The "fpc source directory" is set to "/usr/share/fpcsrc/$(FPCVER)/".
The directory "/usr/share/fpcsrc/3.3.1/" exists and shows the correct 3.3.1 sources.

In the "version.pas" file in "/usr/share/fpcsrc/3.3.1/compiler/" it shows:
Code: Pascal  [Select][+][-]
  1.     const
  2.        { version string }
  3.        version_nr = '3';
  4.        release_nr = '3';
  5.        patch_nr   = '1';

I was wondering if this is a bug or because I did something wrong ...
« Last Edit: January 08, 2020, 02:26:43 pm by Hansaplast »

guest65109

  • Guest
If you use fpc trunk you should also use lazarus trunk. Stable lazarus could have problem parsing the newer fpc trunk's source.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
IIRC, the version shown in the About box is that with which Lazarus itself was compiled, not the one it uses to compile. It just happens that in more "standard" instalations they are both the same.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
@lucamar: Thanks - Doh! ... yep that makes sense!


@mr.coll: I'm running Lazarus and FPC from trunk.


Installing FPC from trunk seems far more complicated that I'd hoped it would be.  :(
Maybe there is an automated way that can be introduced in the future?
(getlazarus.org is not a good option)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
IIRC, the version shown in the About box is that with which Lazarus itself was compiled, not the one it uses to compile. It just happens that in more "standard" instalations they are both the same.

Agreed. The other thing to consider is that when switching versions one is still using the same Lazarus per-user state, which can be worked round by careful scripting and the --pcp= command-line option.

I normally set up symlinks for the ppc binary so that a given version of Lazarus can get to a particular compiler version without ambiguity:

Code: [Select]
$ ls -l /usr/local/bin/ppc*
lrwxrwxrwx 1 root staff 12 Nov 21  2018 /usr/local/bin/ppcx64 -> ppcx64-3.0.4
lrwxrwxrwx 1 root staff 31 Nov 21  2018 /usr/local/bin/ppcx64-2.6.4 -> /usr/local/lib/fpc/2.6.4/ppcx64
lrwxrwxrwx 1 root staff 31 Nov 21  2018 /usr/local/bin/ppcx64-3.0.0 -> /usr/local/lib/fpc/3.0.0/ppcx64
lrwxrwxrwx 1 root staff 31 Nov 21  2018 /usr/local/bin/ppcx64-3.0.2 -> /usr/local/lib/fpc/3.0.2/ppcx64
lrwxrwxrwx 1 root staff 31 Nov 21  2018 /usr/local/bin/ppcx64-3.0.4 -> /usr/local/lib/fpc/3.0.4/ppcx64

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Thanks MarkMLI for the tip!


Like I said: the compiler setup from trunk has been quite a pain to get started with (if you're not a very experienced Linux user or know all the ins-and-outs of the fpc compiler setup).

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Shameless self-promotion ...  :D ... but you might try fpcupdeluxe !

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Thanks MarkMLI for the tip!

An even more useful tip is that when setting something like that up, the  ln  (link) command works in the same direction as  cp  (copy). So to set up a symlink (symbolic link) as in my example you do

Code: [Select]
ln -s /usr/local/lib/fpc/3.0.4/ppcx64 /usr/local/bin/ppcx64-3.0.4

and so on. Don't forget the  -s  and if necessary also use  -f  to overwrite an existing link. If in doubt see the manpage.

MarkMLl

MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Thanks again MarkMLI!  :)


@DonAlfredo: thanks for the tip. There is absolutely nothing wrong with promoting something that could help! 😊
However; I've ran into issues in the past with fpcupdeluxe, and completely lost what was going on on my (virtual) Linux machine 😞
So I'm weary of using it. Sorry. I do appreciate the work you're doing though.
Maybe I'll give it a try in the future. Thanks again for the tip!

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Quote
Maybe I'll give it a try in the future.
The future begins today ...  ;)

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Quote
Maybe I'll give it a try in the future.
The future begins today ...  ;)


Very true! I'll add it to my New Year's resolutions  ::)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
I normally set up symlinks for the ppc binary so that a given version of Lazarus can get to a particular compiler version without ambiguity:

Code: [Select]
$ ls -l /usr/local/bin/ppc*
lrwxrwxrwx 1 root staff 12 Nov 21  2018 /usr/local/bin/ppcx64 -> ppcx64-3.0.4
lrwxrwxrwx 1 root staff 31 Nov 21  2018 /usr/local/bin/ppcx64-2.6.4 -> /usr/local/lib/fpc/2.6.4/ppcx64
<etc>

Good idea! Don't forget fpc too - I had all sorts of weird issues when fpc was a 3.0.4 executable but everything else was 3.3.1.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Good idea! Don't forget fpc too - I had all sorts of weird issues when fpc was a 3.0.4 executable but everything else was 3.3.1.

For historical reasons I normally build from source, and move most of the binaries from /usr/local/bin into into /usr/local/bin/fpc.d/3.0.4 and so on. The result of that is that the fpc binary is normally the most recent... I've not had any problem with that combination.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018