LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cvi2013 Compiler "Optimization level"

Is it possible to use the cvi2013 compiler "Optimization level" only for selected files or for selected functions inside a file (for example by a #pragma ???") instead of activating it under "Options" -> "Build Options" ->"Configuration Options"?

I changed a large project from cvi2012 to cvi2013. I need speed optimization for several parts of the software. Activating it for the whole project results in a crashing application (not always conform to strong c-syntax).

Thanks

Willi

 

 

 

 

 

 

0 Kudos
Message 1 of 3
(3,815 Views)

Hi Willi,

 

because these options are global options, it will not be possible to select several functions and just optimize them.

Thats why the answer to your question is simply "no".

 

My advise: try to write your code in conform c-syntax and be able to 1. compile successfully and 2. leverage the optimizations of this function.

 

Best regards,

Abduelkerim

Sales
NI Germany
0 Kudos
Message 2 of 3
(3,778 Views)

Willi,

 

The reply above is correct that you cannot turn optimization on for specific files. However, there is another way to achieve what you want.

 

You can create a separate project that builds a static library and contains the files you want to optimize. You can include the static library built by that project in your main project. You can then turn optimization on for the static library project.

 

If you add the static library project to the same workspace that already contains your main project then you will be able to see all your files at the same time in the workspace tree. You can even make your main project depend on the static library project so that building the main project will automatically cause the static library project to rebuild when needed. The way project dependencies work in CVI, CVI will automatically build the configuration of the static library project (Debug, Debug64, Release, Release64) that matches the currently selected configuration of your main project. If you want to debug code in the static library project, you can just open one of those files, set a breakpoint, and run the main project and you should hit that breakpoint. You can configure project dependencies by selecting Build >> Project Dependencies.

 

Once you have this setup, it should behave exactly the way you wanted.

 

I hope this helps.

 

-Jeff

Message 3 of 3
(3,745 Views)