Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all 2797 articles
Browse latest View live

corrupted vptr with icc 16.0

$
0
0

Hello,

I am using icpc/icc/ifort 16.0 to compile a C++/C/Fortran application (about 500 kSLOC) on a Linux machine, with the default optimization level (-O2). I am running into a crash that I have trouble explaining.

I have a class C that is part of an inheritance chain (say C -> B -> A); the base classes have some virtual methods and a virtual destructor. At some point during the execution of the code, an object of class C is instantiated for the first time:

C *c = new C(/*some parameters*/);

The constructor invokes some virtual methods of C and the code segfaults. The reason seems to be that the vtables are full of garbage, as shown by the following excerpt from my gdb session:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) up
#1  0x00000000006c49b0 in C::method (this=0x21ccde0, foo=42)
(gdb) info vtbl this
warning: can't find linker symbol for virtual table for `C' value
warning:   found `C::_ZTV1C(void)' instead
vtable for 'C' @ 0x12efa38 (subobject @ 0x21ccde0):
[0]: 0x6c0c68 <C::method2()>
[1]: 0x6c0cf8 <C::method3()>
[2]: 0x0
[3]: 0x0
[4]: 0x0
[5]: 0x0
[6]: 0x0
[7]: 0x0
[8]: 0x0
[9]: 0x0
[10]: 0x0
[11]: 0x0
[12]: 0x0
[13]: 0x0
[14]: 0x0
[15]: 0x0
[16]: 0x0
[17]: 0x0
[18]: 0x0
[19]: 0x0
[20]: 0x0
[21]: 0x0
[22]: 0x0
[23]: 0x0
[24]: 0x0
[25]: 0x0
[26]: 0x0
[27]: 0x0
[28]: 0x0
[29]: 0x0
[30]: 0x0
[31]: 0x0
[32]: 0x0
[33]: 0x0
[34]: 0x0
[35]: 0x0
[36]: 0x0
[37]: 0x0
[38]: 0x0
[39]: 0x0
[40]: 0x0
[41]: 0x0
[42]: 0x0
[43]: 0x0
[44]: 0x0
[45]: 0x0
[46]: 0x0
[47]: 0x0
[48]: 0x0
[49]: 0x0
[50]: 0x0
[51]: 0x6c36fa <C::method4()>
[52]: 0x6c3a26 <C::method5()>
[53]: 0x6c41d6 <C::method5()>

vtable for 'A' @ 0x12efe78 (subobject @ 0x21ccfd8):
[0]: 0x0
[1]: 0x0
[2]: 0x0
[3]: 0x0
[4]: 0x0
[5]: 0x0

I can confirm that the vptr values are wrong by inspecting the output of `nm -C`. For what it's worth, the vptr for C is off by only 136 bytes (should be 0x12eff00); the vptr for A is way off.

The same source code runs without a hitch when compiled with icpc/icc/ifort v15.1, icpc/icc/ifort v16.4 and several versions of the GNU suite.

Does this ring a bell for anyone? Perhaps it is a known bug of Intel compilers around v16.0? (Yes, I am aware of the First Rule of Programming). Otherwise, I am at a loss about how I should debug this. I cannot exclude that some of my application code is somehow corrupting the memory, although I ran it under valgrind and no invalid memory access were detected.

I am painfully trying to disassemble the code between the call to operator new() and the call to the constructor, hoping to spot the place where the vptr is incorrectly initialized. Do you have any simpler suggestions for debugging this?

Thank you for reading!

Davide


WIN64: 'unresolved external symbol __fastfail referenced in function' error for Debug Qt builds using Windows ICC

$
0
0

Hello, everyone,

For Qt builds using Windows ICC got error:

        if not exist ..\..\lib\Qt5Cored.dll if exist ..\..\lib\Qt5Cored.dll.embed.manifest del ..\..\lib\Qt5Cored.dll.embed.manifest
        if exist ..\..\lib\Qt5Cored.dll.embed.manifest copy /Y ..\..\lib\Qt5Cored.dll.embed.manifest ..\..\lib\Qt5Cored.dll_manifest.bak
        xilink /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /SUBSYSTEM:WINDOWS /VERSION:5.12 /MANIFEST /MANIFESTFILE:..\..\lib\Qt5Cored.dll.embed.manifest /OUT:..\..\lib\Qt5Cored.dll @C:\Users\test\AppData\Local\Temp\Qt5Cored.dll.4736.250.jom
   Creating library ..\..\lib\Qt5Cored.lib and object ..\..\lib\Qt5Cored.exp
qlogging.obj : error LNK2019: unresolved external symbol __fastfail referenced in function "void __cdecl qt_message_fatal(enum QtMsgType,class QMessageLogContext const &,class QString const &)" (?qt_message_fatal@@YAXW4QtMsgType@@AEBVQMessageLogContext@@AEBVQString@@@Z)
..\..\lib\Qt5Cored.dll : fatal error LNK1120: 1 unresolved externals
jom: C:\libQT-5.12-dev\build\qtbase\src\corelib\Makefile.Debug [..\..\lib\Qt5Cored.dll] Error 1120
jom: C:\libQT-5.12-dev\build\qtbase\src\corelib\Makefile [debug] Error 2
jom: C:\libQT-5.12-dev\build\qtbase\src\Makefile [sub-corelib-make_first] Error 2
jom: C:\libQT-5.12-dev\build\qtbase\Makefile [sub-src-make_first] Error 2
jom: C:\libQT-5.12-dev\build\Makefile [module-qtbase-make_first] Error 2

which relate to recently merged Change #225048.

Reproduced for:

  • builds using Windows ICC with Debug configuration,

not reproduced for:

  • builds using Windows ICC with Release configuration,
  • builds using mingw-w64 and MSVC.

Environment:

It was reported on Qt bugtracker (see QTBUG-68751), and Qt Developers believe it's a compiler bug.

 

Best,

Alexander

 

WIN64: 'field_at_offset: field not found ... _Getimpl()->_Delete_this(!_Local())' error for QtCreator builds using Windows ICC

$
0
0

Hello, everyone,

For QtCreator builds using Windows ICC got error:

        cd help\ && ( if not exist Makefile C:\libQT-5.12-dev\ICC64RH\bin\qmake.exe -o Makefile C:\QTCREATOR-4.8.0-dev\build\src\plugins\help\help.pro "CONFIG-=precompile_header""QTC_PREFIX=C:\QTCREATOR-4.8.0-dev\build\..\ICC64RH" ) && C:\Windows\jom.exe -f Makefile
        C:\Windows\jom.exe -f Makefile.Release
        icl -c -nologo -Zc:wchar_t -Qprec -Zm200 -Zc:forScope -O2 -MD -W3 -Qdiag-disable:673,809,1738,1744,3373 -w44996 -EHsc -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -D"RELATIVE_PLUGIN_PATH=\"../lib/qtcreator/plugins\"" -D"RELATIVE_LIBEXEC_PATH=\".\"" -D"RELATIVE_DATA_PATH=\"../share/qtcreator\"" -D"RELATIVE_DOC_PATH=\"../share/doc/qtcreator\"" -DIDE_LIBRARY_BASENAME=\"lib\" -DQT_CREATOR -DQT_NO_CAST_TO_ASCII -DQT_RESTRICTED_CAST_FROM_ASCII -DQT_DISABLE_DEPRECATED_BEFORE=0x050600 -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -D_CRT_SECURE_NO_WARNINGS -DQT_CLUCENE_SUPPORT -DHELP_LIBRARY -DQT_NO_DEBUG -DQT_FORCE_ASSERTS -DQT_PLUGIN -DQT_HELP_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DNDEBUG -D_WINDLL -I. -I..\..\..\src -I..\..\..\src -I..\..\libs -IC:/QTCREATOR-4.8.0-dev/build/tools -I..\..\plugins -I..\..\libs -I. -I..\..\shared\help -I..\..\shared -IC:\libQT-5.12-dev\ICC64RH\include -IC:\libQT-5.12-dev\ICC64RH\include\QtHelp -IC:\libQT-5.12-dev\ICC64RH\include\QtPrintSupport -IC:\libQT-5.12-dev\ICC64RH\include\QtWidgets -IC:\libQT-5.12-dev\ICC64RH\include\QtGui -IC:\libQT-5.12-dev\ICC64RH\include\QtANGLE -IC:\libQT-5.12-dev\ICC64RH\include\QtSql -IC:\libQT-5.12-dev\ICC64RH\include\QtNetwork -IC:\libQT-5.12-dev\ICC64RH\include\QtConcurrent -IC:\libQT-5.12-dev\ICC64RH\include\QtCore -Irelease -I. -I"C:\Program Files (x86)\VulkanSDK\include" -IC:\libQT-5.12-dev\ICC64RH\mkspecs\win32-icc -Forelease\ @C:\Users\test\AppData\Local\Temp\searchwidget.obj.2016.47.jom
searchwidget.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\include\functional(1390): internal error: field_at_offset: field not found
                        _Getimpl()->_Delete_this(!_Local());
                        ^

jom: C:\QTCREATOR-4.8.0-dev\build\src\plugins\help\Makefile.Release [release\searchwidget.obj] Error 4
jom: C:\QTCREATOR-4.8.0-dev\build\src\plugins\help\Makefile [release] Error 2
jom: C:\QTCREATOR-4.8.0-dev\build\src\plugins\Makefile [sub-help-make_first] Error 2
jom: C:\QTCREATOR-4.8.0-dev\build\src\Makefile [sub-plugins-make_first-ordered] Error 2
jom: C:\QTCREATOR-4.8.0-dev\build\Makefile [sub-src-make_first-ordered] Error 2

A test case to reproduce error added in attachment.

Reproduced for:

  • builds using Windows ICC,

not reproduced for:

  • builds using mingw-w64 and MSVC.

Environment:

Qt Developers believe it's a compiler bug.

 

Best,

Alexander

 

SVML Visual Studio 2013 Windows how to immintrin.h

$
0
0

Hello,

I have switched recently to Intel Compiler, but this is under Visual Studion 2013(the one that Parallel Studion installs with embedded options).

I cannot figure out how to use the SVML in that environment.

It is said in the manual, that SVML is supported already in immintrin.h, but those are not available there.

Do I need to add something or replace the header with somethign else.

 

Even more simple question:

what I need to do, to call SVML operators for my working environment:

Windows 7,

Visual Studio 2013,

ICC,Parallel Studio installed

BR,

Mihail
 

In matlab; Error using mex LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'

$
0
0

Hello everyone

In Matlab2015a, When i use "mex -output" command with some parameter, i get this error:

Building with 'Microsoft Visual C++ 2013 Professional'. Error using mex LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'

I khow that this error is related with "Intel Composer XE 2013", but i dont khow how can i solve it. there is some 'ifconsol.lib' in installed "Intel Composer XE 2013" folders in program files. I use "Intel Composer XE 2013" on Windows 10 64bit.

Thanks. 

No longer able to compile w/GNU python

$
0
0

I'm using:

OS:  Linux 4.16.14-300.fc28.x86_64 #1 SMP Tue Jun 5 16:23:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux (Fedora 28)

Python: Python 2.7.15 (default, May 16 2018, 17:50:09)
[GCC 8.1.1 20180502 (Red Hat 8.1.1-1)] on linux2

icc: Intel(R) C Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.3.222 Build 20180410

Not so long ago, I was perfectly able to compile C functions which called python modules, using GNU python.  Here's an example:

#include <Python.h>
#include <complex.h>

double complex c2f1_mpmath_cp_ca(double complex a1, double complex a2, double complex b1, double complex z)
{
/* local variables declarations */
   int npars= 4;
   double complex result;
   PyObject *pName, *pModule, *pFunc, *pArgs, *pValue;
   PyObject *pa1, *pa2, *pb1, *pz;
   Py_complex res_pc;

   if(! Py_IsInitialized()) Py_Initialize();
   pa1= PyComplex_FromDoubles(creal(a1),cimag(a1)); 
   pa2= PyComplex_FromDoubles(creal(a2),cimag(a2));
   pb1= PyComplex_FromDoubles(creal(b1),cimag(b1));
   pz=  PyComplex_FromDoubles(creal(z),cimag(z));

   pName = PyString_FromString("mpmath");
   pModule = PyImport_Import(pName);
   pFunc = PyObject_GetAttrString(pModule, "hyp2f1");
   pArgs = PyTuple_Pack(npars, pa1, pa2, pb1, pz);
   pValue = PyObject_CallObject(pFunc, pArgs);
   res_pc= PyComplex_AsCComplex(pValue);
   result= res_pc.real + res_pc.imag*I;
   return result;
}

Now, all of a sudden, a lot of errors appear.  Any idea what could be causing the errors below?

~>icc -c -I/usr/include/python2.7 c2f1_mpmath_cp_ca.c 
In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(140): error: identifier "_Float32" is undefined
  extern _Float32 strtof32 (const char *__restrict __nptr,
         ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(146): error: identifier "_Float64" is undefined
  extern _Float64 strtof64 (const char *__restrict __nptr,
         ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(158): error: identifier "_Float32x" is undefined
  extern _Float32x strtof32x (const char *__restrict __nptr,
         ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(164): error: identifier "_Float64x" is undefined
  extern _Float64x strtof64x (const char *__restrict __nptr,
         ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(233): error: identifier "_Float32" is undefined
                       _Float32 __f)
                       ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(239): error: identifier "_Float64" is undefined
                       _Float64 __f)
                       ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(251): error: identifier "_Float32x" is undefined
                        _Float32x __f)
                        ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(257): error: identifier "_Float64x" is undefined
                        _Float64x __f)
                        ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(316): error: identifier "_Float32" is undefined
  extern _Float32 strtof32_l (const char *__restrict __nptr,
         ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(323): error: identifier "_Float64" is undefined
  extern _Float64 strtof64_l (const char *__restrict __nptr,
         ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(337): error: identifier "_Float32x" is undefined
  extern _Float32x strtof32x_l (const char *__restrict __nptr,
         ^

In file included from /usr/include/python2.7/Python.h(42),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/stdlib.h(344): error: identifier "_Float64x" is undefined
  extern _Float64x strtof64x_l (const char *__restrict __nptr,
         ^

In file included from /usr/include/math.h(389),
                 from /usr/local/intel/compilers_and_libraries_2018.3.222/linux/compiler/include/math.h(173),
                 from /usr/include/python2.7/pyport.h(325),
                 from /usr/include/python2.7/Python.h(61),
                 from c2f1_mpmath_cp_ca.c(1):
/usr/include/bits/mathcalls.h(53): error: identifier "_Float32" is undefined
  __MATHCALL (acos,, (_Mdouble_ __x));

 

 

 

Intel Parallel Studio XE 2019 Beta Update has been released

$
0
0

Visit https://software.intel.com/en-us/articles/intel-parallel-studio-xe-2019-beta for more information and to register for the Intel® Parallel Studio XE 2019 Beta

Overview:

  • Improvements to integration with Microsoft Visual Studio* 2017.
  • Added support for exclusive scan SIMD and user defined induction for OpenMP* parallel pragmas in the Intel® C/C++ Compiler.
  • Switched to libfabric-1.6.1 delivered with the Intel® MPI Library package.
  • Bug fixes, including resolving a glibc issue on Ubuntu 18.04

Suppressing messages

$
0
0

I am getting a lot of messages like this during compilation:

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\pstl\include\pstl/execution:96: [Parallel STL message]: "The <Parallel STL> execution policies are defined in the namespace pstl::execution"

How can I suppress these as hundreds are appearing?

It doesn't seem to be susceptible to /Qdiag-disable:96 as a compiler option.

I am using Intel Parallel Studio XE 2018 Update 3 in VS 2017.

Thanks


Quadruple precision float support on icc 18 update 3

$
0
0

Hi, All. I just tried to compile a C++ program with _Quad keyword in Visual Studio 2017 using ICC 18 update 3. I added "/Qoption,cpp,--extended_float_type" to project additional compiler options. However, ICC emit "E0020: identifier "_Quad" is undefined" error message. I searched ICC 18 Developer Guide and Reference relating to quadruple precision float topic and couldn't find anything. Is "_Quad" keyword still supported in ICC 18, or I made a mistake in compiler options? Appreciate for assistance.

 

Ignore #include GCC directive on C++ code with GCC-4.5

$
0
0

I have a compilation issue with "GCC diagnostic push" on gcc-4.5

How can I make it work to ignore compilation flags on #include directives on gcc-4.5, like it is done on further gcc versions with push/pop?
This is how I done it in gcc-4.8.1:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wextra"
#include"dependency_header.h"
#pragma GCC diagnostic pop

Type Deduction Failure - Possible Bug

$
0
0

Hello,

I have found a possible type-deduction bug, reproducible in Intel 18.0.1, 18.0.2, and 19.0.0.046. Here is a small code snippet demonstrating the issue:

https://gist.github.com/abrooks98/020b3a499e2dbedd0c7cc81e50982152

#include <vector>
#include <utility>
#include <stdio.h>

template<typename T>
class myvector : public std::vector<T> {};

template<typename T>
struct check_for
{
  template<typename U>
  static constexpr bool _data(U*, decltype(std::declval<U>().data())* = nullptr) { return true; }
  template<typename U>
  static constexpr bool _data(...) { return false; }

  template<typename U>
  static constexpr bool _get_allocator(U*, decltype(std::declval<U>().get_allocator())* = nullptr) { return true; }
  template<typename U>
  static constexpr bool _get_allocator(...) { return false; }

  static constexpr bool data = _data<T>(nullptr);
  static constexpr bool get_allocator = _get_allocator<T>(nullptr);
};

int main(int argc, char** argv)
{
  printf("Check type 'bool'             for function 'data': %d\n", check_for<bool>::data);
  printf("Check type 'std::vector<int>' for function 'data': %d\n", check_for<std::vector<int>>::data);
  printf("Check type 'myvector<int>'    for function 'data': %d\n", check_for<myvector<int>>::data);

  printf("Check type 'bool'             for function 'get_allocator': %d\n", check_for<bool>::get_allocator);
  printf("Check type 'std::vector<int>' for function 'get_allocator': %d\n", check_for<std::vector<int>>::get_allocator);
  printf("Check type 'myvector<int>'    for function 'get_allocator': %d\n", check_for<myvector<int>>::get_allocator);

  decltype(std::declval<std::vector<int>>().get_allocator()) a;

  int* b = a.allocate(10);
  printf("%p\n", b);
  a.deallocate(b, 10);

  return 0;
}

The issue is that check_for<std::vector<int>>::get_allocator should return true, but it does not. The type-deduction does work for some functions, however. For example, check_for<std::vector<int>>::data returns true. This issue is not present in GCC (tested with 4.9.3 and 7.1.0) or Clang (tested with 3.9.0 and 4.0.0)

Intel C++ Composer XE 2011

$
0
0

Hi, recently for my academic research, I have been working on a MATLAB toolbox whose C++ source code can be compiled by Intel C++ compiler.

Since this toolbox is known to be compatible with MATLAB R2012b, and the Intel C++ compiler which is compatible with such version of MATLAB is the one with Intel C++ Composer XE 2011 (Reference Link: https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/suppor...). And my research computer is running Window 7 64-bit.

I have inspect the compiling script of this MATLAB toolbox. It involves the paths as below:

        path_to_compiler_libraries='C:\Program Files (x86)\Intel\Composer XE\compiler\lib\intel64\';
        path_to_compiler='C:\Program Files (x86)\Intel\Composer XE\bin\intel64\';
        path_to_compiler_include='C:\Program Files (x86)\Intel\Composer XE\compiler\include\';
        path_to_vs='C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\';

Therefore, I am looking for download of Intel C++ Composer XE 2011. However, it seems the official site does not provide this old version anymore. Today I have and only able to register for Intel Studio XE 2018. I may try to install XE 2018 to see if it is compatible with MATLAB R2012b and the mentioned toolbox but it is not guaranteed. So at this moment, I want to first confirm if there is any available download for XE 2011.

Does anyone have any idea? Thanks very much for your help.

ICC compiler bug building Python sha3

$
0
0

Hi,

When trying to build Python 3.6.3 (and 3.6.4) using icc 2018.1 and .2 the compiler segfaults.

It is essentially a problem with icc blowing up with a very long line of code generated by a macro.

building '_sha3' extension
icc -pthread -fPIC -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3
-Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-parameter
-Wno-missing-field-initializers -fp-model strict -I./Include -I.
-I/usr/local/include
-I/derp/Python-3.6.4/Include
-I/derp/Python-3.6.4 -c
/derp/Python-3.6.4/Modules/_sha3/
sha3module.c -o
build/temp.linux-x86_64-3.6/derp/Python-3.6.4/Modules/_sha3/sha3module.o
": internal error: ** The compiler has encountered an unexpected problem.
** Segmentation violation signal raised. **
Access violation or stack overflow. Please contact Intel Support for assistance.

Full details of the problem are here: https://bugs.python.org/issue33174

My hacky solution to get it to build was to expand the macro into multiple lines, but even then it will only build with "-O0".

Intel Compiler option does not appear under Project Menu

$
0
0

Friends:

I originally had installed Intel Fortran Studio 2017 on Visual Studio 2013. When we received the 2018 update, I installed VS 2017 Pro and installed the Intel 2018 update which asked me which VS version to integrate. I chose VS 2017. I did not delete or uninstall VS 2013 which was integrated with the Intel 2017 compilers. Everything seems to work fine with the Fortran compiler.

I decide to add a C++ procedure. I started a C++ project with a simple Hello world with Visual C++. However, I want to use Intel C++ compiler. I cannot find a way to switch to Intel C++ compiler. Contrary to the instructions in the reference manual, I do not have an "Intel Compiler" entry under the Project menu or anywhere else in VS 2017.

I checked installation using the instructions given under "troubleshooting-fortran-integration-issues". I seemed to have all the right files in the right places.

Any help would be appreciated.

I. Konuk

 

 

[Bug report] Spurious #2651 warning for deprecating a "using" alias.

$
0
0

Dear all,

trying to deprecate a "using" alias as in

 using foo [[deprecated]] = int;
 
 int main()
 {
   foo f = 1;
 };

gives me

test-deprecate.cc(1): warning #2651: attribute does not apply to any entity
  using foo [[deprecated]] = int;
              ^

test-deprecate.cc(5): warning #1478: type "foo" (declared at line 1) was declared deprecated
    foo f = 1;
        ^

using ICC16, ICC17, ICC18 and ICC19. The deprecation is correctly detected by warning #1478 so #2651 is spurious here.

Best,

Daniel


using std::any, compiler options /std:c++17, /Qstd=c++17 not compatible

$
0
0

Hello,

I have tried to use std::any class, but I cannot enable C++17 support for Intel Compiler.

If I use it with VC++ I have to enable Language->C++ Language Standard->ISO C++17 Standard (/std:c++17) then it works fine.

If I use Intel with this option it says: class any is only available with C++17:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\any(14): error : #error directive: class any is only available with C++17.

if !_HAS_CXX17
 #error class any is only available with C++17.
#endif /* _HAS_CXX17 */

If I enable C++17 on C++->Language[Intel C++]-> C/C++ Language support->C++17 Support (/Qstd=c++17)

then I become error: icl: : error : '/Qstd:<arg>' conflicts with '/std:<arg>'

Command line:

/permissive- /Yu"stdafx.h" /GS /W3 /Zc:wchar_t /ZI /Od /Fd"Debug\vc141.pdb" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Zc:forScope /RTC1 /Gd /MDd /std:c++17 /FC /Fa"Debug\" /EHsc /nologo /Fo"Debug\" /Qstd=c++17 /Qprof-dir "Debug\" /Fp"Debug\anyintel.pch"

 

OpenMP Crash at -O0 but not at -O2 when using threadprivate class instance with virtual functions

$
0
0

Hello,

The following code:

#include <iostream>
#include <omp.h>

class Base {
public:
  int memb_base;
  virtual int foo() { return 0; }
};

class Derived : public Base {
public:
  int memb_derived;
  virtual int foo() { return 1; }
};

class Container {
public:
  Derived* Get_d() { return &_d; }
  void print() {
    #pragma omp critical
    {
      Derived* p = Get_d();
      int* vtable =  *(int**)p;
      std::cout << "thread id "<< omp_get_thread_num() << std::endl;
      std::cout << "Get_d() = "<< p << " vtable = "<< std::hex << vtable <<  std::endl;
      std::cout << "foo: "<< p->foo() << std::endl;
    }
  }

private:
  static Derived _d;
#pragma omp threadprivate(_d)
};

Derived Container::_d;

int main() {
  Container cont;

#pragma omp parallel for
  for (int i = 0; i < omp_get_num_threads(); ++i)
    cont.print();

  return 0;
}

crashes when compiled as such:

icpc -v
icpc version 18.0.3 (gcc version 6.4.1 compatibility)
icpc -qopenmp -g -O0 crash.C -o crash

using Intel Compiler 2018 Update 3 (GCC 6.4 backend):

OMP_NUM_THREADS=2 ./crash

thread id 0
Get_d() = 0x603710 vtable = 0x6035a8
foo: 1
thread id 1
Get_d() = 0x14e4b1afbf00 vtable = 0
zsh: segmentation fault (core dumped)  OMP_NUM_THREADS=2 ./crash

The same code runs fine when compiled with -O2. The reason is that the threadprivate instance of _d on threads other than the main thread are not correctly initialized, the vtable ptr is 0x0 when compiled at -O0. This causes a crash when the program tries to add the offset of the virtual function foo to the start of the vtable, in order to invoke it. This is the corresponding piece of assembly:
 

(gdb) bt
#0  0x0000000000401966 in Container::print (this=0x7fffffffaea0) at crash.C:26
#1  0x00000000004014c2 in L_main_40__par_region0_2_2 () at crash.C:42
#2  0x00007ffff73c27d3 in __kmp_invoke_microtask () from /opt/intel/lib/libiomp5.so
#3  0x00007ffff738954a in ?? () from /opt/intel/lib/libiomp5.so
#4  0x00007ffff7388c0b in ?? () from /opt/intel/lib/libiomp5.so
#5  0x00007ffff73c2c30 in ?? () from /opt/intel/lib/libiomp5.so
#6  0x00007ffff6eb0075 in start_thread () from /usr/lib/libpthread.so.0
#7  0x00007ffff6be553f in clone () from /usr/lib/libc.so.6
(gdb) disassemble

...

  0x0000000000401957 <+371>:   mov    $0x0,%edx 
  0x000000000040195c <+376>:   movslq %edx,%rdx
  0x000000000040195f <+379>:   imul   $0x8,%rdx,%rdx (offset of function foo is stored in rdx)
  0x0000000000401963 <+383>:   add    (%rax),%rdx    (add vtable which is (%rax) to offset)
=> 0x0000000000401966 <+386>:   mov    (%rdx),%rax   (load (%rdx), causes segfault)

%rax contains the pointer to _d, (%rax) dereferences it in order to obtain the address of the vtable, $rdx is the offset of foo. Since (%rax) is 0 the last line is trying to access an invalid address which causes a segmentation violation.

WIN64: incomplete support of attributes for enumerators in Windows ICC

$
0
0

Hello, everyone,

For Qt builds using Windows ICC got error:

        cd corelib\ && ( if not exist Makefile C:\libQT-5.12-dev\build\qtbase\bin\qmake.exe -o Makefile C:\libQT-5.12-dev\build\qtbase\src\corelib\corelib.pro ) && C:\Windows\jom.exe -f Makefile
        C:\Windows\jom.exe -f Makefile.Release
        icl -c -nologo -Zc:wchar_t -Qprec -Zm200 -Zc:forScope  -MT -O3 -Qstd=c++14 -Qoption,cpp,--unicode_source_kind,UTF-8 -EHsc -W3 -Qdiag-disable:673,809,1738,1744,3373 -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_DEBUG -DQT_FORCE_ASSERTS -DPCRE2_CODE_UNIT_WIDTH=16 -DPCRE2_STATIC -DNDEBUG -I. -Iglobal -I..\3rdparty\harfbuzz\src -I..\3rdparty\md5 -I..\3rdparty\md4 -I..\3rdparty\sha3 -I..\3rdparty\double-conversion\include -I..\3rdparty\double-conversion\include\double-conversion -I..\3rdparty\tinycbor\src -I..\..\include -I..\..\include\QtCore -I..\..\include\QtCore\5.12.0 -I..\..\include\QtCore\5.12.0\QtCore -Itmp -Itmp\moc\release -I.tracegen\release -IC:\libZLIB-1.2.11\ICC64RT\include -IC:\libICU-63.1-dev\ICC64RT\include -I..\3rdparty\pcre2\src -I..\..\mkspecs\win32-icc -Fo.obj\release\ @C:\Users\test\AppData\Local\Temp\qstring.obj.15316.250.jom
qstring.cpp
tools\qregularexpression.h(76): error: expected a "}"
          OptimizeOnFirstUsageOption Q_DECL_ENUMERATOR_DEPRECATED_X("This option does not have any effect since Qt 5.12") = 0x0080,
                                     ^

qstringlist.cpp
C:\libQT-5.12-dev\build\qtbase\include\QtCore\../../src/corelib/tools/qregularexpression.h(76): error: expected a "}"
          OptimizeOnFirstUsageOption Q_DECL_ENUMERATOR_DEPRECATED_X("This option does not have any effect since Qt 5.12") = 0x0080,
                                     ^

qregularexpression.cpp
tools\qregularexpression.h(76): error: expected a "}"
          OptimizeOnFirstUsageOption Q_DECL_ENUMERATOR_DEPRECATED_X("This option does not have any effect since Qt 5.12") = 0x0080,
                                     ^

tools\qregularexpression.cpp(2724): error: class "QRegularExpression" has no member "DontAutomaticallyOptimizeOption"
          if (patternOptions & QRegularExpression::DontAutomaticallyOptimizeOption)
                                                   ^

qstring_compat.cpp
qvector_msvc.cpp
jom: C:\libQT-5.12-dev\build\qtbase\src\corelib\Makefile.Release [.obj\release\qstring.obj] Error 2
jom: C:\libQT-5.12-dev\build\qtbase\src\corelib\Makefile [release] Error 2
jom: C:\libQT-5.12-dev\build\qtbase\src\Makefile [sub-corelib-make_first] Error 2
jom: C:\libQT-5.12-dev\build\qtbase\Makefile [sub-src-make_first] Error 2
jom: C:\libQT-5.12-dev\build\Makefile [module-qtbase-make_first] Error 2

which relate to recently merged Change #232893, in particular to the code:

diff --git a/src/corelib/tools/qregularexpression.h b/src/corelib/tools/qregularexpression.h

<snip>
-        OptimizeOnFirstUsageOption     = 0x0080,
-        DontAutomaticallyOptimizeOption = 0x0100
+        OptimizeOnFirstUsageOption Q_DECL_ENUMERATOR_DEPRECATED_X("This option does not have any effect since Qt 5.12") = 0x0080,
+        DontAutomaticallyOptimizeOption Q_DECL_ENUMERATOR_DEPRECATED_X("This option does not have any effect since Qt 5.12") = 0x0100,

and the preceding Change #232892 (testcase added in attachment).

 

Reproduced for:

  • builds using Windows ICC,

not reproduced for:

  • builds using mingw-w64 and MSVC.

Environment:

Qt Developers believe it's a compiler bug.

A related paper on open-std.org.

 

Best,

Alexander

 

AttachmentSize
Downloadapplication/zipqstring_testcase.zip782.25 KB

Working with licenses

$
0
0

Hello,

I'm sorry if this is not the correct forum for this issue but I couldn't find another one that seemed to pertain to it.  I've been using various versions of Parallel Studio XE for C/C++ development on Windows for several years using an academic floating license good for 3 seats.  Each time I have to install a new version I waste more time and frustration than I've ever spent installing any other product just trying to stumble through what I view as the most convoluted and non-intuitive licensing procedure I've ever encountered.  I believe the size of the licensing FAQ itself speaks for itself in this regard and I am obviously too dense to comprehend it.  This is always a real humbling experience to say the least.

One of my computers recently crashed and when I tried to install a license on its replacement it kept telling me that the serial number was already in use, and when I tried to upload a license file it said it was not valid.  I'll take a wild guess and assume that somehow all three of my seats are already in use, although I think I actually only used two.  I haven't found a way to check this type of thing.  At this point I'd simply like to wipe out all active seats and start over, but I can find no mention of how to do this.  If I must actually uninstall the application to free a seat, how do I do it from a crashed computer?

I apologize for all the venting and I would appreciate some suggestions other than what I've already stumbled through in the FAQ. 

Thanks,
Ray

 

 

mpiicc configure spawns dozens of mpiicc processes

$
0
0

When I attempt to ./configure for a program install, the configure scripts will hang.  Running a top will show dozens of mpiicc processes running concurrently while configure is hanging.  I can not reproduce the issue with icc, it only does this with mpiicc.

For example...

setenv install_prefix '/stor400a/jbzambon/netcdf_intel2018/'
source /usr/local/apps/intel2018/build/parallel_studio_xe_2018.3.051/psxevars.csh
source /usr/local/apps/intel2018/build/compilers_and_libraries_2018.3.222/linux/mpi/bin64/mpivars.csh

    setenv CC mpiicc
    setenv CXX mpiicc
    setenv FC mpiifort
    setenv F9X mpiifort
    setenv I_MPI_CC mpiicc
    setenv I_MPI_CXX mpiicpc
    setenv I_MPI_F77 mpiifort
    setenv I_MPI_F90 mpiifort
    setenv DM_FC mpiifort
    setenv DM_CC mpiicc
    setenv CFLAGS '-O3 -xHost -ip -static-intel -heap-arrays -static_mpi -L'$install_prefix'/build/lib/ -I'$install_prefix'/build/include/'
    setenv CXXFLAGS '-O3 -xHost -ip -static-intel -heap-arrays -static_mpi -L'$install_prefix'/build/lib/ -I'$install_prefix'/build/include/'
    setenv FCFLAGS '-O3 -xHost -ip -static-intel -heap-arrays -static_mpi -L'$install_prefix'/build/lib/ -I'$install_prefix'/build/include/'
    setenv I_MPI_CFLAGS '-O3 -xHost -ip -static-intel -heap-arrays -static_mpi -L'$install_prefix'/build/lib/ -I'$install_prefix'/build/include/'
    setenv I_MPI_LDFLAGS '-O3 -xHost -ip -static-intel -heap-arrays -static_mpi -L'$install_prefix'/build/lib/ -I'$install_prefix'/build/include/'

cd $install_prefix
rm -rf szip-2.1.1.tar.gz
rm -rf szip-2.1.1
wget https://support.hdfgroup.org/ftp/lib-external/szip/2.1.1/src/szip-2.1.1.tar.gz
tar -zxvf szip-2.1.1.tar.gz
cd szip-2.1.1
./configure --prefix $install_prefix/build
make
make check
make install

Will hang on the configure script at "checking build system type...".  However....

    setenv CC icc
    setenv CXX icc
    setenv FC ifort
    setenv F9X ifort

Will work.  Here's a screenshot of the two terminals side by side.  The left terminal is running the configure script.  The right terminal shows the dozens of mpiicc processes running.  I can reproduce the issue by simply setting 

    setenv I_MPI_CC mpiicc

and checking the version

    mpiicc -v

which results in an infinite loop of mpiicc processes.  Versions...

 

jbzambon@node01 szip-2.1.1 > mpiicc -v
mpiicc for the Intel(R) MPI Library 2018 Update 3 for Linux*
Copyright(C) 2003-2018, Intel Corporation.  All rights reserved.
icc: command line warning #10006: ignoring unknown option '-static_mpi'
icc version 18.0.3 (gcc version 5.4.0 compatibility)
jbzambon@node01 szip-2.1.1 > icc -v
icc version 18.0.3 (gcc version 5.4.0 compatibility)
jbzambon@node01 szip-2.1.1 > ifort -v
ifort version 18.0.3
jbzambon@node01 szip-2.1.1 > mpiifort -v
mpiifort for the Intel(R) MPI Library 2018 Update 3 for Linux*
Copyright(C) 2003-2018, Intel Corporation.  All rights reserved.
ifort version 18.0.3

Any help is appreciated, thanks!

 

-Joe

Viewing all 2797 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>