Bug report, MSVC 2017 generated files won't let me use the Intel compiler


#1

Ok, here’s a very strange bug that happens with the latest Projucer build. Anything created for MS Visual Studio 2017 will not allow me to use the Intel 2019 compiler. Everything is up to date and works correctly if I create a new project inside Visual Studio itself. I add to the compiler command /Ttis so it trows an error and shows me which compiler its using.

NOW here’s the interesting part. If I use an older version of Projucer and create a Visual 2010 file, it WORKS. :-o I tried 2015 and 2013 but them I get another error.

The Projucer that works is: 4.3.1

I search online but have not found anyone with the same problem.

Again, if I create a NEW project inside Visual 2017 I can use the intel compiler without problems.

Thanks for any assistance as this old Projucer is not good, the new one is great!

Thanks again for the hard work.

Best Regards, WilliamK


#2

I’ve just downloaded the latest “Intel Parallel Studio XE 2019” version to try this out and it’s working fine for me for VS2017 projects generated by the latest Projucer.

I configured it by running psxevars.bat intel64 from the installation directory and then selected “Use Intel C++” from “Project->Intel Compiler” in VS2017 which printed:

Project: "IntelCompilerTest_App"
	Platform "x64" has been updated to use the Intel C++ compiler successfully.
========== Done ==========

to the VS output window. I can confirm that it’s been set by looking at the .vcxproj file which has the following property:

<PlatformToolset>Intel C++ Compiler 19.0</PlatformToolset>


#3

Thanks for taking the time to check this, but you forgot to test the actual output by using the tip I wrote above.

I did all this and everything worked just as for you, I even tried a new project created with the latest ProJucer.

Here, you need to check the actual output to see if it’s using CL (MS 2017) or ICL (Intel 2019)

The tests above were done just like you did, everything shows to be using the Intel 2019 Compiler, but the output shows it still uses the MS compiler. AND, the resulting file is the same size and no optimizations were added.

Cheers, WilliamK


#4

OK, this isn’t a pretty fix but you’ll need to open the project’s .vcxproj file and manually replace all of the

<PlatformToolset>v141</PlatformToolset>

with

<PlatformToolset>Intel C++ Compiler 19.0</PlatformToolset>

and then re-save the file. Visual Studio will prompt you to reload the project and then you will be able to use the Intel C++ compiler. Just changing the “Platform toolset” option in the project properties won’t work, hence why you need to manually edit the file.

Past this point I’m afraid you’re on your own. We don’t actively support the Intel C++ compiler or test it in our CI so you may get compiler errors, warnings etc.


#5

Thank you so much!! That works. I will just do that. Still testing the compiler, as it requires a lot of RAM to work for the heavy optimizations and I only got 8 Gig of RAM… time to upgrade…

Cheers, WilliamK


#6

I think we can actually safely remove those other PlatformToolset properties from the project generation step in the Projucer, so you won’t need to manually edit the .vcxproj file. I’ll investigate and push that change if it’s working OK.


#7

OK, if you re-build the Projucer from the tip of the develop branch and re-save your project then you will be able to switch to the Intel compiler without having to manually edit the .vcxproj file.


#8

Thank you so much!

I must say, the generated code so far runs a bit faster and the compiler tells me more things that I could fix about my code. So it is a nicer compiler IMHO. :wink:

I couldn’t compile the 32 bits version yet, it fails to load the VST. But 64 bits works great. In the worse case I keep using the MS compiler for the 32 bits version…

Txs again! Cheers, WilliamK


#9

Another thing, I see that now Projucer makes Visual 2017 create a shared library which VST2 and/or VST3 will use to create the final .dll file. Is there a way to avoid the shared library and create the .dll directly? It seems that the intel compiler is having problems with that part. :frowning: but I could be wrong, still testing this darn thing…

Thanks again.


#10

Ok, reporting my findings. I created a new Projucer file, just in case, added all my Wusik Engine stuff to it. The 64 bits versions of VST and VST3 works great, no errors and run faster. :slight_smile: Now, the 32 bits version of VST works but VST2 doesn’t work. It failed to export the VST3 header, haven’t found out yet on why.

1>------ Build started: Project: Wusik Engine_SharedCode, Configuration: EVE Win32 ------
1>Wusik Engine_SharedCode.vcxproj -> C:\Program Files\Cakewalk\Vstplugins\Shared Code\Wusik EVE V5 32.lib
2>------ Build started: Project: Wusik Engine_VST3, Configuration: EVE Win32 ------
2>   Creating library C:\Program Files\Cakewalk\Vstplugins\VST3\Wusik EVE V5 32.lib and object C:\Program Files\Cakewalk\Vstplugins\VST3\Wusik EVE V5 32.exp
2>Wusik EVE V5 32.exp : : error LNK2001: unresolved external symbol GetPluginFactory
2>C:\Program Files\Cakewalk\Vstplugins\VST3\\Wusik EVE V5 32.vst3 : : error LNK1120: 1 unresolved externals
2>Done building project "Wusik Engine_VST3.vcxproj" -- FAILED.
========== Build: 1 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

On a side note, you guys should really support the Intel Compiler, as it is very good and does produce a faster code, just saying. :wink:

Thanks again for taking a look into this so far.

Cheers, WilliamK


#11

Agh, the 32 bits VST version doesn’t load. I will create a test example again to check if it only happens with my source files…


#12

Ok, a test example works for VST 32 bits, not VST3. But as soon as I add my own files to the mix I get this error, which google shows only 6 results. :-o


#13

You’re missing some intel library runtime for 32 bit. Simply use static linking or make sure it’s installed.


#14

Thanks. :slight_smile: I’m trying to figure out where I set that up. I’m slow, but I will figure it out eventually.


#15

Found some details. :slight_smile:

https://software.intel.com/en-us/articles/libraries-provided-by-intelr-c-compiler-for-windows-and-intel-parallel-composer


#16

No dice. I installed the latest Intel Redistributables for the Intel 2019 compiler, for both 32 and 64 bits versions. Still the same error. I tried to add the libm and libmmt libraries and still the same error. I posted on the intel forum hoping someone there will know what’s going on. For now I will only use the compiler for the 64 bits version.

Thanks for the help so far. :slight_smile:

Cheers, WilliamK


#17

And here are my findings so far… A new code I’m working on, 32 voices with filter and some other things. Values are min and max, mostly flutuating towards max.

58 - 60 - Visual 2017 all opts (whole program opts too)
55 - 56 - Intel 2019 with /Qip				
56 - 57 - Intel 2019 with /Qip /Qftz /Qopt-matmul /Qunroll:9 /Qparallel /Quse-intel-optimized-headers
54 - 55 - /Qipo on the VST and VST3 files --- Intel Math Kernel Library: Use Intel MKL=Sequential --- /Qip /Qftz 
53 - 54 - All the above plus: /Quse-intel-optimized-headers
54 - 55 - All the above plus: IPP multi-threaded static
52 - 53 - Intel Math Kernel Library: Use Intel MKL=Parallel, Use ILP64=Yes --- /Qip /Qftz /Qopt-matmul /Quse-intel-optimized-headers
52 - 53 - Intel Math Kernel Library: Use Intel MKL=Parallel, Use ILP64=Yes --- /Qip /Qftz /Qopt-matmul /Quse-intel-optimized-headers /O3 /Qprec-div- /fp:fast=2 /QxSSE2

#18

Ok, finished testing the Intel Compiler 2019, and it does perform better. The code I’m testing already has a lot of SSE optimizations and intrinscs stuff. (typo?) So it did a good job. But so far only in 64 bits, and I have only tested on Windows. Later on I will test on OSX too, as it does support.

58 - 60 - Visual 2017 all opts (whole program opts too)
55 - 56 - Intel 2019 with /Qip				
56 - 57 - Intel 2019 with /Qip /Qftz /Qopt-matmul /Qunroll:9 /Qparallel /Quse-intel-optimized-headers
54 - 55 - /Qipo on the VST and VST3 files --- Intel Math Kernel Library: Use Intel MKL=Sequential --- /Qip /Qftz 
53 - 54 - All the above plus: /Quse-intel-optimized-headers
54 - 55 - All the above plus: IPP multi-threaded static
52 - 53 - Intel Math Kernel Library: Use Intel MKL=Parallel, Use ILP64=Yes --- /Qip /Qftz /Qopt-matmul /Quse-intel-optimized-headers
52 - 53 - Intel Math Kernel Library: Use Intel MKL=Parallel, Use ILP64=Yes --- /Qip /Qftz /Qopt-matmul /Quse-intel-optimized-headers /O3 /Qprec-div- /fp:fast=2 /QxSSE2
54 - 55 - All above plus /Oi /Ob2 /Ot - INCREASED
52 - 53 (but stays mostly at 52, sometimes even 51) - /Qip /Qftz /Qopt-matmul /Quse-intel-optimized-headers /O3 /Qprec-div- /fp:fast=2 /QxSSE2 /Qinline-factor:800 /Qopt-report:4 /Qopt-report-phase ipo 

Best so far
52 - 53 (but stays mostly at 52, sometimes even 51) - /Qip /Qftz /Qopt-matmul /Quse-intel-optimized-headers /O3 /Qprec-div- /fp:fast=2 /QxSSE2 /Qinline-factor:800 /Qopt-report:4 /Qopt-report-phase ipo 
52 steady - Added to the above /Qparallel replaced /QxSSE2 with /QxSSE3

I have tried /Qipo (multi-files opts) but it took hours to compile and the result was the same as with /Qip (single-file opts)

#19

All tests with just ONE core on an older i5 -2310 2.9Ghz processor.