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

The newest compiler still fail in compiling stringstream

Shi_J_
Beginner
2,035 Views
#include<sstream>
int main()
{
	std::stringstream ss("");
	double doub;
	ss << 3213.0;
	ss >> doub;      // comment it then compile successfully
	return 0;
}

In Debug mode, it compiles successfully, but fails in Release mode.

I don't know how to solve this problem. if you know please show me, thank you.

0 Kudos
1 Solution
Shenghong_G_Intel
2,035 Views

If command line works, it is an issue of VS integration. Do you have old version of compiler integrated into Visual Studio? To get the version of compiler used in your current project, check as below:

1. In Visual Studio, Project -> Properties -> Configuration Properties -> General, check the value of "Platform Toolset", it should be "Intel C++ Compiler 16.0".

2. Check detailed version of the compiler if #1 is correct, go to "Project -> Properties -> Configuration Properties -> C/C++ -> General", set "Suppress Startup Banner" to "No" and rebuild your project, in the output window, it will show the detailed command line and compiler version information.

Attached some screenshots for reference.

Thanks,

Shenghong

 

View solution in original post

0 Kudos
16 Replies
Kittur_G_Intel
Employee
2,035 Views

Hi Shi,
I don't see any issues and it compiles fine (below) in debug and release modes (tried with the latest compiler release 16.0)

%icpc -V
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.0.109 Build 20150815
%cat t1.cpp
#include<sstream>
#include<iostream>
int main()
{
    std::stringstream ss;
    double doub;
    ss << 3213.0;
    ss >> doub;      // comment it then compile successfully
    std::cout << "doub: " << doub << std::endl;
    return 0;
}
%  icpc t1.cpp -o t1
% ./t1
doub: 3213

Works fine with -g as well. I tried on RHEL 6. Let me know on what system you're compiling and the OS/GCC version etc. as well?

_Kittur

 

 

 

0 Kudos
Shenghong_G_Intel
2,035 Views

Hi Shi (and Kittur),

Is it again same with below issue?

https://software.intel.com/en-us/forums/intel-c-compiler/topic/598026

https://software.intel.com/en-us/forums/intel-c-compiler/topic/565207

Which is only for VS2015 on Windows? Please try with /MT and it should work.

Thanks,

Shenghong

0 Kudos
Shenghong_G_Intel
2,035 Views

I've reproduced it on windows VS2015 environment, and confirmed the issue fixed with mainline compiler. Please expect the fix in the coming update 1 version. I've also compiled all the 3 test cases (though they are almost same) and confirmed all are working now.

Thanks,

Shenghong

0 Kudos
Shenghong_G_Intel
2,035 Views

Hi Shi,

Hmm, ignore my last reply about "coming update 1 version", as update 1 is in fact already released on about yesterday! Please upgrade to update 1 and verify it.

Thanks,

Shenghong

0 Kudos
Kittur_G_Intel
Employee
2,035 Views

Yes, thanks Shenghong it's the same issue and Update 1 is released and contains the fix.

_Kittur

0 Kudos
Shi_J_
Beginner
2,035 Views

shenghong-geng (Intel) wrote:

Hi Shi,

Hmm, ignore my last reply about "coming update 1 version", as update 1 is in fact already released on about yesterday! Please upgrade to update 1 and verify it.

Thanks,

Shenghong

Hi Shenghong

Thank you for your reply, In fact, I tried the above example after updating my intel C++ compiler to 2016 Update 1, and I had read the articles that produce the problem, so I tried the example just after updating.

This is my platform information,  Visual Studio 2015 community version on windows 10 64bit, with Intel C++ compiler 2016 Update 1. 

Shi

0 Kudos
Kittur_G_Intel
Employee
2,035 Views

@Shi: I could compile on the systems I've (2015 VS) with update 1. I don't have a system with community edition to test it out but I guess when you install the Visual Studio Community 2015 edition you will need to explicitly check the box for installing c++ as it probably doesn't install C++ by default so make sure to select c++ under programming languages may be? Just a guess...

_Kittur 

0 Kudos
Kittur_G_Intel
Employee
2,035 Views

@Shi, can you verify and confirm as it looks like that's the issue? Thanks.

_Kittur 

0 Kudos
TimP
Honored Contributor III
2,035 Views

It appears to work fine with ICL 16.0.1 and VS2015 Community on Windows 10.

There have been several mutually incompatible versions of VS2015 Community.  In order to install the current one successfully, I removed the earlier one, both in add/remove programs and by then deleting the VS2015 and windows kits\10\ folders.  Then I had to run the Microsoft sdksetup which installs a more recent and complete version of windows kits\10\ than the one which comes with even current VS2015.  If VS2015 is installed with the older sdk, it can be switched to the newer one by a repair.  All of this may easily take 12 hours.

Further, I set

-Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\AMD64"
to make certain that the VS2015 link.exe is used.  This would not be necessary if no linker other than VS2015 is present.  This setting works in the VS2012 and VS2013 environments as well, although Microsoft recommended once that you don't have earlier VS present alongside VS2015.

I didn't install this Windows 10 until after Intel psxe 16.0.1 was released with apparent full support for it.  If you have a very old Windows 10 which no longer updates to current version, you will need to perform the complete install the same as for an earlier Windows.

If this sounds painful, it was.  I couldn't find complete advice on this subject, other than partial confirmation that Intel tests only VS installations made on clean systems (not upgraded in place).  By contrast, VS2013 seems to have always upgraded gracefully, so if you don't need the degree of C99 and C++14 support present in VS2015 (neither complete), VS2013 is a smoother path. With your project switched to ICL, you don't care whether Microsoft supports most of C99.

0 Kudos
Kittur_G_Intel
Employee
2,035 Views

Thanks Tim, I agree it does work fine with update 1 and thanks for the detailed info on your update on this.

_Kittur

0 Kudos
Shi_J_
Beginner
2,035 Views

Kittur Ganesh (Intel) wrote:

@Shi, can you verify and confirm as it looks like that's the issue? Thanks.

_Kittur 

Thanks _Kittur

I have tried /MT option as @Shenghong mentioned, it works. but still failed in /MD mode.

My Windows platform: Intel® Parallel Studio XE 2016 Update 1 Composer Edition for C++ Windows* Integration for Microsoft* Visual Studio* 2015, Version 16.0.98.14.

0 Kudos
Kittur_G_Intel
Employee
2,035 Views

Hi Shi,
I am not able to reproduce the issue that you're seeing. I wonder if there's any environment issue on your end or if the upgrade went smoothly or an integration issue with VS that Tim pointed out?

If you still have issues, can you try to use the command line and also give  the following info?

1) Generate the preprocessed file (.I file) using the /P option and attach the preprocessed file to this issue.
2) Compile using the command line (let me know what the command line is)
3) Give the output of icl and cl versions?   %icl /V  should give the icl version etc.

I can then try to locate a system with exact configuration and try out to see if I can reproduce, thanks.

_Kittur
 

0 Kudos
Shi_J_
Beginner
2,035 Views

Kittur Ganesh (Intel) wrote:

Hi Shi,
I am not able to reproduce the issue that you're seeing. I wonder if there's any environment issue on your end or if the upgrade went smoothly or an integration issue with VS that Tim pointed out?

If you still have issues, can you try to use the command line and also give  the following info?

1) Generate the preprocessed file (.I file) using the /P option and attach the preprocessed file to this issue.
2) Compile using the command line (let me know what the command line is)
3) Give the output of icl and cl versions?   %icl /V  should give the icl version etc.

I can then try to locate a system with exact configuration and try out to see if I can reproduce, thanks.

_Kittur
 

Hi _Kittur,

Thank you, today I chose command line to test if it works, It works fine, even in the mode of /MD /Qipo

this is the command line result,

D:\Desktop\testIntel>icl /MD /Qipo Project1.cpp

Intel(R) C++ Intel(R) 64 Compiler for applications running on IA-32, Version 16.0.1.146 Build 20151021
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

Project1.cpp
Microsoft (R) Incremental Linker Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:Project1.exe
C:\Users\Jiabei\AppData\Local\Temp\ipo_800011.obj

So, is the problem in Visual Studio or in  integrating intel C++ into Visual Studio ?

I copied the whole command line in Release mode of Visual Studio that reproduce the issue,

in C/C++ option

/GS /W3 /Zc:wchar_t /Zi /O2 /Fd"Release\vc140.pdb" /D "_MBCS" /Qstd=c++11 /Qipo /Zc:forScope /Gd /Oi /MD /Fa"Release\" /EHsc /nologo /Fo"Release\" /Qprof-dir "Release\" /Fp"Release\Project1.pch" 

in Linker option

/OUT:"D:\Documents\Visual Studio 2015\Projects\C++\Project1\Release\Project1.exe" /MANIFEST /NXCOMPAT /PDB:"D:\Documents\Visual Studio 2015\Projects\C++\Project1\Release\Project1.pdb" /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MACHINE:X86 /OPT:REF /SAFESEH /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Release\Project1.exe.intermediate.manifest" /OPT:ICF /NOLOGO /TLBID:1 

I also tried to test the different options between Debug and Release, and I got nothing.

0 Kudos
Shenghong_G_Intel
2,036 Views

If command line works, it is an issue of VS integration. Do you have old version of compiler integrated into Visual Studio? To get the version of compiler used in your current project, check as below:

1. In Visual Studio, Project -> Properties -> Configuration Properties -> General, check the value of "Platform Toolset", it should be "Intel C++ Compiler 16.0".

2. Check detailed version of the compiler if #1 is correct, go to "Project -> Properties -> Configuration Properties -> C/C++ -> General", set "Suppress Startup Banner" to "No" and rebuild your project, in the output window, it will show the detailed command line and compiler version information.

Attached some screenshots for reference.

Thanks,

Shenghong

 

0 Kudos
Shi_J_
Beginner
2,035 Views

Hi @Shenghong @_Kittur @Tim Prince

It is very kind of you, and I appreciate it.

the problem is the Integration issue.  I uninstalled all the components of Intel Parallel Studio XE 2016, and reinstalled the components I need. then update to Update 1. and it works !

I ‘m curious about how the Integration issue happened, never mind, may be some problem about OS.

Thanks again.

 

0 Kudos
Kittur_G_Intel
Employee
2,035 Views

@Shi:  Great, that's what Shenghong and I had concluded on this offline if the command line worked and it's good to know that was the issue. The integration issue was a result of configuration tied to older compiler and not having updated during newer install as well.

_Kittur

0 Kudos
Reply