LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Clang optimizing compiler

Solved!
Go to solution

One of the new features of CVI2010 is the support of Clang as an external optimizing compiler.

 

Sounds great.

 

Searching the help for Clang returns one entry:

 

clangclang 1.0. The clang compiler is installed with LabWindows/CVI.

 

Sounds interesting, where is it, how can I select it? I have checked the build options but all I could choose from is 'Standard CVI compiler' and 'Intel C++ 11.1'

 

Or does it mean that CVI's internal compiler now is clang? But CVI's compiler does not create optimized code...

 

I am confused... 

0 Kudos
Message 1 of 7
(4,118 Views)
Solution
Accepted by Wolfgang

Wolfgang,

 

The clang compiler does ship with CVI 2010. It is not the native CVI compiler. To use this or any other external compiler with CVI, you must first create a configuration file (.ecc) for it. You do this in Options>>Build Options>>Build Process Options>>Active xx-bit compiler>>New. There should already be a template for the clang compiler's configuration, so you can simply select this template from the Template Configuration ring, and you're done. Once you have this configuration, it should be selectable in the compiler ring.

 

Luis

0 Kudos
Message 2 of 7
(4,098 Views)

Thanks Luis!

0 Kudos
Message 3 of 7
(4,093 Views)

Dear Luis,

do you have any experience with the new clang compiler? Can you please explain to me how i can modify the ecc file that the include paths from the project are found?

 

My problem is, I configured the clang compiler but when I try to compile it does not find the headers

 

Can you help me?

 

Thanks

Oliver

0 Kudos
Message 4 of 7
(3,957 Views)

Hi Oliver,

 

You shouldn't have to do anything special for clang (or any other third-party compiler) to find your headers. When CVI invokes the compiler it automatically specifies, as include paths, all the custom include paths that you have specified yourself (Options>>Environment>>Include Paths) as well as the paths of all the header files in your project, the paths of all your instrument files and all the standard include paths that CVI uses.

 

This header file (or files) that clang can't find... are they in the project? If not, did you specify include paths for them in CVI?

 

Luis

0 Kudos
Message 5 of 7
(3,944 Views)

Hi Luis,

I tried this several time today but it didn't work. Now i killed all the paths out of the 'include paths' in the environment and I renewed them and now I can compile!!! The compiler works.

 

So I am now one step ahead.

 

Now I got a lot of messages from the linker e.g. 'multible definitions of symbols _PtrToPtr64' in module ....CVI_int_obj_9561.obj

 

Do you know what this is? can you help me again to solve this problem also?

 

Thanks

Oliver

0 Kudos
Message 6 of 7
(3,937 Views)

Hi Luis

I found a message about the c99 extension. I activated it and now I can link! It is a known issue.

 

But on starting i get a fatal runtime error ;-( I am working on it

 

 

Using clang 1.0 as your active release compiler might result in link errors if you include windows.h from more than one source file.
If you use clang 1.0 as your active release compiler and you disable C99 extensions, you will get link errors if you include windows.h from more than one source file.

Workaround: Enable the Build with C99 extensions option in the Configuration Options tab of the Build Options dialog box.

Reported Version: 2010    Resolved Version: N/A    Added: 11/19/2010
0 Kudos
Message 7 of 7
(3,935 Views)