Lazarus

Installation => Windows (32/64) => Topic started by: PeterX on December 24, 2020, 01:26:59 pm

Title: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: PeterX 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 ?

 %)
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: lucamar 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):
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):

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
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: wp 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/).
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: MarkMLl on December 24, 2020, 02:26:24 pm
I agree from the Linux POV as well: install both.

MarkMLl
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: PeterX 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 ?
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: PeterX 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 !
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: wp on December 24, 2020, 03:34:40 pm
Can I create / open it in both 32 and 64 Bit Lazarus ?
Does this work ?
Yes.
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: Martin_fr 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.


Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: PeterX 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.
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: JuhaManninen 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.
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: ASBzone 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)
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: lucamar 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" ;)
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: PeterX 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.
 :'(
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: JuhaManninen 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?
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: PeterX 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.
Title: Re: 64 versus 32 Bit Lazarus Installation under Windows 10
Post by: PeterX on December 28, 2020, 09:59:45 pm
Okay, I tried the first project today with 64 bit compiler.

Wrong was:    {$ifdef WIN32}     :-[


32 bit exe is 32.259 KB
64 bit exe is 38.885 KB
(with debug settings ..)

So far everything works.
TinyPortal © 2005-2018