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

Compiler 17.0 Update 4 for Intel 64 Visual Studio 2012 environment

$
0
0

Hi guys, 

I have a code written in Visual Studio 2012 and I need to compile it with Intel Parallel Studio XE 2017. Does "Intel Parallel Studio XE 2017" support Visual studio 2012?

Or any other version can support my visual studio 2012 program?

Regards


VS 2019 Debugger + ICC 2020 : "step over" works like "step into"

$
0
0

Hello,

i use VS 2019 with Intel c++ 2020.

If i compile a program with VC only the debugger works like expected. I can go through the code line by line using "step over".

If I compile the same code with intel c++ "step over" works like "step into".

How do I get the normal behavior of "step over"?

 

Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Compiler 17.0 Update 4 for Intel 64 Visual Studio 2012 environment

$
0
0

Hi guys, 

I have a code written in Visual Studio 2012 and I need to compile it with Intel Parallel Studio XE 2017. Does "Intel Parallel Studio XE 2017" support Visual studio 2012?

Or any other version can support my visual studio 2012 program?

Regards

Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Internal Error

$
0
0

The attached file generates this error on Linux with icpc 19.0, compiled with "icpc -g -c bug.cpp"

/scratch/kbelco/modernization/tools/../simd/avx.hpp(29): internal error: assertion failed at: "shared/cfe/edgcpfe/decls.c", line 9448

     static constexpr unary_value initialize = _mm256_set1_epi32;

                    

AttachmentSize
Downloadapplication/octet-streambug.cpp.gz388.84 KB

Building newest boost 1.73 fails with 19.1

$
0
0

Hello,

i try to build newest boost libraries, version 1.73 with Intel C++ 19.1 update 1 and Visual C++ 16.5.5 (also with 16.5.4). For example filesystem library.

Command line:

.\b2 architecture=x86 address-model=32 stage --build-type=complete --stagedir=address-model-32 --toolset=intel-19.1-vc14.2 --with-filesystem > ..\icpp32.txt

With latest standard:

.\b2 cxxstd=latest architecture=x86 address-model=32 stage --build-type=complete --stagedir=address-model-32 --toolset=intel-19.1-vc14.2 --with-filesystem > ..\icpp32latest.txt

It fails with many errors such as:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\utility(96): error: expected an identifier
          !_Is_implicitly_default_constructible<_Uty1>::value || !_Is_implicitly_default_constructible<_Uty2>::value)
          ^

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\utility(95): error: not a valid member class or function template declaration
      constexpr explicit(
      ^

Any clue how to get this work?

Greetings

Przemek

AttachmentSize
Downloadapplication/x-7z-compressedlogs.7z4 KB

xiar: executing 'ar'

$
0
0

Hi everyone, I am having the title's warning while I compile a scientific computing software stack using icc/ifort/impi 19.0.5. I explicitely specify in my cmake configuration step to use xiar but apparently it is still using ar instead. Surprisingly my google search only returned two similar posts from 2011 and 2005 (!!!), so please if anyone has any further information on where to look it will be highly appreciated.

Regards,

Nikolas


Using arithmetic operators with SIMD data types

$
0
0

Recently, I found Intel post (from 2014) which describes using of arithmetic and logic operators with SIMD data types. I tried to use it in my program, but this doesn't seem to work - compiler just states: "error : no operator "+" matches these operands
1>            operand types are: __m128d + __m128d". I'm using Visuald Studio 2019 with Intel C++ Compiler 19.1. I couldn't find anymore information on that feature beside that one link. Is that a deleted feature? Am i doing something wrong? Am I getting something wrong?

Visual studio 2012 required

$
0
0

I am now trying to link ABAQUS and visual studio 2012 and Intel Parallel studio XE 2013. However I cannot find a visual studio 2012 that updates properly.

 

I tried VS2010 as well, but I need a vcvarsall.bat in the VC fold, but I cannot find one.

 

So far, I either need to have a nice VS2012, or a vcvarsall.bat for my VS2010.

 

Thank you!

Problem on invoking icl in Windows 10

$
0
0

Hi, 

My computer os is windows 10, and I have installed the Visual Studio 2019 community and Intel parallel studio XE 2020, also the CUDA toolkit 10.2.

I want to use the OpenMp and Cuda to accellerate my program, and the version of OpenMp should be at least 3.1, so Intel C++ compiler is set as the host compiler. There are several sources files in my program, only one includes the OpenMp primitives. 

When I run the code with Intel compiler, the error message reports that " invalid preprocessor command ' include_next'", this 'include_next' located in the 'math.h' in intel include directory. I also find some other cuda codes, which can be run well with vs compiler, cannot work with Intel compiler and the same error reported.

Someone tell me I need to perform isolation compilation with the code. So I need to use command lines to compiler each souce file seperately. However I find I cannot use the command icl in intel command window. When I open the intel command window, the error massege emerged:

 

//////////

Copyright (C) 2009-2020 Intel Corporation. All rights reserved.
Intel(R) Inspector 2020 (build 604266)
Copyright (C) 2009-2020 Intel Corporation. All rights reserved.
Intel(R) Advisor 2020 (build 605410)

Intel(R) Trace Analyzer and Collector 2020 Update 1 for Windows* OS for Intel(R) 64 applications
Copyright (C) 1996-2020 Intel Corporation. All rights reserved.

'where' is not recognized as an internal or external command,
operable program or batch file.
'where' is not recognized as an internal or external command,
operable program or batch file.
'findstr' is not recognized as an internal or external command,
operable program or batch file.

///////////

 

Also the icl command cannot be recognized. Then I run the compilervars.bat with clause intel64 and vs2019, the same error message reported:

///////////

'where' is not recognized as an internal or external command,
operable program or batch file.
'where' is not recognized as an internal or external command,
operable program or batch file.
'findstr' is not recognized as an internal or external command,
operable program or batch file.

//////////

 

I don't know the reason and I cannot find some relative information about this error online. Could someone give me some advise, I really appreciate any comment you posted. Thank you.

 

How are array allocation size computed when overloading new [] operator ?

$
0
0

Hello All, 

We upgraded from Intel compiler XE 2011 to the most recent version, 2020, and noticed an change that is blocking the upgrade. 

We've developed our own specific memory allocator, and therefore we overload the new and delete operator in our classes. My question is about the way the size of the allocation, passed to the new[] () operator, is computed when allocating an array of objects whose class have a destructor. For example:

class Foo {
private:
    int        a_ = { 0 };

public:
    Foo(int a = 0) a_(a) { ; }
    ~Foo() {
        // ... do something
    }

    void* operator new[](std::size_t count) {
        void* ptr = nullptr;
        // Allocate memory for the array
        return ptr;
    }
};

int main() {
    Foo* pFoo = new Foo[1];
}
 

If the class does not have destructor, the allocation size passed onto the new[] operator, count, is straightforward: it's the number of allocated objects multiplied by the size of the class: N x sizeof(Foo)

If the Foo class defines a destructor, then the allocation is N x sizeof(Foo) + offset. I believe the offset is to store a pointer to the destructor. With Intel 2011, when compiling on Windows 64bits, this offset was always 8 bytes. But with Intel compiler 2020, it varies. If the size of the class is smaller than 8 bytes, then the offset is 4 bytes. Otherwise it's 8 bytes as before.

Is there an explanation for that offset  ? And can it be changed so that the offset is constant as before ?

I tried with Visual Studio 2019, and the offset is always 8 bytes. 

I include a small testcase that shows the behavior.  

Thanks for any info on that subject,

Brendan

AttachmentSize
Downloadapplication/ziptest_intel.zip1.01 KB

in the compiler options is broken

$
0
0

VS2019. 

In "options->intel compilers and libraries->C++ ->compilers", if I set the selected compiler to <Latest> (which is the default), I will receive a `MSB600: Failed to locate: "icl.exe"`. If I choose a specific version in the "selected compiler" list, the error will no longer exist. So, I guess that <Latest> doesn't point to any version and is a broken option. 

Variable died for no reason

$
0
0

During the C++ application execution one of the variables dies for no reason. I think that the causes of this problem are connected to memory. However, I don't have any ideas how to solve this problem. What could be the cause of this problem?

[Request] Lightweight, Fast C++ compiler

$
0
0

Hey there, looking for a lightweight and fast C++ compiler. Used codeblocks and visual studio in the past and i didnt really like either of them. Looking for any suggestions the community may have, please help :).


C++ 19.1 Update 1 Incompatible with Visual Studio 2019 16.6

$
0
0

It appears that updating to Visual Studio 2019 16.6.0 breaks Intel C++ 19.1 Update 1. I'm seeing incorrect std::find behavior but there may be other issues. I realize that 16.6 isn't listed in the (not always accurate or up to date) compatibility doc but I thought I'd note this issue here for the sake of other Intel C++ users. If anyone knows a work-around that would help since downgrading VS is non-trivial.

Stuart

Pack argument function overload specialization missing arguments not diagnosed

$
0
0
#include <string>

extern void use(int);

template<class... Ts>
void f(int i=1, Ts... ts)
{
	use(sizeof...(Ts));
}

template<>
void f<std::string>(int i, std::string j)
{
	use(j.size());
}

void test1()
{
	f<std::string>();
}

Godbolt
With -std=c++17 -O2 this compiles to std::abort().
I believe this should fail to compile due to none of the required parameters for the std::string specialization not being given.

Related C++ Defect Reports:
DR777
DR2233

DR2233 not implemented

$
0
0
template<typename ...T>
int f(int n = 0, T ...t);

int x = f<int>();

Godbolt
Per the wording change in DR2233 the above code should fail to compile.

GCC, Clang and MSVC all correctly reject this code.

Single thread memcpy too slow

$
0
0

I have a 9920x at up to 4.8GHz on all cores and 32GB of quad channel 3600MHz CL16 RAM and memcpy copies at a rate of just 11GB/s which is clearly limited by the CPU cores, I could write a multithreaded memcpy routine for large copies but I would like to know if there is a more elegant solution maybe using DMA to fully utilize the memory bandwidth without writing messy multithreaded memcopy code?

allocate vars and functions sequentially in .EXE

$
0
0

I would like to instruct the compiler and the linker on how to allocate the following code (I am using Visual Studio and Intel C++ compiler for Windows) 

/*
  large chunk of code before
*/

static uint64_t a;
static uint64_t b;
static uint64_t c;
static uint64_t d;

static void CALLBACK foo( args ){
  /* short code using a, b, c, d */
}

/*
  large chunk of code after
*/

Specifically, I would like to instruct the compiler and the linker so that the .EXE file would allocate a, b, c, d, foo() contiguously in this order to maximize cache benefit. 

The following mods seem to achieve the goal, but the external driver that invokes foo() does not like the fact that foo() is inside a segment, and thus crashes. Maybe I did not use the pragmas correctly.

#pragma code_seg(push, stack1, ".my_text")

__declspec(allocate(".my_text")) static uint64_t a;
__declspec(allocate(".my_text")) static uint64_t b;
__declspec(allocate(".my_text")) static uint64_t c;
__declspec(allocate(".my_text")) static uint64_t d;

__declspec(code_seg(".my_text")) static void CALLBACK foo( args ){
  /* do something using a, b, c, d */
}
#pragma code_seg(pop, stack1)

On the other hand, moving foo() outsize the segment works, but I have no guarantee that foo() is allocated soon after a, b, c, d in the .EXE

#pragma code_seg(push, stack1, ".my_text")

__declspec(allocate(".my_text")) static uint64_t a;
__declspec(allocate(".my_text")) static uint64_t b;
__declspec(allocate(".my_text")) static uint64_t c;
__declspec(allocate(".my_text")) static uint64_t d;

#pragma code_seg(pop, stack1)

static void CALLBACK foo( args ){
  /* do something using a, b, c, d */
}

Any help is appreciated, thanks.
-Roberto

Viewing all 2797 articles
Browse latest View live


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