Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

How to switch to IA-32 compiler in VS2015?

Vadim_K_
Beginner
869 Views

I have recently installed Intel Parallel Studio XE 2017 on Windows 7 64-bit that had Microsoft Visual Studio Professional 2015 (Version 14.0.23107.0 D14REL). It works fine, and I can build Win32 build configuration from legacy projects migrated from Visual Studio 2013. However, despite me using the /Qm32 compiler option, the code appears to be 64-bit. (the size of .exe is about 2 times larger than previous builds) I would like to be able to build 32-bit executables for compatibility with legacy projects.

I checked the build log generated by the compiler, and it confirmed that the compiler binary being used is 64-bit:

1>ClCompile:
         C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\bin\intel64\icl.exe /c /Qm32 ...

How can I use the IA-32 version of the compiler? I mean the one in bin\ia32\icl.exe. I have tried several things like running VS2015 from the 32-bit command shell installed by the Intel Parallel Studio, or setting TARGET_ARCH or C_TARGET_ARCH environment variables to "ia32".

Also, in Visual Studio menu Tools/Options/Intel Compiler and Tools/C++, I changed the Intel C++ Compiler 17.0 Platform toolset to "Intel (R) C++ Compiler 17.0.1.143 [IA-32]". But the entry in the build log still shows the IDE using the 64-bit compiler.

Also, how can I tell from the shell whether the exec is 32- or 64-bit? Is there an analog of file or ldd utilities on Windows?

0 Kudos
8 Replies
JenniferJ
Moderator
869 Views

Did you set the active configuration to "Win32" from menu "Build > Configuration Manager"?

Jennifer

0 Kudos
Vadim_K_
Beginner
869 Views

Yes, this is the very first thing I did. 

Having said that, I suspect there might be a bug in VS2015 that causes not switching the configurations correctly. Before installing Intel Parallel Studio I built some simple C++ projects in VS2015. I noticed that the default configuration Win32 actually built as 64-bit code but it was located under Release/ rather than x64/Release. Adding a new x64 build configuration created 64-bit binaries as expected. After that, switching back to Win32 produced correct 32-bit binaries.

0 Kudos
JenniferJ
Moderator
869 Views

seems not an Intel Compiler's IDE integration issue.

I'd try to upgrade VS2015 to update 3 and see if it fixes it.

Jennifer

0 Kudos
Vadim_K_
Beginner
869 Views

According to our local PC support, the package they installed for me included VS2015 with update 3. Please also see the version number I posted earlier. Does it look like the update 3 is missing?

It would be good to know if there is an option in the project file that controls the bitness of the compiler.

0 Kudos
JenniferJ
Moderator
869 Views

see the screen capture with update3 (Version 14.0.25431.01 Update 3). your version is "Visual Studio Professional 2015 (Version 14.0.23107.0 D14REL)"

Jennifer

0 Kudos
Vadim_K_
Beginner
869 Views

Thanks for pointing this out! I have installed VS2015 SP3, and now it is showing the same version as in your earlier post.

I have also confirmed that the executable the compiler builds in the Win32 configuration is indeed 32-bit. When I run the server process in Windows Explorer it shows as 32-bit image (running on 64-bit OS). However, the size of the executable is much larger than in the earlier versions of the compiler:

VS2013 MS compiler 443,904 bytes

VS2015 MS compiler 881,152 bytes

Intel C++ 2017 1,286,144 bytes

This is why I suspected initially that the image is 64-bit. My code did not change. Why the image is getting so fat? Is there a way to find out why, and slim it down? This is a server process that I would like to be in cache, and have low latency response to network requests.

I would greatly appreciate all comments. Here is the list of options I am using:

===== compiler: =====
/GS- 
/GL 
/analyze- 
/W3 
/Gy 
/Zc:wchar_t 
/Zi 
/Gm- 
/O2 
/Ob2 
/Zc:inline 
/fp:fast 
/errorReport:prompt 
/GF 
/WX- 
/Zc:forScope 
/Gd 
/Oy- 
/Oi 
/MT 
/nologo 
/Ot 
===== linker: ======
/MANIFEST 
/NXCOMPAT 
/DEBUG 
/MACHINE:X86 
/SAFESEH 
/INCREMENTAL:NO 
/SUBSYSTEM:CONSOLE 
/MANIFESTUAC:"level='asInvoker' uiAccess='false'" 
/ManifestFile:".\Release\server.exe.intermediate.manifest" 
/ERRORREPORT:PROMPT 
/NOLOGO 
/TLBID:1 

 

 

0 Kudos
JenniferJ
Moderator
869 Views

if you remove /GL and /Zi, does it help?

Jennifer

0 Kudos
Vadim_K_
Beginner
869 Views

Hi Jennifer,

Thanks for the suggestion, indeed removing both options slimmed down the .exe to 592k.

I also tried a few other options but those did not affect the size of the image in any significant way. Microarchitecture optimization does make it slightly bigger but this is to be expected, and is well worth it :-)

0 Kudos
Reply