Recent

Author Topic: 64 versus 32 Bit Lazarus Installation under Windows 10  (Read 3275 times)

PeterX

  • Sr. Member
  • ****
  • Posts: 390
64 versus 32 Bit Lazarus Installation under Windows 10
« on: December 24, 2020, 01:26:59 pm »
Hi,

24 of december, a good day to think about "64 versus 32 Bit"  :D

I ever used the 32 bit Lazarus Windows Installer, never thought about using the 64 bit compiler.
Now someone showed me some bugs in sources I offer, when being used with the 64 bit compiler. (mostly pointer stuff I think ..  >:(  => PTRUINT etc. ..)
So I would like to test my sources under 64 bit before releasing new versions of the code.

What's the recommended way - actually with version 2.0.10
- installing both 64 and 32 Bit Lazarus in parallel folders, oder better ..
- installing the 64 bit version and the cross-compiler ?

Are there differences in debugging or so when using the 64 bit IDE / compiler with the 32 bit target ?

 %)
« Last Edit: December 24, 2020, 01:29:27 pm by PeterX »
usually using latest Lazarus release version with Windows 10

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #1 on: December 24, 2020, 01:36:25 pm »
I've always installed the proper Lazarus/FPC (32bit for 32bit Windows, etc.) and the cross-compiler add-on, for example (64bit):
  • lazarus-2.0.10-fpc-3.2.0-win64.exe
  • lazarus-2.0.10-fpc-3.2.0-cross-i386-win32-win64.exe
and never had any problems, other than the logical one of being unable to run/debug 64bit binaries on a 32bit platform.

Same goes for just FPC, I'd install (for 32bit):
  • fpc-3.2.0.i386-win32.exe
  • fpc-3.2.0.i386-win32.cross.x86_64-win64.exe

Note, though, that I don't use the debugger that much and some of my co-workers have had to install one of the alternative GDBs, so YMMV
« Last Edit: December 24, 2020, 01:39:29 pm by lucamar »
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.

wp

  • Hero Member
  • *****
  • Posts: 8747
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #2 on: December 24, 2020, 01:59:32 pm »
I always install separate versions, Harddisks are cheap now, and its's much quicker to click on the icon of the 32- or 62-bit versions on the desktop than to configure the crosscompiler or to set up the build modes...

For installing separate versions you must make sure that the box "Secondary installation" is checked in the installer - this keeps the config files separate. On the negative side, however, you must install components twice.

BTW, there are special Lazarus icons for 32- and 64-bit icons in lazarus-CCR, folder applications/laz_icons (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/applications/laz_icons/).
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

MarkMLl

  • Hero Member
  • *****
  • Posts: 3064
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #3 on: December 24, 2020, 02:26:24 pm »
I agree from the Linux POV as well: install both.

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

PeterX

  • Sr. Member
  • ****
  • Posts: 390
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #4 on: December 24, 2020, 02:38:29 pm »
Okay, so I'd prefer installing them both, in parallel.  :)
Looks easier to me.

Now what's about the Project ?
Can I create / open it in both 32 and 64 Bit Lazarus ?
Does this work ?
usually using latest Lazarus release version with Windows 10

PeterX

  • Sr. Member
  • ****
  • Posts: 390
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #5 on: December 24, 2020, 02:45:10 pm »
BTW, there are special Lazarus icons for 32- and 64-bit icons in lazarus-CCR, folder applications/laz_icons (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/applications/laz_icons/).
That's a good hint, makes life easier .. thanks !
usually using latest Lazarus release version with Windows 10

wp

  • Hero Member
  • *****
  • Posts: 8747
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #6 on: December 24, 2020, 03:34:40 pm »
Can I create / open it in both 32 and 64 Bit Lazarus ?
Does this work ?
Yes.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7400
  • Debugger - SynEdit - and more
    • wiki
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #7 on: December 24, 2020, 04:15:47 pm »
The cross installer can be used....

The advantage is, that you can set up build modes for each bitness, allowing you to quickly change the target.

But as for debugging....

- There were some issues with gdb.  (affecting the Pause button, and changing breakpoints while the app is running)
They are fixed in trunk. (You need to install LazGDeBugControl.exe next to gdb.exe).
Also I am not sure that works in both directions. It should be fine with a 64bit IDE and 32bit cross.

- With FpDebug you do need the 64 bit IDE. The 64 bit IDE can debug 64 bit and cross 32.
With a 32bit IDE, FpDebug can only handle 32 bit.



PeterX

  • Sr. Member
  • ****
  • Posts: 390
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #8 on: December 24, 2020, 10:38:35 pm »
The cross installer can be used....

The advantage is, that you can set up build modes for each bitness, allowing you to quickly change the target.
For my GUI projects there seems to be no benefit with 64 bit, atm.
Switching from old Delphi 5 to Lazarus 32 Bit took me a lot of time.
Cleaning all my code for working well as 64 bit will also be much work.

But I expect that one day 64 bit will be default.
So either I stay on 32 or change completely to 64.
For me there's no need to support both 32 and 64 bit.

.. as for debugging....

- There were some issues with gdb. ..  They are fixed in trunk.
I would wait for the next Lazarus release version, then I might start using 64 seriously. Depends on the results.
usually using latest Lazarus release version with Windows 10

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3961
  • I like bugs.
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #9 on: December 24, 2020, 11:23:53 pm »
So either I stay on 32 or change completely to 64.
There is no need for such a dramatic decision.
Code can easily be made to support both. Mostly just remember to use PtrInt / PtrUInt when mixing Pointer and integer types.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

ASBzone

  • Hero Member
  • *****
  • Posts: 614
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #10 on: December 25, 2020, 01:36:38 am »
Hi,

24 of december, a good day to think about "64 versus 32 Bit"  :D

I ever used the 32 bit Lazarus Windows Installer, never thought about using the 64 bit compiler.
Now someone showed me some bugs in sources I offer, when being used with the 64 bit compiler. (mostly pointer stuff I think ..  >:(  => PTRUINT etc. ..)
So I would like to test my sources under 64 bit before releasing new versions of the code.

What's the recommended way - actually with version 2.0.10
- installing both 64 and 32 Bit Lazarus in parallel folders, oder better ..
- installing the 64 bit version and the cross-compiler ?

Are there differences in debugging or so when using the 64 bit IDE / compiler with the 32 bit target ?

 %)

I use FPC and Lazarus x64 on Windows 10 x64 with x86 cross-compiler.    All via FPCupDeluxe. 

Easy as Pie.  (or Pi)
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.0.13 r64843 / FPC v3.2.1-r49055 (via FpcUpDeluxe) -- Windows 64-bit install w/Win32 and Linux/Arm cross-compiles
Primary System: Windows 10 Pro x64, Version 2009 (Build 19042)
Other Systems: Windows 10 Pro x64, Version 2009 (Build 19042) or greater

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #11 on: December 25, 2020, 04:10:42 am »
 
Cleaning all my code for working well as 64 bit will also be much work.

It's not so much (unless your code is in the lots-a-thousands or multi-million lines): basically you just have to find/check where you made any assumption about the byte-length of integer and pointer types (and where you used Extended, while you're at it) and modify it to make no assumptions at all (hence future-proofing it).

Anything else (mostly related to memory limits) should appear in regular debugging cycles and in normal use.

When we did it most of what we found was in very old (and convoluted) code (curiously, always "someone else's" :-\) which suffered from "design-time optimization", and we were mighty happy to change it to normal "standards" ;)
« Last Edit: December 25, 2020, 04:17:48 am by lucamar »
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.

PeterX

  • Sr. Member
  • ****
  • Posts: 390
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #12 on: December 25, 2020, 11:19:31 am »
Cleaning all my code for working well as 64 bit will also be much work.

It's not so much (unless your code is in the lots-a-thousands or multi-million lines) ..
I have more than 10 projects running.
One of them is of type "lots-a-thousands lines".

So for me it indeed  is a
"dramatic decision"
..


Supporting both 32 and 64 would mean I would always have to test both versions.
 :'(
« Last Edit: December 25, 2020, 11:22:39 am by PeterX »
usually using latest Lazarus release version with Windows 10

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3961
  • I like bugs.
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #13 on: December 25, 2020, 12:23:55 pm »
Supporting both 32 and 64 would mean I would always have to test both versions.
 :'(
Not always, because the task is so easy and trivial. For example I don't remember bugs related to 32 / 64 bit issues in Lazarus project since ~10 years.

When your code does a typecast between Integer and Pointer, like :
Code: Pascal  [Select][+][-]
  1. I := Integer(Ptr);
  2. Ptr := Pointer(I);
Just change type "Integer" to "PtrInt" and everything keeps working.
Well designed code does not have many such (ugly) typecasts but sometimes they are handy. For example some components have a "Tag" property. It used to be an integer but was changed to PtrInt for obvious reasons.
Code: Pascal  [Select][+][-]
  1. Tag: PtrInt
Low level details are taken care of by RTL and such.
What kind of problems you face when porting to 64-bit? Do you have some very low level code, assembly maybe?
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

PeterX

  • Sr. Member
  • ****
  • Posts: 390
Re: 64 versus 32 Bit Lazarus Installation under Windows 10
« Reply #14 on: December 26, 2020, 09:01:14 pm »
What kind of problems you face when porting to 64-bit? Do you have some very low level code, assembly maybe?
Yes, the "big one" is a really old Project.
I solved some issues with the help here from the lazarus forum (thanks again for that !)
when porting it from Delphi 5 to Lazarus 32, years ago.
There's some DSP code in ASM, I don't know if I ever will touch it ..

I wouldn't start with the most difficult Project,
so first I would try with one of my much smaller projects.
usually using latest Lazarus release version with Windows 10

 

TinyPortal © 2005-2018