10-26-2009 06:04 PM
Has anyone used the Intel C++ Compiler for Windows 11.1 as the release compiler with CVI 9.x?
CVI 9.0 has an Intel 10.0 compiler template, but this is a major release old at this point.
It seems NI is always a release or two behind when it comes to Intel compiler templates.
I guess I could run the 10.0 template and hope it works. I think I had to fix up to use the Intel 9.0 compiler too.
Thanks.
10-27-2009 09:45 AM
Hi,
I had a similar post some time ago... Yes, I was using Intel 11.1 compiler with CVI 9.0.1, after adapting the ecl file. If needed, I can provide it. Unfortunately, while I am able to compile, I failed to use the Intel linker which is a pity because it precludes using their libraries...
Wolfgang
10-27-2009 11:05 AM
Thanks for the reply, Wolfgang.
I'll try using the 10.0 template and see how that goes. I was able to get the Intel 9.0 compiler to work with a template for Intel 8.0 that I modified. I was able to link OK, but I recall having trouble when I specified one of the performance options to the compiler.
I do now have the 9.0 compiler running with CVI 9.0.1, I am using the10.0 compiler template. So far it seems to work OK.
If I fail to get 11.1 going I'll ask for the ecc file.
Wiedersehen
Menchar
10-27-2009 11:13 AM
Just in case, here is the ecc file. Good luck and let me know about your progress...
11-04-2009 11:43 AM
Wolfgang -
I have the 11.1 compiler up and running all OK for release compiles, but I am missing some libraries - I get link errors for
__kmpc_begin
__kmpc_global_thread_num
__kmpc_fork_call
etc.
I recall fighting my way through this before, I believe I need to find the appropriate Intel libraries for inclusion in the project. In some cases, I believe the required libraries are dependent upon which compiler options are used. I seem to recall one problematic function was one the compiler uses to determine the micro type the executable is running on.
I've used "my" Intel 11.1 template and yours and same difference on these link errors.
I'll keep hacking away - as I said I believe I solved this for Intel 9.0 and 10.0 ...
11-04-2009 12:00 PM
I see what you are saying about the linker now ...
In the CVI help it says the CVI linker is always used, and that the CVI linker doesn't support the use of specific external libraries.
I had thought I got around this somehow, but maybe all I did before was turn off some of the optimizations I needed.
Seems pretty dumb to allow the use of an optimizing external compiler and then preclude the use of the compiler-specific libraries.
Maybe it's time to port to Visual Studio for anything that needs optimized code.
I suppose I could create a DLL or process in Visual Studio and then use the Intel Compiler with VS ... I'd guess VS doesn't have this same library problem.
Or, compiler using Intel 11.1 C++ compiler from the command line with a make file and build that way.
This is frustrating ... NI needs to put a big asterisk on their claim of support for external optimizing compilers ...
11-04-2009 01:49 PM
Hi Menchar,
I agree with the frustation on the linkage issue; mostly, however I would blame Intel for provinding such a vast variety of library combinations;
Actually I am hoping that the new CVI release will support the latest Intel libraries, too, and that this will solve the problem. In any case, you may try the following Intel site which might help a bit: http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ It did improve things in my case, i.e. reduce the number of warnings and errors, but not to zero, unfortunately.
Good luck,
Wolfgang
11-05-2009 03:11 PM
More info -
Using the /Qparallel option is what causes the link errors for the missing __kmpc_ functions.
I can use /O2 and /O3 and compile and link all OK,
BUT ....
I have some code using the performance counters exposed by the Win32 API and the code works just fine with the native CVI compiler but returns "0" elsapsed time when the same code is compiled with Intel 11.1. I had wanted to measure just how much more wonderful the Intel 11.1 compiler was when optimizing for time.
I can't figure out why NI can't support the optimized Intel compiler libraries with the NI linker ...
I wonder though shouldn't it be possible to link CVI binaries using, say the Visual Studio linker? I'm using the COFF. Does anyone have any experience linking CVI binaries that way?
Menchar
11-06-2009 07:37 PM
And the reason was the evaluation order of the expression I was using to calculate elapsed time was different with the Intel compiler and it wasn't promoting the expression to a double , was doing an integer divide and reporting zero elapsed time 😉 So I threw another cast at it and it now works. Scary how easy you can write C code that's compiler dependent!
On the good side of things, I have the 11.1 compiler working well enough with just the O2 and O3 optimizations that it just screams through a huge array (600+ MB) of shorts I've created static short int iArray [1000][480][640] (yup, it's video frames) touching every value in the array several times and it does this in under 500 millisecondson a two core E8400 3GHz 4GB desktop running XP Pro !!!!
Same code, running the CVI LCC compiler in release mode takes 43.9 seconds !!!
I'm not even sure it's using both cores with the O2 and O3 optimizations - if I partition this and multi-thread it it may go faster still.
Menchar
11-06-2009 07:44 PM
And the answer is ..
Yes, it's getting into both cores, I can watch them both spike in task manager, also see page file usage spike coincident with the task. Suspect the effect on second core is second order effect - I don't think it's using two threads on the application per se but likely inducing activity by the OS in the second core ... Overall CPU usage spikes to 45% or so for the quick half second it takes to run ...
Menchar