03-27-2020 08:24 AM
Hello,
I am looking for some clarification regarding EnableDebuging flag in build specification, especially part saying 'disabling does not ensure full optimization'.
How can I ensure full optimization? I think we can set compiler level to 10 before build.
How is DisableDebugging related to individual VI settings in build specification? When debugging is disabled for build but enabled for vi what happens?
03-27-2020 08:37 AM
@pawhan11 wrote:
Hello,
I am looking for some clarification regarding EnableDebuging flag in build specification, especially part saying 'disabling does not ensure full optimization'.
How can I ensure full optimization? I think we can set compiler level to 10 before build.
How is DisableDebugging related to individual VI settings in build specification? When debugging is disabled for build but enabled for vi what happens?
For full optimization the Build should not have Debugging enabled ...
What happens is that the block diagram is included in the build so that you can connect to the program and probe data and suff. Therefore all optimizations can't be used. So, what happens when it's disabled for build but enabled for vi? That's a normal program. 🙂
/Y
03-27-2020 10:27 AM
So when I have debugging disabled in build specification I also have to go and change settings of each individual vi to disable debugging to have full optimization? 😣
03-27-2020 10:34 AM
@pawhan11 wrote:
So when I have debugging disabled in build specification I also have to go and change settings of each individual vi to disable debugging to have full optimization? 😣
No. The implication of the phrasing at the tickbox is that if you remove debugging, you will get all optimisations.
Of course, what level you get if you enable debugging is unclear, at least to me.
04-18-2020 01:07 PM
For release build I ended up doing:
- compilation level 10
- disable debugging
- tend to remove error cases when placed inside subvis, hard to read this just pass the error instead, native functions will not execute on error anyway
- place all project structure in one common root virtual directory containing all source VIs and uncheck allow debugging on this folder
Is there something more that can be done to ensure full optimization?
I am more interested about various build build settings, than source code modifications.
04-20-2020 01:34 PM
The full (and confusing) answer to your question is here:
https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/compiler_optimizing_for_execution_speed/
It details all of the tweaks you can make on build specification at the highest level and per VI. Some settings seem contradictory but are to force a discrepancy between the VI properties in a saved VI and the VI properties in the build specification. This forces LabVIEW to recompile each VI during the build process, applying the higher compiler setting (and other settings) to the build's source files and dependencies.
04-20-2020 01:53 PM
Thanks for reply, I think debugging on VIs is enabled by default so all good there.
For dependencies I can simply set this flag in build spec as follows?:
So according to this doc, building app does not actually recompile all source code?
The deeper I go the more confusing it gets.
04-20-2020 04:08 PM
Correct, setting the build specification properties to debugging DISABLED and the individual VI property to debugging ENABLED (default setting) forces a recompile during building. The forced recompile is beneficial only if the compiler optimization setting has been increased. This option can be manually set beforehand in LabVIEW options or can be incorporated into the build specification by creating a "PRE-build action VI" that uses scripting nodes to programmatically alter the compiler optimization setting (set to 10, highest). A "POST-build action VI" can be used to return this setting to 5, which is the default.