neural-api icon indicating copy to clipboard operation
neural-api copied to clipboard

Compile Errors - Delphi 10.3 - Release

Open HuguesDug opened this issue 5 years ago • 6 comments
trafficstars

Development environment. Delphi 10.3, targets windows 32 or 64 bits, release and debug. Last release of Master branch as of June 21rst.

Error : Compiler errors when trying to compile in Release mode.

Error 1: In NeuralNetwork.pas Compiler raise error : E2501 : inline not possible for a nested procedure.

This is due to inline directive" in the declaration of TNNetLayer.ComputeErrorDeriv(); It is activated when going in release mode, but not activated in debug.

Error2: In NeuralThread;pas Similar problem with function fNTL: TNeuralThreadList; {$IFDEF Release} inline; {$ENDIF} Cannot be inlined.

HuguesDug avatar Jun 21 '20 05:06 HuguesDug

Thank you for reporting!

joaopauloschuler avatar Jun 22 '20 04:06 joaopauloschuler

This is really strange. I've just given a go with Release settings and I can build with Delphi 10.3.

joaopauloschuler avatar Jun 22 '20 18:06 joaopauloschuler

Hello, I tested again, no discussion : compiling fails. Delphi 10.3.3 Check your compilers directive inside project-settings-Delphi compiler - compiler options. Do you have the control inline code active ?

HuguesDug avatar Jun 23 '20 05:06 HuguesDug

Here are my compiler directives, for release mode. They are default option, as I reinstalled recently the 10.3.3 over a clean install. It is a translation from French... sorry for the wording.

Other options : all unchecked

Debugging :

  • Assersions checked
  • use imported data reference checked other are unchecked

Runtime erros:

  • all unchecked except I/O error

Code generation:

  • Data alignment : quad word
  • stack frame : unchecked
  • inline code : auto
  • next two ones, unchecked
  • optimization checked.

Syntaxe:

  • all checked except
  • typed const unchecked
  • complete if test
  • typed '@'

Keep in mind, I am running a project in a windows form.

As a fix, I did:

  • For TNNetLayer.ComputeErrorDeriv(), I copied past the code of the procedure to replace the call to the function (not nice, but does the job). However, surprised the code of this procedure differs between FPC and Delphi. You make some tests and act differently in FPC, where you do a basic call in Delphi. Very strange. For me, this is hiding something else than the compiler error message.

  • For the second error, function fNTL: TNeuralThreadList;, it is an error 2441. The variable "vNTL", it has to see with the visibility of the variable inside the interface of the class. You declare this variable inside the implementation section of the unit. You have to move it to the inferface section. This makes sens. You try to inline this variable inside an objet that is in the interface. The compiler gets frustrated about that.

Then, it compiles OK.

HuguesDug avatar Jun 24 '20 13:06 HuguesDug

Thank you for sending details. I'll look into it.

joaopauloschuler avatar Jun 24 '20 23:06 joaopauloschuler

I read delphi documentation regarding INLINE directive.

I confirm yourcode should not compile in 10.3, as the restrictions on the use of inline for specific cases clearly exclude what was programmed.

So, it is not a problem of compiler setting. More probably the fact that you did not test with "release mode" activated. So, INLINE was ignored.

HuguesDug avatar Jul 13 '20 06:07 HuguesDug