Sign in Join

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

Mailing lists / lazarus / 2009-04

Large program size - 1.8 MB for empty GUI project

98 messages · 28 people · –

Reply by email Subscribe to this list Your subscription

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

Igor Tkachenko

Hello everyone!

As stated in this article http://wiki.freepascal.org/Size_Matters "Lazarus apps on Windows are about 500k, but quickly grow to 1.5 MB" however I cannot made Lazarus to build empty application less than 1.8 MB. I've enabled option "Link Smart" at "Linking" tab of compiler options as well as "Strip Symbols From Executable" and disabled "Display line numbers in runtime..", however nothing helps to make empty application less.

Does this mean that 1.8 MB is the size of empty Lazarus application now? Or I do something wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090402/11b4c7a3/attachment.html

Reply by email

Vincent Snijders
to Igor Tkachenko
Igor Tkachenko wrote
Does this mean that 1.8 MB is the size of empty Lazarus application now?

Yes. For an application that includes the LCL.

Or I do something wrong?

No.

I think the size of 500 kB was too high from the beginning, I never saw it smaller than 1 or 1.2 MB, but the size has grown since that article was written.

Vincent

Reply by email

Graeme Geldenhuys
to Igor Tkachenko: Hello everyone! As stated in this article http://wiki.freepascal.org/Size_Matters "Lazarus

2009/4/2 Igor Tkachenko :

Does this mean that 1.8 MB is the size of empty Lazarus application now? Or I do something wrong?

Depends on the toolkit used with Lazarus...

Under Linux I just tried with the pre-alpha fpGUI Toolkit. A simple application with only a Main Form and no other components. One used LCL-fpGUI and the other used fpGUI directly (no LCL). It's amazing how much extra LCL adds.

LCL-fpGUI = 2,530,336 bytes

fpGUI directly = 392,960 bytes

Regards,
- Graeme -

Show quoted text 9 lines
_______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Héctor Fiandor Rosario
to Igor Tkachenko: Hello everyone! As stated in this article http://wiki.freepascal.org/Size_Matters "Lazarus

Dear Igor:

I had the same problems, but I remedy following this rules:

I prepare a .bat with three sentences as follow:

strip.exe LoadExcelFile.exe
upx.exe LoadExcelFile.exe
LoadExcelFile.exe

and in the same folders where are all the files there are this two: strip.exe and upx.exe (a compactor)

I execute the program with Ctrl+F9 and when finish, I go to the folder and execute the .bat that first take out all the debuggings instrucctions, compact the .exe and finnally, excute it to see how it works.

Generally, the .exe files take 500 to 800 kb, depending how many images.

let me know your advances,

yours,

Ing. H?ctor F. Fiandor

---------------------------------------
Red Telematica de Salud - Cuba
CNICM - Infomed

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090402/800b34f6/attachment.html

Reply by email

Felipe Monteiro de Carvalho
to Héctor Fiandor Rosario

The application is not empty. If you check the symbols inside the application you will see that almost all LCL components are added, and PNG support, XML library, etc, etc, etc, even if not used. The smartlinking is simply not yet good enought to remove those parts.

This isn't such a big deal because hello world applications are useless, in real world applications you will need to use multiple components, have graphics support, use xml, etc, and those are already there, so your EXE size won't grow when you need them.

And this has been debated 1 million times before, please search in the mailling list archives.

Felipe Monteiro de Carvalho

Reply by email

Paul Ishenin
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
And this has been debated 1 million times before, please search in the mailling list archives.

This also means that problem of big executable size worries developers. Maybe we need to research more how to make our executables smaller.

Best regards,
Paul Ishenin.

Reply by email

Martin Friebe
to Vincent Snijders: Yes. For an application that includes the LCL. No. I think the size of 500 kB was too…
Vincent Snijders wrote 18 lines
Igor Tkachenko schreef: > Does this mean that 1.8 MB is the size of empty Lazarus application now? > Yes. For an application that includes the LCL. > Or I do something wrong? > No. I think the size of 500 kB was too high from the beginning, I never saw it smaller than 1 or 1.2 MB, but the size has grown since that article was written.

Try building your app with:
-O2 -Os -XX -CX -OpPENTIUM

gives 1.5 MB (you also need to recompile the LCL with those options)

or look at http://wiki.freepascal.org/Whole_Program_Optimization

Best Regards
Martin

Reply by email

Paul Ishenin
to Igor Tkachenko: Hello everyone! As stated in this article http://wiki.freepascal.org/Size_Matters "Lazarus
Igor Tkachenko wrote 12 lines
Hello everyone! As stated in this article http://wiki.freepascal.org/Size_Matters "Lazarus apps on Windows are about 500k, but quickly grow to 1.5 MB" however I cannot made Lazarus to build empty application less than 1.8 MB. I've enabled option "Link Smart" at "Linking" tab of compiler options as well as "Strip Symbols From Executable" and disabled "Display line numbers in runtime..", however nothing helps to make empty application less. Does this mean that 1.8 MB is the size of empty Lazarus application now? Or I do something wrong?

If you remove icon from project your application size reduce from 1.8 to 1.5 MB.

Best regards,
Paul Ishenin.

Reply by email

Graeme Geldenhuys
to Paul Ishenin: This also means that problem of big executable size worries developers. Maybe we need to…
Paul Ishenin wrote 6 lines
Felipe Monteiro de Carvalho wrote: > And this has been debated 1 million times before, please search in the > mailling list archives. This also means that problem of big executable size worries developers. Maybe we need to research more how to make our executables smaller.

Especially so if you are targeting embedded devices, smartphones etc... Size matters in this case, but not so much for desktop applications.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Kostas Michalopoulos
to Felipe Monteiro de Carvalho: The application is not empty. If you check the symbols inside the application you will…
This isn't such a big deal because hello world applications are useless, in real world applications you will need to use multiple components, have graphics support, use xml, etc, and those are already there, so your EXE size won't grow when you need them.

I had many times the need to make a small application that did some few basic tasks without using multiple components, having any kind of great graphics support, use xml and other things, which is common for making front-end GUI programs to command-line programs or libraries and Lazarus is ideal for this. In the end I just eat the extra garbage (because that's what they are when the program doesn't use them but carry them around) but I would prefer that this wasn't the case. As said by Paul, since this is something that is asked so often, it means people need it and research should be done on it.

Of course personally I would prefer dynamically linked packages so I can break large programs in DLLs and made (dynamic) plugins that use LCL possible much more than that.

Kostas "Bad Sector" Michalopoulos

Reply by email

Игорь Ткаченко
to Felipe Monteiro de Carvalho: The application is not empty. If you check the symbols inside the application you will…

Hello Felipe,

Yes, I know that "size isn't a big deal in a real world", but this is correct just for some kind of GUI applications. From version to version LCL application executables grows in size. What size of empty applications will produce Lazarus in 2 years? 5 MBs or 10 MBs? :) If LCL executables became so large in size Lazarus and LCL will became inappropriate tool for a part of applications - for system utilities.

I'm developing system utilities (http://safelyremove.com/, http://lockhunter.com/) and I know from feedback that users of such system tools expect to see small executables rather than big executables. If a system tool like ours have size larger than 2 MBs (it can be easiliy achieved by adding a few forms) we will start to receive letters with questions: "Why your program have so big executable? Have you added some malware there?".

Of course the most important matter for system utilities is their memory consumption, it's worring users much more often, however a size of executables is also a big deal for such tools.

P.S.
If a thing debated 1 million times before this means this is a VERY BIG DEAL and required by many others :)

Felipe Monteiro de Carvalho wrote 14 lines
The application is not empty. If you check the symbols inside the application you will see that almost all LCL components are added, and PNG support, XML library, etc, etc, etc, even if not used. The smartlinking is simply not yet good enought to remove those parts. This isn't such a big deal because hello world applications are useless, in real world applications you will need to use multiple components, have graphics support, use xml, etc, and those are already there, so your EXE size won't grow when you need them. And this has been debated 1 million times before, please search in the mailling list archives.

Reply by email

Игорь Ткаченко
to Graeme Geldenhuys: 2009/4/2 Igor Tkachenko : Depends on the toolkit used with Lazarus... Under Linux I just…

Graeme,
I also downloaded KOL and MCK GUI kit and I created an empty application with the size of 200 KBs (70 KB without icon). However KOL have a very-very minimalistic approach. They even do not use Object Pascal classes and this is not object oriented library, because to manage all the objects you have to invoke separated functions and procedures. It makes "learning curve" higher for any new developers of my team, therefore I wouldn't consider KOL.

Anyway thank you for your advice I will try fpGUI.

Graeme Geldenhuys wrote 36 lines
2009/4/2 Igor Tkachenko : > Does this mean that 1.8 MB is the size of empty Lazarus application now? Or > I do something wrong? > Depends on the toolkit used with Lazarus... Under Linux I just tried with the pre-alpha fpGUI Toolkit. A simple application with only a Main Form and no other components. One used LCL-fpGUI and the other used fpGUI directly (no LCL). It's amazing how much extra LCL adds. LCL-fpGUI = 2,530,336 bytes fpGUI directly = 392,960 bytes Regards, - Graeme - > > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > > >

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090403/5c7a35f7/attachment.html

Reply by email

Игорь Ткаченко
to Héctor Fiandor Rosario: Dear Igor: I had the same problems, but I remedy following this rules: I prepare a .bat…

H?ctor,
Thank you for your advice! However using upx.exe just hides but not resolves the problem. Moreover AFAIK upx still doesn't support native Windows 64 code. And the final thing at using UPX causes some troubles. You may read about it here:
http://wiki.lazarus.freepascal.org/Size_Matters#UPX

H?ctor Fiandor Rosario wrote 33 lines
Dear Igor: I had the same problems, but I remedy following this rules: I prepare a .bat with three sentences as follow: strip.exe LoadExcelFile.exe upx.exe LoadExcelFile.exe LoadExcelFile.exe and in the same folders where are all the files there are this two: strip.exe and upx.exe (a compactor) I execute the program with Ctrl+F9 and when finish, I go to the folder and execute the .bat that first take out all the debuggings instrucctions, compact the .exe and finnally, excute it to see how it works. Generally, the .exe files take 500 to 800 kb, depending how many images. let me know your advances, yours, Ing. H?ctor F. Fiandor <mailto:> ------------------------------------------------------------------------ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090403/688e727f/attachment.html

Reply by email

Marc Weustink
to Alexey S. Smirnov: An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazaru…
Alexey S. Smirnov wrote 21 lines
Graeme Geldenhuys ?????: > On Fri, Apr 3, 2009 at 3:02 AM, Paul Ishenin wrote: > >> Felipe Monteiro de Carvalho wrote: >> >>> And this has been debated 1 million times before, please search in the >>> mailling list archives. >>> >> This also means that problem of big executable size worries developers. >> Maybe we need to research more how to make our executables smaller. >> > > Especially so if you are targeting embedded devices, smartphones > etc... Size matters in this case, but not so much for desktop > applications. > SmartLink problem is quite simple. It seems that all units, mentioned in "Interface->Uses" section will be fully linked. Only units mentioned in "Implementation->Uses" section can be checked during SmartLink. So, to enhance linking process and to reduce binary size we shell check all Interface sections of all LCL units to reduce units list.

We have all units listed in the interface section to avoid unit circles. This is needed since the compiler will fail to compile the LCL sooner or later if there are to many circles.

Marc

Reply by email

Marco van de Voort
to Héctor Fiandor Rosario: Dear Igor: I had the same problems, but I remedy following this rules: I prepare a .bat…
H?ctor Fiandor Rosario wrote 7 lines
I had the same problems, but I remedy following this rules: I prepare a .bat with three sentences as follow: strip.exe LoadExcelFile.exe upx.exe LoadExcelFile.exe LoadExcelFile.exe

If the wiki article talks about sizes, it DOES NOT include UPX.

Probably the LCL got bigger, or the internal linker is less efficient with smartlinking.

Note that the wiki article probably used windows sizes based on the 2.0.x or 2.1.1 external linker. (with GNU LD eating a GB to smartlink)

Reply by email

Marco van de Voort
to Felipe Monteiro de Carvalho: The application is not empty. If you check the symbols inside the application you will…
Felipe Monteiro de Carvalho wrote
The application is not empty. If you check the symbols inside the application you will see that almost all LCL components are added, and PNG support, XML library, etc, etc, etc, even if not used. The smartlinking is simply not yet good enought to remove those parts.

Note that unneeded parts in an .exe might also be a LCL architectural problem, not necessarily per se smartlinking. Often if units are referenced, init code is run that touches a lot of stuff.

This isn't such a big deal because hello world applications are useless, in real world applications you will need to use multiple components, have graphics support, use xml, etc, and those are already there, so your EXE size won't grow when you need them.

Correct. 1MB is nothing to worry about. 10 MB is not even something to worry about, if it starts swiftly.

Reply by email

Paul Ishenin
to Игорь Ткаченко: Yes, I know that "size isn't a big deal in a real world", but this is correct just for…

????? ???????? ?????:

Show quoted text 9 lines
Hello Felipe, Yes, I know that "size isn't a big deal in a real world", but this is correct just for some kind of GUI applications. From version to version LCL application executables grows in size. What size of empty applications will produce Lazarus in 2 years? 5 MBs or 10 MBs? :) If LCL executables became so large in size Lazarus and LCL will became inappropriate tool for a part of applications - for system utilities.

I think it will not grow to more than 2MB even after 2 years. Moreover I suspect size can go down when we start using native resources.

Best regards,
Paul Ishenin.

Reply by email

Felipe Monteiro de Carvalho
to Игорь Ткаченко: Yes, I know that "size isn't a big deal in a real world", but this is correct just for…

2009/4/3 ????? ???????? :

Show quoted text 7 lines
I'm developing system utilities (http://safelyremove.com/, http://lockhunter.com/) and I know from feedback that users of such system tools expect to see small executables rather than big executables. ?If a system tool like ours have size larger than 2 MBs (it can be easiliy achieved by adding a few forms) we will start to receive letters with questions: "Why your program have so big executable? Have you added some malware there?".

You can answer them that the executables are big because you are using a cross-platform GUI library, and they can check the code of the library.

Maybe they would be happier if we could make the LCL into DLLs. There was some investigation about it, but still far from reality.

Anyway, there is a big deal of psychology here, because I think they would be happier if the executable was 100kb but depended on 24MB of DLLs (like the Qt4 installer for Mac OS X), which is obviously contradictory if you know about the technology.

And now it comes to another point. If you compare the LCL to other cross-platform GUI libraries, like Qt, it's actually much smaller, but with the down side that we still can't make the LCL into DLLs, which can be reused in multiple applications.

Felipe Monteiro de Carvalho

Reply by email

Graeme Geldenhuys
to Paul Ishenin: ????? ???????? ?????: I think it will not grow to more than 2MB even after 2 years.…
Paul Ishenin wrote
I think it will not grow to more than 2MB even after 2 years. Moreover I suspect size can go down when we start using native resources.

Well Paul, it is already way above 2MB! Using Lazarus (trunk) r19175.

LCL-fpGUI = 2,530,336 bytes
LCL-GTK1 = 2,700,452 bytes
LCL-GTK2 = 2,793,732 bytes

This was a single form application with NO other components. Smart Linkable and Smart Linking enabled, Level 2 optimization, icon removed, no debugging information, Strip enabled and for good measure I ran 'strip' manually afterwards.

So with LCL growing daily, the 5MB mark will be hit soon I think. The 2MB mark has come and gone (way before your next 2 years estimate).

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Felipe Monteiro de Carvalho: 2009/4/3 ????? ???????? : You can answer them that the executables are big because you…

2009/4/3 Felipe Monteiro de Carvalho :

would be happier if the executable was 100kb but depended on 24MB of DLLs (like the Qt4 installer for Mac OS X), which is obviously contradictory if you know about the technology.

I must agree here. I would much rather prefer a stand-alone application that has no extra requirements like DLL's or SO's. This is what I hated about Kylix 3 application - it was not easy to deploy because the CLX and Qt requirements. To this day I can't simply click on a Kylix application and expect it to run. I need a few of those 6MB SO's files to go with it. This is what I love about fpGUI Toolkit. Much less requirements and I even ran applications I compiled today on Ubuntu 9.04 (beta) on a old RedHat 8 distro in a VM session.

Anyway, to me ease of deployment is much more important that executable size - simply because I only develop for the desktop. :)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Vincent Snijders
to Graeme Geldenhuys: Well Paul, it is already way above 2MB! Using Lazarus (trunk) r19175. LCL-fpGUI =…
Graeme Geldenhuys wrote 11 lines
On Fri, Apr 3, 2009 at 2:18 PM, Paul Ishenin wrote: > I think it will not grow to more than 2MB even after 2 years. Moreover I > suspect size can go down when we start using native resources. Well Paul, it is already way above 2MB! Using Lazarus (trunk) r19175. LCL-fpGUI = 2,530,336 bytes LCL-GTK1 = 2,700,452 bytes LCL-GTK2 = 2,793,732 bytes

I guess paul was talking about the win32 interface on i386-win32.

Vincent

Reply by email

Paul Ishenin
to Mattias Gärtner: An embedded and charset-unspecified text was scrubbed... Name: not available Url:…
Mattias G?rtner wrote 19 lines
Zitat von Marco van de Voort : > On Thu, Apr 02, 2009 at 08:25:16PM -0300, Felipe Monteiro de Carvalho wrote: > >> The application is not empty. If you check the symbols inside the >> application you will see that almost all LCL components are added, and >> PNG support, XML library, etc, etc, etc, even if not used. The >> smartlinking is simply not yet good enought to remove those parts. >> > Note that unneeded parts in an .exe might also be a LCL architectural > problem, not necessarily per se smartlinking. Often if units are referenced, > init code is run that touches a lot of stuff. > Yes. There are two LCL design problems with smart linking: - published properties/methods needed for RTTI forms - the register mechanism of the LCL interfaces

There are more places:
- win32 and wince interface: WndProc procedure
- gtk1, gtk2: event handlers, SetText method

Best regards,
Paul Ishenin.

Reply by email

Paul Ishenin
to Graeme Geldenhuys: Well Paul, it is already way above 2MB! Using Lazarus (trunk) r19175. LCL-fpGUI =…
Graeme Geldenhuys wrote 6 lines
Well Paul, it is already way above 2MB! Using Lazarus (trunk) r19175. LCL-fpGUI = 2,530,336 bytes LCL-GTK1 = 2,700,452 bytes LCL-GTK2 = 2,793,732 bytes

It is on linux. On windows with strip and no icon it is only 1,5MB. The difference here because of using different api and because of using internal linker on windows.

Best regards,
Paul Ishenin.

Reply by email

Hans-Peter Diettrich
to Felipe Monteiro de Carvalho: 2009/4/3 ????? ???????? : You can answer them that the executables are big because you…
And now it comes to another point. If you compare the LCL to other cross-platform GUI libraries, like Qt, it's actually much smaller, but with the down side that we still can't make the LCL into DLLs, which can be reused in multiple applications.

IMO using runtime DLLs should not be a high priority goal. My experience is that updates of such DLLs tend to break older programs. I've been very happy when Delphi allowed me to write self-contained applications, independent from runtime DLLs.

DoDi

Reply by email

Henry Vermaak
to Graeme Geldenhuys: Well Paul, it is already way above 2MB! Using Lazarus (trunk) r19175. LCL-fpGUI =…

2009/4/3 Graeme Geldenhuys :

Show quoted text 10 lines
On Fri, Apr 3, 2009 at 2:18 PM, Paul Ishenin wrote: > > I think it will not grow to more than 2MB even after 2 years. Moreover I > suspect size can go down when we start using native resources. Well Paul, it is already way above 2MB! ?Using Lazarus (trunk) r19175. LCL-fpGUI = 2,530,336 bytes LCL-GTK1 = 2,700,452 bytes LCL-GTK2 = 2,793,732 bytes

i get 1,803,196 bytes for lcl-gtk2 (manually compiled with smartlink and -O2). lazarus trunk and fpc trunk.

henry

Reply by email

Marco van de Voort
to Mattias Gärtner: An embedded and charset-unspecified text was scrubbed... Name: not available Url:…
Mattias G?rtner wrote 10 lines
> > Note that unneeded parts in an .exe might also be a LCL architectural > problem, not necessarily per se smartlinking. Often if units are referenced, > init code is run that touches a lot of stuff. Yes. There are two LCL design problems with smart linking: - published properties/methods needed for RTTI forms - the register mechanism of the LCL interfaces The first could theoretically be remedied like KOL did.

Which is?

The later was done to keep the code maintainable. Smart linking could be improved a lot, but not without a price.

Btw, I saw expanding RTTI on Verity Stobs and Nick Hodges agenda:

http://blogs.embarcadero.com/nickhodges/2009/02/04/39200

Brr.

In the CG forums it is also often asked, but the problem with those is that there is never any discussion about downsides of new features.

Reply by email

Bogusław Brandys
to Henry Vermaak: 2009/4/3 Graeme Geldenhuys : i get 1,803,196 bytes for lcl-gtk2 (manually compiled with…
Henry Vermaak wrote 15 lines
2009/4/3 Graeme Geldenhuys : > On Fri, Apr 3, 2009 at 2:18 PM, Paul Ishenin wrote: >> I think it will not grow to more than 2MB even after 2 years. Moreover I >> suspect size can go down when we start using native resources. > Well Paul, it is already way above 2MB! Using Lazarus (trunk) r19175. > > LCL-fpGUI = 2,530,336 bytes > LCL-GTK1 = 2,700,452 bytes > LCL-GTK2 = 2,793,732 bytes i get 1,803,196 bytes for lcl-gtk2 (manually compiled with smartlink and -O2). lazarus trunk and fpc trunk. henry

There is another question, which is debug info.I think it's precious to have correct unit/line information in case of application crash in customer computer. That means huge above 33MB applications. I would be glad if debug info could be dumped into separate file AND used by lineinfo and heaptrc in case of exception to show stack trace.Of course as an optional way of distributing application.

Btw, under windows antivirus like Kaspersky is scanning new exe files and in case of large file it can take a minute or more (when debug info is included in exe) ! Imagine a user installed your application and first running it, stuck with a problem and calling you that application is not working.

Regards
Boguslaw

Reply by email

Paul Ishenin
to Bogusław Brandys
Bogus?aw Brandys wrote 7 lines
There is another question, which is debug info.I think it's precious to have correct unit/line information in case of application crash in customer computer. That means huge above 33MB applications. I would be glad if debug info could be dumped into separate file AND used by lineinfo and heaptrc in case of exception to show stack trace.Of course as an optional way of distributing application.

Debug info can be placed in a separate file - you need to use -Xg option for that. I have no idea though whether heaptrc or lineinfo units can work with it but gdb can.

Best regards,
Paul Ishenin.

Reply by email

Thierry Coq
to Igor Tkachenko: Hello everyone! As stated in this article http://wiki.freepascal.org/Size_Matters "Lazarus

Hello,

when is dynamic linking in mainstream Lazarus scheduled? we could spread the size of the LCL over a set of DLLs. Small utilities would all share the same DLLs, and have in their EXE file only a couple of hundred Ko.

In any case, manual dynamic linking is possible.

Best regards,
Thierry

Igor Tkachenko wrote 21 lines
Hello everyone! As stated in this article http://wiki.freepascal.org/Size_Matters "Lazarus apps on Windows are about 500k, but quickly grow to 1.5 MB" however I cannot made Lazarus to build empty application less than 1.8 MB. I've enabled option "Link Smart" at "Linking" tab of compiler options as well as "Strip Symbols From Executable" and disabled "Display line numbers in runtime..", however nothing helps to make empty application less. Does this mean that 1.8 MB is the size of empty Lazarus application now? Or I do something wrong? ------------------------------------------------------------------------ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Marco van de Voort
to Thierry Coq
Thierry Coq wrote
when is dynamic linking in mainstream Lazarus scheduled?

As soon as somebody implements the needed functionality in FPC. Like packages.

http://wiki.freepascal.org/packages

we could spread the size of the LCL over a set of DLLs. Small utilities would all share the same DLLs, and have in their EXE file only a couple of hundred Ko.

But for only one program the distribution is bigger. And only when compiled with exactly the same version sharing is possible. And of course more programs will need an installer.

The theory is always appealing, but look in practice to systems that have dynamic runtimes and distribute binaries. Version problems are the norm.

In any case, manual dynamic linking is possible.

Is it? How do you avoid the duplication of VMTs and RTL state ?

Reply by email

Alexander Klenin
to Marc Weustink: We have all units listed in the interface section to avoid unit circles. This is needed…
Marc Weustink wrote 10 lines
Alexey S. Smirnov wrote: > SmartLink problem is quite simple. It seems that all units, mentioned in > "Interface->Uses" section will be fully linked. Only units mentioned in > "Implementation->Uses" section can be checked during SmartLink. > So, to enhance linking process and to reduce binary size we shell > check all Interface sections of all LCL units to reduce units list. We have all units listed in the interface section to avoid unit circles. This is needed since the compiler will fail to compile the LCL sooner or later if there are to many circles.

I strongly agree with Alexey here. The bug in FPC should be fixed and Lazarus source updated to remove unnecessary units from 'uses' clauses.

Not so much for executable size, but for mantainabilty of the source.

Alexander S. Klenin

Reply by email

Alexander Klenin
to Mattias Gärtner
Mattias G?rtner wrote 10 lines
> I strongly agree with Alexey here. The bug in FPC should be fixed and > Lazarus source updated to remove unnecessary units from 'uses' > clauses. > > Not so much for executable size, but for mantainabilty of the source. Yes. Avoid uses sections in implementations. This golden rule is true since the start of FPC. Using implementation uses sections is asking for trouble.

Eh... you mean 'no'? Because I argue _for_ 'uses' sections in implementation.

Alexander S. Klenin

Reply by email

Mattias Gärtner
to Alexander Klenin

Zitat von Alexander Klenin :

Show quoted text 14 lines
On 2009-04-07, Mattias G??rtner wrote: >> I strongly agree with Alexey here. The bug in FPC should be fixed and >> Lazarus source updated to remove unnecessary units from 'uses' >> clauses. >> >> Not so much for executable size, but for mantainabilty of the source. > > Yes. Avoid uses sections in implementations. This golden rule is true since > the > start of FPC. > Using implementation uses sections is asking for trouble. Eh... you mean 'no'? Because I argue _for_ 'uses' sections in implementation.

Oops. Sorry, then I misunderstood you.

Uses sections in implementation sections are buggy as long as I know fpc. The problems are known but apparently too hard to track and fix. The bugs appear at random and with various degrees depending on platform and fpc version. In some years you think the bugs are fixed, and then they come back. You have been warned: Don't use the imp sections.

I thought this was known:
http://wiki.lazarus.freepascal.org/DesignGuidelines

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gärtner

2009/4/7 Mattias G?rtner :

Show quoted text 9 lines
Uses sections in implementation sections are buggy as long as I know fpc. The problems are known but apparently too hard to track and fix. The bugs appear at random and with various degrees depending on platform and fpc version. In some years you think the bugs are fixed, and then they come back. You have been warned: Don't use the imp sections. I thought this was known: http://wiki.lazarus.freepascal.org/DesignGuidelines

This is the first I here of this. I was always taught to limit the usage of the Interface section's uses clause, so you can prevent circular unit issues. So is FPC the opposite of Delphi in this regards?

I have used FPC since 2.0.2 under Linux and Windows and haven't had any issues. I limit the usage of interface uses clause as much as possible. I believed that is why the smartlinking works so well with fpGUI - I can create a GUI application that is only 340KB in size.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Vincent Snijders
to Graeme Geldenhuys

2009/4/7 Graeme Geldenhuys :

I believed that is why the smartlinking works so well with fpGUI - I can create a GUI application that is only 340KB in size.

Can somebody explain to me why smartlinking works better when a unit is in the implementation section than when it is in the interface section? I thought for smartlinking it doesn't make a difference, the unit is used anyway.

Vincent

Reply by email

Marc Weustink
to Graeme Geldenhuys: 2009/4/7 Mattias G?rtner : This is the first I here of this. I was always taught to limit…
Graeme Geldenhuys wrote 14 lines
2009/4/7 Mattias G?rtner : > Uses sections in implementation sections are buggy as long as I know fpc. The > problems are known but apparently too hard to track and fix. The bugs appear at > random and with various degrees depending on platform and fpc version. In some > years you think the bugs are fixed, and then they come back. > You have been warned: Don't use the imp sections. > > I thought this was known: > http://wiki.lazarus.freepascal.org/DesignGuidelines This is the first I here of this. I was always taught to limit the usage of the Interface section's uses clause, so you can prevent circular unit issues. So is FPC the opposite of Delphi in this regards?

No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is possible that the checksum of the interface part stored in the .ppu is affected by the implementation section. When editing sources this can lead to strange results, the compiler might think in some cases an interface is changed or not. When Lazarus started we put a lot in the uses section of the implementation part. When some source was changed, sometimes a 3 or fourtime compile attempt was needed to compile the while LCL, since everytime the compiler thought a unit was changed whil it was not. Restarting compilation (and keeping the existing units) in most cases resulted in a compiled LCL.
To avoid this and to make the LCL usabole as "library", most unit cirles were removed. One way to ensure that is by putting all uses in the interface section.

I have used FPC since 2.0.2 under Linux and Windows and haven't had any issues. I limit the usage of interface uses clause as much as possible. I believed that is why the smartlinking works so well with fpGUI - I can create a GUI application that is only 340KB in size.

It might depend on how you compile fpGUI.

Anyway, back to the subject, I cannot imagine why FPC when smartlinking makes a difference between interface and implementation uses. Especially if you use an external linker, like on linux.

Marc

Reply by email

Mattias Gaertner
to Graeme Geldenhuys: 2009/4/7 Mattias G?rtner : This is the first I here of this. I was always taught to limit…
Show quoted text 13 lines
2009/4/7 Mattias G?rtner : > > Uses sections in implementation sections are buggy as long as I > know fpc. The problems are known but apparently too hard to track > and fix. The bugs appear at random and with various degrees > depending on platform and fpc version. In some years you think the > bugs are fixed, and then they come back. You have been warned: > Don't use the imp sections. > > I thought this was known: > http://wiki.lazarus.freepascal.org/DesignGuidelines This is the first I here of this.

Maybe because you follow our advice to always do a 'make clean all' on the lazarus sources, which 'solves' the bug in most cases. The bug(s) can not be reproduced easily, but when it appears it is reproducable. The problem is that you need some ppu to demonstrate and you can not feed 100MB into the bug tracker.

The last time happened when Martin added some unit cycles in synedit. Under FPC 2.2.3 it worked most of the time. Under FPC 2.3.1 only a clean rebuild worked.

I was always taught to limit the usage of the Interface section's uses clause, so you can prevent circular unit issues. So is FPC the opposite of Delphi in this regards?

No, no, you are right. The implementation uses section is not buggy per se. But with them you can build the circular unit dependencies. With merely the interface uses sections you can not.
As long as you keep an acyclic hierarchy you can use whatever you like.

When using only interface uses sections you can not even create accidentally a cycle. That's why I recommend to avoid imp uses sections.

I have used FPC since 2.0.2 under Linux and Windows and haven't had any issues. I limit the usage of interface uses clause as much as possible. I believed that is why the smartlinking works so well with fpGUI - I can create a GUI application that is only 340KB in size.

AFAIK smart linking has nothing to do with unit interdependencies. Of course you are right that every unit interdependency makes improving smart linking more difficult.

Mattias

Reply by email

Bogusław Brandys
to Marc Weustink: No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is…
Marc Weustink wrote 43 lines
Graeme Geldenhuys wrote: > 2009/4/7 Mattias G?rtner : >> Uses sections in implementation sections are buggy as long as I know fpc. The >> problems are known but apparently too hard to track and fix. The bugs appear at >> random and with various degrees depending on platform and fpc version. In some >> years you think the bugs are fixed, and then they come back. >> You have been warned: Don't use the imp sections. >> >> I thought this was known: >> http://wiki.lazarus.freepascal.org/DesignGuidelines > This is the first I here of this. I was always taught to limit the > usage of the Interface section's uses clause, so you can prevent > circular unit issues. So is FPC the opposite of Delphi in this > regards? No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is possible that the checksum of the interface part stored in the .ppu is affected by the implementation section. When editing sources this can lead to strange results, the compiler might think in some cases an interface is changed or not. When Lazarus started we put a lot in the uses section of the implementation part. When some source was changed, sometimes a 3 or fourtime compile attempt was needed to compile the while LCL, since everytime the compiler thought a unit was changed whil it was not. Restarting compilation (and keeping the existing units) in most cases resulted in a compiled LCL. To avoid this and to make the LCL usabole as "library", most unit cirles were removed. One way to ensure that is by putting all uses in the interface section. > I have used FPC since 2.0.2 under Linux and Windows and haven't had > any issues. I limit the usage of interface uses clause as much as > possible. I believed that is why the smartlinking works so well with > fpGUI - I can create a GUI application that is only 340KB in size. It might depend on how you compile fpGUI. Anyway, back to the subject, I cannot imagine why FPC when smartlinking makes a difference between interface and implementation uses. Especially if you use an external linker, like on linux. Marc

Doesn't it require anyway recompilation of all lcl units with -CX option (smart linkable) ?

Btw a little different question : what is needed to allow lineinfo reading stack trace from external file (in case of exception) for example of the name corresponding to exe name but with different extension. FPC can now dump debug info into such separate file. Such feature would be very useful as compilation option for example.

Boguslaw

Reply by email

Mattias Gaertner
to Bogusław Brandys
Show quoted text 56 lines
Marc Weustink wrote: > Graeme Geldenhuys wrote: >> 2009/4/7 Mattias G?rtner : >>> Uses sections in implementation sections are buggy as long as I >>> know fpc. The problems are known but apparently too hard to track >>> and fix. The bugs appear at random and with various degrees >>> depending on platform and fpc version. In some years you think >>> the bugs are fixed, and then they come back. You have been >>> warned: Don't use the imp sections. >>> >>> I thought this was known: >>> http://wiki.lazarus.freepascal.org/DesignGuidelines >> This is the first I here of this. I was always taught to limit the >> usage of the Interface section's uses clause, so you can prevent >> circular unit issues. So is FPC the opposite of Delphi in this >> regards? > > No, but the problem is caused by the way fpc stores info in the .ppu > Somehow it is possible that the checksum of the interface part > stored in the .ppu is affected by the implementation section. > When editing sources this can lead to strange results, the compiler > might think in some cases an interface is changed or not. > When Lazarus started we put a lot in the uses section of the > implementation part. When some source was changed, sometimes a 3 or > fourtime compile attempt was needed to compile the while LCL, since > everytime the compiler thought a unit was changed whil it was not. > Restarting compilation (and keeping the existing units) in most > cases resulted in a compiled LCL. > To avoid this and to make the LCL usabole as "library", most unit > cirles were removed. One way to ensure that is by putting all uses > in the interface section. > >> I have used FPC since 2.0.2 under Linux and Windows and haven't had >> any issues. I limit the usage of interface uses clause as much as >> possible. I believed that is why the smartlinking works so well >> with fpGUI - I can create a GUI application that is only 340KB in >> size. > > It might depend on how you compile fpGUI. > > Anyway, back to the subject, I cannot imagine why FPC when > smartlinking makes a difference between interface and > implementation uses. Especially if you use an external linker, like > on linux. > > Marc > Doesn't it require anyway recompilation of all lcl units with -CX option (smart linkable) ? Btw a little different question : what is needed to allow lineinfo reading stack trace from external file (in case of exception) for example of the name corresponding to exe name but with different extension. FPC can now dump debug info into such separate file. Such feature would be very useful as compilation option for example.

Write a lineinfo unit that supports the external file.

Mattias

Reply by email

Hans-Peter Diettrich
to Graeme Geldenhuys: 2009/4/7 Mattias G?rtner : This is the first I here of this. I was always taught to limit…
> I thought this was known: > http://wiki.lazarus.freepascal.org/DesignGuidelines This is the first I here of this.

Me 2.

I have used FPC since 2.0.2 under Linux and Windows and haven't had any issues. I limit the usage of interface uses clause as much as possible. I believed that is why the smartlinking works so well with fpGUI - I can create a GUI application that is only 340KB in size.

Smartlinking is not directly affected by Uses. Instead it's most often the code in used unit Initzialization sections, that makes all related code part of the executable. E.g. when initialization code creates objects or references subroutines, that are not otherwise used by the application code, a smart linker cannot exclude that definitely referenced code.

Similarly virtual methods: they are referenced in the VMT, which again is referenced in every instance of the class. Consequently virtual methods must become part of the executable, as soon as a class typename is used in any way in an application. Static methods, in contrast, can be safely omitted when not referenced anywhere else. IMO.

DoDi

Reply by email

Hans-Peter Diettrich
to Marc Weustink: No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is…
No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is possible that the checksum of the interface part stored in the .ppu is affected by the implementation section.

Just a note: some people think that units can be compiled in one pass - this is not true. The compiler must stop on every Uses clause, and compile at least the interface parts of all the used units. This is why circular unit references are disallowed in the interface section, they would block the compilation of the interface parts of all units in that loop.

IMO there exists a severe design flaw in FPC, when the compilation of the implementation part of some unit can change the checksum of its interface part.

DoDi

Reply by email

Paul Ishenin
to Mattias Gaertner: On Tue, 7 Apr 2009 15:55:20 +0200 Maybe because you follow our advice to always do a…
Mattias Gaertner wrote
The last time happened when Martin added some unit cycles in synedit. Under FPC 2.2.3 it worked most of the time. Under FPC 2.3.1 only a clean rebuild worked.

FPC 2.3.1 works more unstable here. Try to move property from public to published section, try to add/remove default value to any property and you will have a crash in compiler if you build without clean.

Best regards,
Paul Ishenin.

Reply by email

Sergei Gorelkin
to Mattias Gaertner: On Tue, 07 Apr 2009 17:32:58 +0200 Write a lineinfo unit that supports the external file.…
Mattias Gaertner wrote 9 lines
> > Btw a little different question : what is needed to allow lineinfo > reading stack trace from external file (in case of exception) for > example of the name corresponding to exe name but with different > extension. FPC can now dump debug info into such separate file. Such > feature would be very useful as compilation option for example. Write a lineinfo unit that supports the external file.

Isn't it already written? It looks like exeinfo.pp (unit shared by lineinfo and lnfodwrf) supports this feature. Didn't test it though. However, it gets the name of debug info file from the debug section of the executable, so the executable shouln't be stripped in this case.

Regards,
Sergei

Reply by email

Graeme Geldenhuys
to Marc Weustink: No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is…
Marc Weustink wrote
No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is possible that the checksum of the interface part stored in the .ppu is affected by the implementation section.

Since I started using Lazarus (4+ years ago), I have only two had a checksum issue compiling lazarus. A simple 'make clean' and then recompile resolved the problem. But I actually think the issue was caused due to a FPC upgrade - I can't remember exactly, but am pretty sure.

To avoid this and to make the LCL usabole as "library", most unit circles were removed. One way to ensure that is by putting all uses in the interface section.

OK I'm confused. How does solving circular reference get resolved by putting everything in the Interface section? Doing that is what causes circular reference problems?? Maybe I understand circular reference problems differently to you... this is what I mean:

====================
{ this defines TClass1 }
unit Unit1;

uses
  unit2;
type
   TClass1 = class(TObject)
   private
      FRef: TClass2;
    end;

....
====================

{ this defines TClass2 }
unit Unit2;
uses
  unit1;
type
   TClass2 = class(TObject)
   private
      FRef: TClass1;
    end;

....
=============================

Both classes require each other and can't be compiled. This is what I understand as circular unit references. To solve this you can lump both class definitions in a single unit and add a 'forward declaration' at the top.

Show quoted text 7 lines
> any issues. I limit the usage of interface uses clause as much as > possible. I believed that is why the smartlinking works so well with > fpGUI - I can create a GUI application that is only 340KB in size. Anyway, back to the subject, I cannot imagine why FPC when smartlinking makes a difference between interface and implementation uses. Especially if you use an external linker, like on linux.

OK, I worded that wrong. For smartlinking there shouldn't be any difference if the unit is in the Interface or Implementation section. What is important is if the unit is used or not. I think the reason I can get such small executables, is because every gui component lives in it's own unit. fpGUI doesn't have a StdCtrls or ComCtrls unit which lumps a whole bunch of classes together. And when I create applications I only add the units I really need. This is obviously key.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 7 lines
[...] > To avoid this and to make the LCL usabole as "library", most unit > circles were removed. One way to ensure that is by putting all uses > in the interface section. OK I'm confused. How does solving circular reference get resolved by putting everything in the Interface section?

In order to break the circles, you must first find them. Move all uses to the interface section and FPC will find them for you.

Doing that is what causes circular reference problems??

?

Show quoted text 38 lines
Maybe I understand circular reference problems differently to you... this is what I mean: ==================== { this defines TClass1 } unit Unit1; uses unit2; type TClass1 = class(TObject) private FRef: TClass2; end; .... ==================== { this defines TClass2 } unit Unit2; uses unit1; type TClass2 = class(TObject) private FRef: TClass1; end; .... ============================= Both classes require each other and can't be compiled. This is what I understand as circular unit references. To solve this you can lump both class definitions in a single unit and add a 'forward declaration' at the top.

Yes.

[...] OK, I worded that wrong. For smartlinking there shouldn't be any difference if the unit is in the Interface or Implementation section.

Yes.

What is important is if the unit is used or not.

Only if the unit has an initialization section.

For example simply adding uses Math; without using any part will not increase the exe (using smart linking).

I think the reason I can get such small executables, is because every gui component lives in it's own unit.

This has nothing to do with smart linking. But it helps to keep the keep the exe small without smart linking.
For the LCL this would not help much - see other mails.

fpGUI doesn't have a StdCtrls or ComCtrls unit which lumps a whole bunch of classes together. And when I create applications I only add the units I really need. This is obviously key.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner: On Wed, 8 Apr 2009 08:40:38 +0200 In order to break the circles, you must first find…
Mattias Gaertner wrote
In order to break the circles, you must first find them. Move all uses to the interface section and FPC will find them for you.

Ah, now I see what you mean... Still don't know if it's a good practice though.

Show quoted text 6 lines
> What is important is if the unit is used or not. Only if the unit has an initialization section. For example simply adding uses Math; without using any part will not increase the exe (using smart linking).

Yes, that's what I meant by "unit is used or not".

Thanks Mattias for explaining...

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Bogusław Brandys
to Sergei Gorelkin: Isn't it already written? It looks like exeinfo.pp (unit shared by lineinfo and lnfodwrf)…
Sergei Gorelkin wrote 16 lines
Mattias Gaertner wrote: >> Btw a little different question : what is needed to allow lineinfo >> reading stack trace from external file (in case of exception) for >> example of the name corresponding to exe name but with different >> extension. FPC can now dump debug info into such separate file. Such >> feature would be very useful as compilation option for example. > Write a lineinfo unit that supports the external file. > Isn't it already written? It looks like exeinfo.pp (unit shared by lineinfo and lnfodwrf) supports this feature. Didn't test it though. However, it gets the name of debug info file from the debug section of the executable, so the executable shouln't be stripped in this case. Regards, Sergei

That's great! Maybe it could be changed so if debug info filename is not found in debug section of executable then it tries to open a separate debug file generated by fpc (which can be of the same name as executable but different extension).

I must investigate this option.

Best regards
Boguslaw

Reply by email

Paul Ishenin
to Bogusław Brandys
Bogus?aw Brandys wrote
That's great! Maybe it could be changed so if debug info filename is not found in debug section of executable then it tries to open a separate debug file generated by fpc (which can be of the same name as executable but different extension)

What for? If you want a separate debug info file (-Xg) then your executable will contain a section with that file name. As result you have a small executable. If you distribute that executable without debug file it will work fine but without line info. If you distribute with debug file then you will have lineinfo. What do you need more?

Best regards,
Paul Ishenin.

Reply by email

Marco van de Voort
to Marc Weustink: No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is…
Marc Weustink wrote 5 lines
No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is possible that the checksum of the interface part stored in the .ppu is affected by the implementation section. When editing sources this can lead to strange results, the compiler might think in some cases an interface is changed or not.

How recently was this all validated to still be a problem? I know FPC didn't performed the (apparantly long due) unit system rewrite yet, but not that much problems in that realm are reported in mantis anymore, even for the current implementation.

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: Just a note: some people think that units can be compiled in one pass - this is not true.…
Hans-Peter Diettrich wrote 10 lines
Marc Weustink schrieb: > No, but the problem is caused by the way fpc stores info in the .ppu > Somehow it is possible that the checksum of the interface part stored in > the .ppu is affected by the implementation section. Just a note: some people think that units can be compiled in one pass - this is not true. The compiler must stop on every Uses clause, and compile

/load/

Show quoted text 8 lines
at least the interface parts of all the used units. This is why circular unit references are disallowed in the interface section, they would block the compilation of the interface parts of all units in that loop. IMO there exists a severe design flaw in FPC, when the compilation of the implementation part of some unit can change the checksum of its interface part.

Why are you so sure it is design, and not merely implementation?

Reply by email

Paul Ishenin
to Marco van de Voort: How recently was this all validated to still be a problem? I know FPC didn't performed…
Marco van de Voort wrote 5 lines
How recently was this all validated to still be a problem? I know FPC didn't performed the (apparantly long due) unit system rewrite yet, but not that much problems in that realm are reported in mantis anymore, even for the current implementation.

What about this one: http://bugs.freepascal.org/view.php?id=13323

Best regards,
Paul Ishenin.

Reply by email

Paul Ishenin
to Marco van de Voort: How recently was this all validated to still be a problem? I know FPC didn't performed…
Marco van de Voort wrote 5 lines
How recently was this all validated to still be a problem? I know FPC didn't performed the (apparantly long due) unit system rewrite yet, but not that much problems in that realm are reported in mantis anymore, even for the current implementation.

And this one: http://bugs.freepascal.org/view.php?id=13478

Best regards,
Paul Ishenin.

Reply by email

Bogusław Brandys
to Paul Ishenin: What for? If you want a separate debug info file (-Xg) then your executable will contain…
Paul Ishenin wrote 14 lines
Bogus?aw Brandys wrote: > That's great! Maybe it could be changed so if debug info filename is not > found in debug section of executable then it tries to open a separate > debug file generated by fpc (which can be of the same name as executable > but different extension) What for? If you want a separate debug info file (-Xg) then your executable will contain a section with that file name. As result you have a small executable. If you distribute that executable without debug file it will work fine but without line info. If you distribute with debug file then you will have lineinfo. What do you need more? Best regards, Paul Ishenin. _______________________________________________

Wow,this is exactly what I want.Thank you.Is that really working ? I remember having problems with it - no source line info in stack trace output in case of external debug file.

Does stabs need to be loaded at program startup ? I would like it to work without need to loading debug info from this separate file at program start because this is a huge slowdown especially when antivirus is scanning file.Ideally it should load stabs only in case of exception or stack trace request.

Regards
Boguslaw

Reply by email

Paul Ishenin
to Bogusław Brandys
Bogus?aw Brandys wrote
Wow,this is exactly what I want.Thank you.Is that really working ? I remember having problems with it - no source line info in stack trace output in case of external debug file.

Please test yourself :) And only with fpc 2.3.1 - before it wrote full path and gdb cannot work with full path.

Best regards,
Paul Ishenin.

Reply by email

Marc Weustink
to Marco van de Voort: How recently was this all validated to still be a problem? I know FPC didn't performed…
Marco van de Voort wrote 11 lines
On Tue, Apr 07, 2009 at 05:13:07PM +0200, Marc Weustink wrote: > No, but the problem is caused by the way fpc stores info in the .ppu > Somehow it is possible that the checksum of the interface part stored in > the .ppu is affected by the implementation section. > When editing sources this can lead to strange results, the compiler > might think in some cases an interface is changed or not. How recently was this all validated to still be a problem? I know FPC didn't performed the (apparantly long due) unit system rewrite yet, but not that much problems in that realm are reported in mantis anymore, even for the current implementation.

The only thing I know was that this only could be solved by the unit rewrite. Since it is not rewriten yet, I assume it is not fixed.

Marc

Reply by email

Reenen Laurie
to Alexey S. Smirnov: An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazaru…

2009/4/8 Alexey S. Smirnov :

Show quoted text 8 lines
The Smart Link process should check what variables/functions/definitions are used in your project to cut off unused code. It is really simple to do so, if some units are listed in Implementation section - linker will only add unit functions that are mentioned in you code, not more. If units are listed in Interface section - it mean that potentially all code? from that particular unit should be included. Because your global variable/class should have access to all provided code/procedures/properties.

Marc Weustink (i think wrote):

Just a note: some people think that units can be compiled in one pass - this is not true. The compiler must stop on every Uses clause, and

So .exe's should be (much) smaller if your uses units are put mostly in implementation (not easy to find circular references), but we say rather put it in interface?

If we have to do multipass why is it necessary to have a distinction at all? (Ok, because writing compilers isn't exactly a walk in the park)...

Reply by email

Martin Friebe
to Alexey S. Smirnov: An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazaru…
Alexey S. Smirnov wrote 16 lines
Vincent Snijders ?????: > Can somebody explain to me why smartlinking works better when a unit > is in the implementation section than when it is in the interface > section? I thought for smartlinking it doesn't make a difference, the > unit is used anyway. > The Smart Link process should check what variables/functions/definitions are used in your project to cut off unused code. It is really simple to do so, if some units are listed in Implementation section - linker will only add unit functions that are mentioned in you code, not more. If units are listed in Interface section - it mean that potentially all code from that particular unit should be included. Because your global variable/class should have access to all provided code/procedures/properties.

Is this documented somewhere? I can't follow the logic anyway, the scope how much my code uses of another unit can not be predicted, simply by where I include the other code?

Actually, I do believe I have seen examples where code form units used in the interface was successfully smart-linked.

However there is a differentiation what can be smart linked and what not. If a class has RTTI information, then methods from it can not be removed by smart-linking. Classes with RTTI (afaik) are either included as a whole or not at all. (And that make sense, because RTTI allows to access any method by finding it from a resource or literal string; which are both not parsed by the compiler, and therefore not determinable)

Best Regards
Martin

Reply by email

Mattias Gärtner
to Reenen Laurie: 2009/4/8 Alexey S. Smirnov : Marc Weustink (i think wrote): So .exe's should be (much)…

Zitat von Reenen Laurie :

Show quoted text 18 lines
2009/4/8 Alexey S. Smirnov : > The Smart Link process should check what variables/functions/definitions are > used in your project to cut off unused code. It is really simple to do so, > if some units are listed in Implementation section - linker will only add > unit functions that are mentioned in you code, not more. > If units are listed in Interface section - it mean that potentially all > code? from that particular unit should be included. Because your global > variable/class should have access to all provided > code/procedures/properties. Marc Weustink (i think wrote): > Just a note: some people think that units can be compiled in one pass - > this is not true. The compiler must stop on every Uses clause, and So .exe's should be (much) smaller if your uses units are put mostly in implementation (not easy to find circular references), but we say rather put it in interface?

No. If yes, then you spotted a bug in the compiler and/or linker.

If we have to do multipass why is it necessary to have a distinction at all? (Ok, because writing compilers isn't exactly a walk in the park)...

1. Sometimes you need unit circles, then you need imp uses sections.
2. Some other pascal compilers provide more features than Delphi.

It is personal choice what you prefer:
Use only intf sections to avoid circles.
Use only imp sections ... oh that is not possible. Use mostly imp sections to reduce intf dependencies. For smart linking you should not create imp dependencies too, so don't use imp sections neither.

In other words:
Avoid uses sections, if this is not possible: use only intf sections. That avoids circles and improves smart linking.

Mattias

Reply by email

Florian Klaempfl
to Reenen Laurie: 2009/4/8 Alexey S. Smirnov : Marc Weustink (i think wrote): So .exe's should be (much)…
Show quoted text 17 lines
2009/4/8 Alexey S. Smirnov : > The Smart Link process should check what variables/functions/definitions are > used in your project to cut off unused code. It is really simple to do so, > if some units are listed in Implementation section - linker will only add > unit functions that are mentioned in you code, not more. > If units are listed in Interface section - it mean that potentially all > code from that particular unit should be included. Because your global > variable/class should have access to all provided > code/procedures/properties. Marc Weustink (i think wrote): > Just a note: some people think that units can be compiled in one pass - > this is not true. The compiler must stop on every Uses clause, and So .exe's should be (much) smaller if your uses units are put mostly in implementation (not easy to find circular references), but we say rather put it in interface?

No. The location where a unit is included (interface/implementation) does not matter for smartlinking. If you really want try to drop exe size, play with the whole program optimization implemented by Jonas in trunk.

Reply by email

Florian Klaempfl
to Alexey S. Smirnov
Show quoted text 72 lines
Martin Friebe ?????: > Is this documented somewhere? I can't follow the logic anyway, the scope > how much my code uses of another unit can not be predicted, simply by > where I include the other code? > > Actually, I do believe I have seen examples where code form units used > in the interface was successfully smart-linked. > > However there is a differentiation what can be smart linked and what > not. If a class has RTTI information, then methods from it can not be > removed by smart-linking. Classes with RTTI (afaik) are either included > as a whole or not at all. (And that make sense, because RTTI allows to > access any method by finding it from a resource or literal string; which > are both not parsed by the compiler, and therefore not determinable) > > Best Regards > Martin > > May the problem will become understandable, if we will do a little experiment. So. Let's test the Interface/Implementation Uses sections of /lazarus/lcl/graphics.pp. This section for Lazarus 0.9.26 was that: |interface uses SysUtils, Math, Types, Classes, Contnrs, FPCAdds, FileUtil, FPImgCmn, FPImage, FPCanvas, FPReadPNG, FPWritePNG, PNGComn, // png support FPReadBMP, FPWriteBMP, // bmp support FPReadPNM, FPWritePNM, // png support FPReadJpeg, FPWriteJpeg, // jpg support IntfGraphics, AvgLvlTree, LCLStrConsts, LCLType, LCLProc, LMessages, LCLIntf, LResources, LCLResCache, GraphType, IcnsTypes, GraphMath, InterfaceBase, WSReferences;| | implementation uses SyncObjs;| It was cleanup by me and now looks like that: |Interface uses SysUtils, Types, Classes, FPImgCmn, FPImage, FPCanvas, FPReadJpeg, FPWriteJpeg, // jpg support IntfGraphics, AvgLvlTree, LCLType, LMessages, LResources,LCLResCache, GraphType, IcnsTypes, GraphMath, InterfaceBase, WSReferences;| |implementation uses {FPReadPNG,} FPWritePNG, PNGComn, // png support {FPReadBMP,} FPWriteBMP, // bmp support FPReadPNM, FPWritePNM, // png support LCLStrConsts,LCLProc,LCLIntf, FileUtil, FPCAdds, Math, SyncObjs; |So, previously we have 33 Units mentioned in Interface section and 1 in Implementation section. After cleanup we have 19 Units in Interface section and 12 in Implementation. 3 Units from Interface section was completely removed. ;) Both Lazarus and all connected apps and projects are working fine with this cleanup. And if you do the same thing - you will see that that size of Lazarus will be 15-20 KB less. May be - because of such optimization, may be - because of removing unused units from *Interface* section....

This could be simply the influence of a different memory layout of the exe.

Reply by email

Marco van de Voort
to Marc Weustink: The only thing I know was that this only could be solved by the unit rewrite. Since it is…
Marc Weustink wrote 7 lines
> How recently was this all validated to still be a problem? I know FPC didn't > performed the (apparantly long due) unit system rewrite yet, but not that > much problems in that realm are reported in mantis anymore, even for the > current implementation. The only thing I know was that this only could be solved by the unit rewrite. Since it is not rewriten yet, I assume it is not fixed.

Afaik the rewrite had as an objective to make these errors rarer, and maybe easier to detect (just like 2.0 fixed the constantly broken optimizer).

However that doesn't necessarily means that 2.2.x (and maybe the branch based on 2.3.x if it doesn't receive the rewrite anymore) is a totally lost case. Maybe some things (like relating cross units inlines) are a lost case, but at least blatant problems should be reported.

If Lazarus as the most major user starts avoid these problems instead of reporting them, that is worrying. Paul more or less proves the point with 2 bugs in a version cycle of which one is inlining related.

Reply by email

Hans-Peter Diettrich
to Reenen Laurie: 2009/4/8 Alexey S. Smirnov : Marc Weustink (i think wrote): So .exe's should be (much)…
Show quoted text 5 lines
> Just a note: some people think that units can be compiled in one pass - > this is not true. The compiler must stop on every Uses clause, and So .exe's should be (much) smaller if your uses units are put mostly in implementation

No, that's not related at all.

If we have to do multipass why is it necessary to have a distinction at all?

The compiler must know where to stop pass 1 - and that place is the begin of the implementation section. When the interface section uses definitions from other units, all these units must become part of the interface uses clause, so that the compiler can compile these units before.

The distinction between interface and implementation also allows to recompile only selected units. When only the implementation section of a unit changes, it's sufficient to recompile only that unit. When the interface part changes, also all those units must be recompiled, which use that unit.

DoDi

Reply by email

Henry Vermaak
to Florian Klaempfl: No. The location where a unit is included (interface/implementation) does not matter for…

2009/4/8 Florian Klaempfl :

Show quoted text 5 lines
No. The location where a unit is included (interface/implementation) does not matter for smartlinking. If you really want try to drop exe size, play with the whole program optimization implemented by Jonas in trunk.

smartlinking makes a massive difference for me (1M+). wpo only took another 100K off the total (blank lcl app).

henry

Reply by email

Marc Weustink
to Marco van de Voort: Afaik the rewrite had as an objective to make these errors rarer, and maybe easier to…
Marco van de Voort wrote
If Lazarus as the most major user starts avoid these problems instead of reporting them, that is worrying. Paul more or less proves the point with 2 bugs in a version cycle of which one is inlining related.

For me, when developing it is the difference between a "make" and a "make clean all" on every compilation. (and I compile a lot of times when refactoring). The first is doable, in case of the latter I quit development.

Marc

Reply by email

Vincent Snijders
to Alexey S. Smirnov
Alexey S. Smirnov wrote 32 lines
Florian Klaempfl ?????: > This could be simply the influence of a different memory layout of the exe. > It seams that I was wrong. So. Lets do next small test. The main program is: |program small_test; {$mode objfpc}{$H+} uses Unit1; begin Print_Hello_Word; end.| Uni1.pas is: |Unit unit1; {$mode objfpc}{$H+} Interface Uses Graphics, SysUtils; Procedure Print_Hello_Word; Implementation Procedure Print_Hello_Word; Begin WriteLN('Hello, word! Value is: '+IntToStr(23)); End; end.| As you see - Graphics unit is really unused here.

No, the initialization section of the graphics unit and its dependencies is used. The lesson is: you cannot smart link away initialization (and finalization) sections of a unit.

Vincent

Reply by email

Marc Weustink
to Alexey S. Smirnov
Alexey S. Smirnov wrote 5 lines
So. Ones more - to reduce Lazarus-aware projects code size we shall first check and cleanup "Uses" sections to remove unused units, and next - test Initialization and Finalization sections. Do we really need them? For the Dephi times I remember that those sections were strictly optional and even deprecated.

Nope, that was the begin..end. in units. For dlls you're right (iirc)

Marc

Reply by email

Paul Ishenin
to Marco van de Voort: Afaik the rewrite had as an objective to make these errors rarer, and maybe easier to…
Marco van de Voort wrote
If Lazarus as the most major user starts avoid these problems instead of reporting them, that is worrying. Paul more or less proves the point with 2 bugs in a version cycle of which one is inlining related.

Another known and workarounded in lazarus problem: http://bugs.freepascal.org/view.php?id=13481

Sometimes it is very difficult to avoid it.

Best regards,
Paul Ishenin.

Reply by email

svaa
to Vincent Snijders: No, the initialization section of the graphics unit and its dependencies is used. The…

Vincent Snijders escribi?:

Show quoted text 10 lines
No, the initialization section of the graphics unit and its dependencies is used. The lesson is: you cannot smart link away initialization (and finalization) sections of a unit. Vincent _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Why not?

Is there are a design reason for such behavior?

I mean.
Is there a reason why a linker should never remove such sections? Or the problem is that it is too difficult and complex to implement such a smart compiler/linker?

Santiago A.

Reply by email

Bogusław Brandys
to Paul Ishenin: Debug info can be placed in a separate file - you need to use -Xg option for that. I have…
Paul Ishenin wrote 14 lines
Bogus?aw Brandys wrote: > There is another question, which is debug info.I think it's precious to > have correct unit/line information in case of application crash in > customer computer. That means huge above 33MB applications. > I would be glad if debug info could be dumped into separate file AND > used by lineinfo and heaptrc in case of exception to show stack trace.Of > course as an optional way of distributing application. > Debug info can be placed in a separate file - you need to use -Xg option for that. I have no idea though whether heaptrc or lineinfo units can work with it but gdb can. Best regards, Paul Ishenin.

Well,they do not work with debug info placed into separate file.It is probably minor problem, I've found that .stabs and .stabstr sections are not found by function which do it flawlessly when working with original executable with debug sections.

Boguslaw

Reply by email

Vincent Snijders
to svaa: Vincent Snijders escribi?: Why not? Is there are a design reason for such behavior? I…
svaa wrote 12 lines
Vincent Snijders escribi?: > No, the initialization section of the graphics unit and its dependencies > is used. The lesson is: you cannot smart link away initialization (and > finalization) sections of a unit. > > Why not? Is there are a design reason for such behavior? I mean. Is there a reason why a linker should never remove such sections? Or the problem is that it is too difficult and complex to implement such a smart compiler/linker?

Initialization sections may be used to register things. For example if you include the interfaces unit, then you create the WidgetSet object for the chosen widgetset. No other code is in that unit, but it is needed for proper working of an LCL application (remove the interfaces unit from .lpr file to see what I mean). So it would be wrong for the compiler not to call the initialization section of that unit, even if it is not used later.

Vincent

Reply by email

Alexander Klenin
to Mattias Gaertner: On Wed, 8 Apr 2009 08:40:38 +0200 In order to break the circles, you must first find…
Mattias Gaertner wrote
In order to break the circles, you must first find them. Move all uses to the interface section and FPC will find them for you.

As I already written some time ago, the solution is to introduce a hint/warning for the circular dependencies in implementation sections. This hint should probably be disabled by default, for compatibility reasons.

Alexander S. Klenin

Reply by email

Hans-Peter Diettrich
to Mattias Gärtner
Show quoted text 8 lines
> As I already written some time ago, the solution is to introduce a > hint/warning for the circular dependencies in implementation sections. > This hint should probably be disabled by default, for compatibility reasons. Yes, a hint would be nice. But a hint won't be enough. It would go unnoticed too easy. Circles should not be created accidentally, because it takes extra time to break them afterwards.

I'm not sure whether the compiler can determine circular references, without extra work.

When a circle is inevitable, the according messages must be suppressable.

When circles result from library units (LCL...), the messages are useless to the user, and

Reply by email

Paul Parkyn
to Alexander Klenin: Eh... you mean 'no'? Because I argue _for_ 'uses' sections in implementation. Alexander…

Hello all, I have converted a small Delphi project to Lazarus but I cannot get the TFloatSpinEdit decimal values to display correctly. The component shows the whole number part and no decimal part. I have set the decimal property to 6 decimal places. The value displayed by the component is either rounded up or down, however the real value is used by the program for calculations.

Using FPC 2.2.0 and Lazarus 0.9.24 with Ubuntu 8.10

Thanks Paul

Reply by email

Marco van de Voort
to svaa: Vincent Snijders escribi?: Why not? Is there are a design reason for such behavior? I…
svaa wrote 13 lines
Vincent Snijders escribi??: > No, the initialization section of the graphics unit and its dependencies > is used. The lesson is: you cannot smart link away initialization (and > finalization) sections of a unit. Why not? Is there are a design reason for such behavior? I mean. Is there a reason why a linker should never remove such sections? Or the problem is that it is too difficult and complex to implement such a smart compiler/linker?

Take a line like

initialization
 Register(TSomeComponent);

This means the type of some class goes into some array. However, it can be that some bit of code loads the identifier from disk and looks them up in this array, and then creates the component and streams in data from disk via RTTI. This means that already all published stuff must be linked in, and all code and fields that these use.

Similarlyo a certain percentage of virtual methods and overrides can also be reached.

It is nearly impossible for a compiler to see if this scenario is likely or not.

Reply by email

dmitry boyarintsev
to Marco van de Voort

Can compiler detect, if initialized procedure variable is not used and smartlink it off?
In the following example:
there's a global procedure variable. it's initialized by unit2, that is used by program.
but even if it's initialized, the procedure itself (someProc) is never called. So, is it possible to cut off someProc and MyProc as well?

--- unit1.pas ---

interface
var
  someProc : TProcedure;

--- unit2.pas ----

uses
  unit1;
procedure MyProc;
initialization
  someProc := @MyProc;

--- program.pas

uses
  unit1, unit2;
begin
  writeln('hello world');
end.

thanks,
dmitry

Reply by email

Joost van der Sluis
to Martin Friebe: Is this documented somewhere? I can't follow the logic anyway, the scope how much my code…

Op woensdag 08-04-2009 om 17:14 uur [tijdzone +0100], schreef Martin Friebe:

Show quoted text 20 lines
Alexey S. Smirnov wrote: > Vincent Snijders ?????: >> Can somebody explain to me why smartlinking works better when a unit >> is in the implementation section than when it is in the interface >> section? I thought for smartlinking it doesn't make a difference, the >> unit is used anyway. >> > The Smart Link process should check what > variables/functions/definitions are used in your project to cut off > unused code. It is really simple to do so, if some units are listed in > Implementation section - linker will only add unit functions that are > mentioned in you code, not more. > If units are listed in Interface section - it mean that potentially > all code from that particular unit should be included. Because your > global variable/class should have access to all provided > code/procedures/properties. > Is this documented somewhere? I can't follow the logic anyway, the scope how much my code uses of another unit can not be predicted, simply by where I include the other code?

It's not documented as it's not true. A few of the reasons for that you mentioned yourself.

Joost

Reply by email

Marco van de Voort
to dmitry boyarintsev: Can compiler detect, if initialized procedure variable is not used and smartlink it off?…
dmitry boyarintsev wrote 7 lines
Can compiler detect, if initialized procedure variable is not used and smartlink it off? In the following example: there's a global procedure variable. it's initialized by unit2, that is used by program. but even if it's initialized, the procedure itself (someProc) is never called. So, is it possible to cut off someProc and MyProc as well?

In theory this could be done I think, but it is a global optimization, and is currently not yet done.

Global optimization have a lot of practical concerns though since they often require multiple compilation passes, and thus a lot of infrastructure to make it end-user ready.

Reply by email

Bart
to Paul Parkyn: Hello all, I have converted a small Delphi project to Lazarus but I cannot get the…

Hi

Paul Parkyn wrote 12 lines
Hello all, I have converted a small Delphi project to Lazarus but I cannot get the TFloatSpinEdit decimal values to display correctly. The component shows the whole number part and no decimal part. I have set the decimal property to 6 decimal places. The value displayed by the component is either rounded up or down, however the real value is used by the program for calculations. Using FPC 2.2.0 and Lazarus 0.9.24 with Ubuntu 8.10 Thanks Paul ______________

Try a recent version of Lazarus.
TFloatSoinEdit was patched severla times since Laz 0.9.24

Bart

Reply by email

Paul Parkyn
to Bart
Bart wrote 19 lines
Hi On 4/10/09, Paul Parkyn wrote: > Hello all, I have converted a small Delphi project to Lazarus but I > cannot get the TFloatSpinEdit decimal values to display correctly. The > component shows the whole number part and no decimal part. I have set > the decimal property to 6 decimal places. The value displayed by the > component is either rounded up or down, however the real value is used > by the program for calculations. > > Using FPC 2.2.0 and Lazarus 0.9.24 with Ubuntu 8.10 > > Thanks Paul > > ______________ Try a recent version of Lazarus. TFloatSoinEdit was patched severla times since Laz 0.9.24

I have updated FPC to 2.2.2-8 and Lazarus to 0.9.26-4 using Ubuntu 9.04 Beta

The problem is still the same. I can type the decimal numbers into the component but as soon as the focus goes to another component the decimal part of the number disappears.

Thanks for your reply, it pushed me to update.

regards Paul

Reply by email

Graeme Geldenhuys
to Paul Parkyn
Paul Parkyn wrote 6 lines
I have updated FPC to 2.2.2-8 and Lazarus to 0.9.26-4 using Ubuntu 9.04 Beta The problem is still the same. I can type the decimal numbers into the component but as soon as the focus goes to another component the decimal part of the number disappears.

I just tried with 0.9.27 (r19310) and the GTK2 widgetset and everything works fine. What widgetset are you using and what character (based on your locale) is the decimal character? On my system the decimal character is a fullstop - in other locales it can be a comma.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Paul Parkyn
to Graeme Geldenhuys
Graeme Geldenhuys wrote 16 lines
On Sun, Apr 12, 2009 at 1:45 AM, Paul Parkyn wrote: > I have updated FPC to 2.2.2-8 and Lazarus to 0.9.26-4 using Ubuntu 9.04 > Beta > > The problem is still the same. I can type the decimal numbers into the > component but as soon as the focus goes to another component the decimal > part of the number disappears. I just tried with 0.9.27 (r19310) and the GTK2 widgetset and everything works fine. What widgetset are you using and what character (based on your locale) is the decimal character? On my system the decimal character is a fullstop - in other locales it can be a comma. Regards, - Graeme -

Yes I have been doing more testing and it works ok up to 5 decimal places. I require 6 decimal places to correspond with the accuracy required by another program. Unfortunately I had not tried at a lower number of decimal places(silly me).

It looks like I will have to live with this resolution.

Thanks for your help, I am using GTK and a Fullstop.

Regards Paul

Reply by email

Graeme Geldenhuys
to Paul Parkyn
Paul Parkyn wrote
Yes I have been doing more testing and it works ok up to 5 decimal places. I require 6 decimal places to correspond with the accuracy required by another program. Unfortunately I had not tried at a lower number of decimal places(silly me).

I tried with only two decimals. After reading your email, I tried again. I noticed by default it truncates to 2 decimals. Then I saw the 'DecimalPlaces' property. I set it to 6 and type in 12.123456 and tabbed to another component. No problems. It remember the 6 decimals without problems.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Paul Parkyn
to Graeme Geldenhuys
Graeme Geldenhuys wrote 17 lines
On Sun, Apr 12, 2009 at 10:43 AM, Paul Parkyn wrote: > Yes I have been doing more testing and it works ok up to 5 decimal > places. I require 6 decimal places to correspond with the accuracy > required by another program. Unfortunately I had not tried at a lower > number of decimal places(silly me). > I tried with only two decimals. After reading your email, I tried again. I noticed by default it truncates to 2 decimals. Then I saw the 'DecimalPlaces' property. I set it to 6 and type in 12.123456 and tabbed to another component. No problems. It remember the 6 decimals without problems. Regards, - Graeme -

Hello Graeme, It looks like I will have to upgrade again to 0.9.27, it is good to know that it is OK, so will persevere with it.

Regards Paul

Reply by email

Vincent Snijders
to Paul Parkyn
Paul Parkyn wrote 19 lines
Graeme Geldenhuys wrote: > On Sun, Apr 12, 2009 at 10:43 AM, Paul Parkyn wrote: > >> Yes I have been doing more testing and it works ok up to 5 decimal >> places. I require 6 decimal places to correspond with the accuracy >> required by another program. Unfortunately I had not tried at a lower >> number of decimal places(silly me). >> > I tried with only two decimals. After reading your email, I tried > again. I noticed by default it truncates to 2 decimals. Then I saw the > 'DecimalPlaces' property. I set it to 6 and type in 12.123456 and > tabbed to another component. No problems. It remember the 6 decimals > without problems. > > Regards, > - Graeme - > Hello Graeme, It looks like I will have to upgrade again to 0.9.27, it is good to know that it is OK, so will persevere with it.

Upgrading to 0.9.27 is not safe, it is changing every day. Graeme uses a particular revision of 0.9.27, that he found safe.

Vincent

Reply by email

Paul Parkyn
to Vincent Snijders
Vincent Snijders wrote 5 lines
> Upgrading to 0.9.27 is not safe, it is changing every day. Graeme uses a > particular revision of 0.9.27, that he found safe. > > Vincent >

thank you Vincent for a timely reminder.
Regards Paul.

Reply by email

Graeme Geldenhuys
to Paul Parkyn
Paul Parkyn wrote 7 lines
Vincent Snijders wrote: >> Upgrading to 0.9.27 is not safe, it is changing every day. Graeme uses a >> particular revision of 0.9.27, that he found safe. >> >> Vincent >> thank you Vincent for a timely reminder.

Vincent is correct. Before I try a new version or revision of Lazarus I make a note of which revision I was using. Then update and test. If something is major wrong, I revert back to the previous revision I used.

Alternatively, you can simply back-port the fixes in TFloatSpinEdit to a 0.9.26.x version.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email