Recent

Author Topic: [Solved] BgraControls fails compilation  (Read 3771 times)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
[Solved] BgraControls fails compilation
« on: December 23, 2018, 12:33:04 am »
I need PascalSCADA, and it depends on BgraBitmap and BgraControls. I used to compile PascalSCADA from OPM, so all dependencies were solved automatically. It used to work on 32bit Laz 1.8 fixes + FPC 3.0 fixes (by FpcUpDeluxe) on Win10 x64, but on Laz 2.0 fixes (RC2 currently) + FPC 3.2 fixes and on Laz trunk + Fpc trunk it doesn't. It always fails on BgraControls installation, saying that some ppu BgraBitmap unit is incompatible. So I have tried to install everything mentioned from FpcUpDeluxe instead of OPM, but BgraControls compilation fails again. Then I have downloaded master.zip archives of both BgraBitmap and BgraControls from official github repo and tried to install them manually. BgraBitmap installed, but BgraControls failed again. Here is the output:

Quote
Compile package bgracontrols 6.0.2: Exit code 1, Errors: 1, Warnings: 3, Hints: 2
bcbasectrls.pas(44,22) Hint: Unit "Types" not used in BCBaseCtrls
bctools.pas(343,14) Warning: Local variable "p" of a managed type does not seem to be initialized
bcbutton.pas(55,52) Hint: Unit "LMessages" not used in BCButton
bcfilters.pas(320,21) Warning: Local variable "gpallete" of a managed type does not seem to be initialized
Warning: Recompiling BGRASliceScaling, checksum changed for C:\PRG\Lazarus\FixesAll\ccr\-\bgrabitmap\bgrabitmap\lib\i386-win32\3.2.0\bgrabitmap.ppu
bcimagebutton.pas(55,32) Fatal: Cannot find BGRASliceScaling used by BCImageButton, incompatible ppu=C:\PRG\Lazarus\FixesAll\ccr\-\bgrabitmap\bgrabitmap\lib\i386-win32\3.2.0\bgraslicescaling.ppu, package BGRABitmapPack

Clean build doesn't help.  Here are my optimized IDE options: -O3 -g- -Xs -CpPENTIUMM -CfSSE3.

Does anyone have some clue what is going on?  %)

EDIT1: Ok, I will try something mentioned at http://forum.lazarus.freepascal.org/index.php/topic,35642.0.html and report if it helped.

EDIT2: Changing from Optimized IDE to Normal fixed the compilation problem. However I think that it has something to do with Lazarus and not with BgraControls, since I got pretty similar result when I tried to compile old BgraControls 4.3.1 that comes with PascalSCADA, and which worked without problems on earlier Lazarus:

Quote
Compile package bgracontrols 4.3.1: Exit code 1, Errors: 1, Warnings: 1
Warning: Recompiling BGRAGradients, checksum changed for C:\PRG\Lazarus\FixesAll\ccr\-\PascalSCADA\bgrabitmap\lib\i386-win32\3.2.0\bgrabitmaptypes.ppu
bcsamples.pas(11,32) Fatal: Cannot find BGRAGradients used by BCSamples, incompatible ppu=C:\PRG\Lazarus\FixesAll\ccr\-\PascalSCADA\bgrabitmap\lib\i386-win32\3.2.0\bgragradients.ppu, package BGRABitmapPack

EDIT3: Changing back from Normal to Optimized IDE made compilation fail again. Then I changed just -O3 to -O2 and it worked. Silly me. Now I just don't know if that should be reported to bug tracker or not...
« Last Edit: December 23, 2018, 01:11:54 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

circular

  • Hero Member
  • *****
  • Posts: 4224
    • Personal webpage
Re: [Solved] BgraControls fails compilation
« Reply #1 on: December 26, 2018, 01:46:34 pm »
Is it because there are different levels of optimizations used at the same time (O2 and O3)?
Conscience is the debugger of the mind

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: [Solved] BgraControls fails compilation
« Reply #2 on: December 27, 2018, 08:59:45 am »
Is it because there are different levels of optimizations used at the same time (O2 and O3)?
Well, I thought that clean up and build all should have taken care of such differences. Unfortunately, problem is not fixed and I still have issues. After a while O2 didn't help. All is well when I have small number of packages installed in IDE, but when I make a very fat IDE problems start to show up. Current situation is that without adding any new packages, just with clean and build all I can not get a working IDE. It doesn't matter if I use Normal IDE, Debug IDE (both without adding any custom switches) or optimized IDE (default or custom switches). Some PPUs are reported as incompatible, and with clean and build all IDE compilation is stopped now by some package that I already have installed in IDE. And it is different PPU problem in Normal IDE and different in Debug IDE. It doesn't even help if I manually find those PPUs and delete them, or even if I manually delete all PPUs in Lazarus dir before IDE rebuilding.

This is not new to me, but this time I wanted to put some effort into understanding this behavior. I have seen that at least with Lazarus 1.2, 1.4, 1.6, 1.8 and now with 2.0. I add packages one by one, solve some compilation issues on that way, and at some moment in time I come to a point when almost everything I want is added, but  clean and build all would not work any more - so I am out of luck if that is what is needed to make some new package work. If anyone wants to take a look I can put it on some site to download, but I must warn you - last time I packed it with 7zip my fpcupdeluxe win32 Lazarus (2.0 fixes + FPC 3.2 fixes archive that works on any Windows when put into c:\prg\lazarus\FixesAll dir) had several hundreds of megabytes, and I was not done with packages installation yet.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: [Solved] BgraControls fails compilation
« Reply #3 on: December 27, 2018, 11:21:41 am »
Did you run into the "out-of-memory" trap of 32-bit Lazarus? Then https://forum.lazarus.freepascal.org/index.php/topic,42234.msg294779.html may help you to some degree (see the instructions in my response #26 based on af0815's idea with CFF in reply #21). If that still runs out of memory you only can switch to 64-bit Lazarus.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: [Solved] BgraControls fails compilation
« Reply #4 on: December 28, 2018, 12:25:31 pm »
Did you run into the "out-of-memory" trap of 32-bit Lazarus? Then https://forum.lazarus.freepascal.org/index.php/topic,42234.msg294779.html may help you to some degree (see the instructions in my response #26 based on af0815's idea with CFF in reply #21). If that still runs out of memory you only can switch to 64-bit Lazarus.
No. That is not the problem. Only PPU missmatch. FPC 3.2 is already patched and does not show "No memory" behavior:
https://forum.lazarus.freepascal.org/index.php/topic,40351.msg280516.html#msg280516
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: [Solved] BgraControls fails compilation
« Reply #5 on: July 05, 2019, 03:44:58 pm »
I have found a workaround for "incompatible ppu" error. Error can show on any package, not only BGRABitmap from the topic.

Info: "incompatible ppu" error comes after already having tons of packages and then trying to add some new package. New package compiles, but IDE refuses rebuilding with "incompatible ppu" error for some old package that previously worked. It was sometimes Sparta package, sometimes BGRAbitmap, and sometimes some other package. Once an error shows for some package it stays with that package. It goes away only if errored package is uninstalled, but pretty soon after adding more packages some other old package goes into error, and it has to be uninstalled too.

Workaround: Workaround is found that so far worked each time I tried (about 25-30 times). Workaround is to enter "Configure Build Lazarus" IDE form, check "Clean common files" (it does not work with "Automatically" or "Clean All"), check "Switch after building to automatically", and build IDE. After that I can continue adding packages normally. When "incompatible ppu" error shows again (after adding 10-15 packages) I repeat the procedure and everything goes back to normal. If package can be compiled, I will be able to install it now. No more show stoppers.

Bugtracker: https://bugs.freepascal.org/view.php?id=34899

P.S.: This work around was tested on Win10x64 32-bit Lazarus 2.0.3 and FPC 3.2.0 fixes. IDE building options were -O2 -g- -Xs -CpPENTIUM4 -CfSSE3.
« Last Edit: July 05, 2019, 03:46:29 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

circular

  • Hero Member
  • *****
  • Posts: 4224
    • Personal webpage
Re: [Solved] BgraControls fails compilation
« Reply #6 on: July 05, 2019, 09:47:14 pm »
That's interesting.

Good you found a way to solve that. Indeed cleaning up sometimes mysteriously helps.
Conscience is the debugger of the mind

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: [Solved] BgraControls fails compilation
« Reply #7 on: July 05, 2019, 10:25:26 pm »
Indeed cleaning up sometimes mysteriously helps.
Strange is that "Clean All" does not help and "Clean common files" does help. After successful rebuilding is done any option works.

To summarize my problems with installing tons of components on Lazarus (1.0, 1.2, 1.4.x, 1.6.x, 1.8.x, 2.0.x and trunk):

1) "Out of memory" on 32bit Lazarus was fixed in FPC 3.2 or with a patch for 3.0.x.
2) Strange rebuilding problems fixed when changed -O3 to -O2 (and yes, I had issues even in NORMAL build mode without any optimizations)
3) "incompatible ppu" error and related checksum error now have a "Clean common files" workaround.

And before anyone asks, I need 32bit Lazarus because of some cross compiler issues on 64bit version.
« Last Edit: July 05, 2019, 10:29:46 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018