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

xmm16 used without specifying AVX512

$
0
0

I have a weird issue that I don't understand. One of my customers has a problem with my software (it crashes immediately on startup, with a c000001d - invalid instruction - exception). Unfortunately I have no access to the system on which it happens.

OS: Microsoft Server 2012 R2 with Hyper-V inside Microsoft Server 2016
CPU: Intel Xeon Silver 4108 CPU @ 1,80Hz, which supports AVX512.

Binary created with Intel Compiler 17.0 inside Visual Studio 2015.
64 bit, minimum supported target needs to have SSE2 (/arch:SSE2), with optional paths for SSE4.1, 4.2, AVX and AVX2: /QaxSSE4.1 /QaxSSE4.2 /QaxAVX /QaxCORE-AVX-I /QaxCORE-AVX2.

The customer ran a debugger and the code crashes on an instruction that attempts to use the xmm16 register, which only exists in AVX512. I'm not building for AVX512, so I don't understand why it would generate such an instruction. Also, MS Server 2012 doesn't support AVX512 so any checking code should have protected against reaching this instruction (MS Server 2016 and the CPU both do support AVX512 though).

Unfortunately my customer has no access to the Server 2016 system so he hasn't been able to test if the software runs fine outside of the Server 2012 host.

The instruction it crashes on:

00007ff7`e76c2626 62817e08100498  vmovss  xmm16,dword ptr [r8+r11*4] ds:00007ff7`e862e320=3ec3ef15

 


ldexpf already defined linker error

$
0
0

Hi, when I try to build a project with intel compiler 19.0 , I get following linker error:

1>libmmd.lib(libmmd.dll) : : error LNK2005: ldexpf already defined in mkl_intel_lp64_dll.lib(dftifreedescriptor_lp64.obj)

Any ideas what I am doing wrong ?

Edit: Forgot to mention that I'm building on windows10 x64 .

Thanks,

Sergey.

Segmentation fault when compiling with icpc

$
0
0

Hello,

I ran into a strange problem with icpc when compiling the attached C++ code. When I compile with icpc -O0 icpc_segfault.cpp -o icpc_segfault the program crashes with a segmentation fault. If I compile with any other optimization flag or with clang++ or g++, the program runs fine.

I can't see any UB in the code, so my only other guess is that it is a problem with icpc. The attached code is a stripped down version of the actual program. I can "fix" the segfault in the attached code in several ways (e.g., add a const data member to the FormatList class, or declare pointers volatile), but these "fixes" don't work in the actual program. This just makes me think even more so that it's a compiler problem and not UB.

The target architecture is intel64 and I tried several versions of icpc (16.0.4, 17.0.5, 18.0.3, 19.0.5.281).

Any help on this is appreciated. It can very well be that I just don't see the UB in the code.

AttachmentSize
Downloadtext/x-c++srcicpc_segfault.cpp1.31 KB

Intel C++ for Windows __cplusplus value

$
0
0

When I specify the /Qstd=c++0x command line option for Intel C++ on Windows this is the equivalent of C++11 according to documentation at https://software.intel.com/en-us/cpp-compiler-developer-guide-and-refere.... Yet the __cplusplus value for C++11, which is 201103L, is not set but instead the __cplusplus value for C++03, which is 199711L, is set. This seems rto me a bug in Intel C++ as a programmer can not rely on the level of the C++ standard in his code by checking the __cplusplus value.

SIGSEGV __kmp_cleanup_threadprivate_caches()

$
0
0

I am getting segmentation fault at:  

signal SIGSEGV, Segmentation fault.
0x00007f21293df7c3 in __kmp_cleanup_threadprivate_caches () at ../../src/kmp_threadprivate.cpp:812

Since, I can't provide code details. Could you please suggest something which could be the possible reason behind this?

My cases run fine in optimize version, but with debug, If I use gdb, I get this following error at the exit of executable.

Anurag

Intel C++ 19.0 for Windows invalid macro expansion with stringizing operator

$
0
0

This example is taken from the C++ standard when discussing the rules for redefinition and reexamination. Given:

#define str(x) # x

the macrto expansion of:

char c[2][6] = { str(hello), str() };

should be:

char c[2][6] = { "hello", "" };

but with Intel C++ 19.0 on Windows the expansion is erroneously:

char c[2][6] = { "hello", };

This is clearly a bug in the preprocessor so I am reporting it here.

TCE Open Date: 

Wednesday, November 13, 2019 - 20:10

ICC 2019 on VS2019: std::map inserted gives unexpected results

$
0
0

Hello!

I use ICC 2019 update 5 embedded into VS2019 16.1.6. I observed something strange with std::map::insert(). I perform insertion of elements from a std::vector<int> to a std::map<int, int>, using the element value as the map key. Depending on the way I insert them or the compilation switches I use, I don't obtain the same map. See a question on StackOverflow.

Here is the code snippet I used:

#include <map>
#include <vector>
#include <iostream>

std::map<int, int> AddToMapWithDependencyBetweenElementsInLoop(const std::vector<int>& values)
{
    std::map<int, int>  myMap;
    for (int i = 0; i < values.size(); i+=3)
    {
        myMap.insert(std::make_pair(values[i], myMap.size()));
        myMap.insert(std::make_pair(values[i + 1], myMap.size()));
        myMap.insert(std::make_pair(values[i + 2], myMap.size()));
    }
    return myMap;
}

std::map<int, int> AddToMapOnePerLoop(const std::vector<int>& values)
{
    std::map<int, int>  myMap;
    for (int i = 0; i < values.size(); ++i)
    {
        myMap.insert(std::make_pair(values[i], 0));
    }
    return myMap;
}

int main()
{
    std::vector<int> values{ 6, 7,  15, 5,  4,  12, 13, 16, 11, 10, 9,  14, 0,  1,  2,  3,  8,  17 };

    {
        auto myMap = AddToMapWithDependencyBetweenElementsInLoop(values);
        for (const auto& keyValuePair : myMap)
        {
            std::cout << keyValuePair.first << ", ";
        }
        std::cout << std::endl;
    }

    {
        auto myMap = AddToMapOnePerLoop(values);
        for (const auto& keyValuePair : myMap)
        {
            std::cout << keyValuePair.first << ", ";
        }
        std::cout << std::endl;
    }

    return 0;
}

If I compile using "icl mycode.cpp" and I run the program, I obtain this:

0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 17,

0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17

(I expected the same number for both lines and 18 numbers on each lines since there are 18 different numbers inserted in the map)

 

If I compile using "icl /EHsc mycode.cpp" and I run, I obtain:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17,

0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17

(Again, unexpected results?)

 

If I compile using "icl /Od mycode.cpp" and I run:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,

This is the expected result...

Note that I compared using the same switches but with cl.exe (Microsoft compiler) and I always obtain the expected result.

Any idea about the case? Is it a bug? Did I do something wrong? Thanks for your help!

 

TCE Open Date: 

Thursday, November 14, 2019 - 06:36

Do you know if Intel plan to release for free its compiler ?

$
0
0

I have made a game engine based on voxel, using only the CPU and here's the benchmark I made, for 1 million voxels:

  • 20 FPS for a non optimized code, using Visual Studio compiler
  • 144 FPS for an optimized code, using VS compiler
  • 400 FPS for a non optimized code but with optimization flag, using Intel C++ Compiler.

And I am using an i3 6100.

So yes, ICC can help me a lot for this project.

Also this program is made in C#, does ICC support C# ? ^^

TCE Open Date: 

Friday, November 15, 2019 - 02:07

Optimize pow(x, n) + pow(y, n) == pow(z, n)

$
0
0

I'm having a go at the xn + yn = zn problem and want to see how fast I can make it go and if I can get a result but I cant figure out how to make my code vectorize or parallelize:

#include <iostream>
using namespace std;

int main(){
    unsigned long n = 0;
    cout << "n = ";
    cin >> n;
    for(unsigned long x = 1; x < 0xffffffff; ++x){
        cout << "x = "<< x << "\n";
        for(unsigned long y = 2; y < 0xffffffff; ++y){
            const unsigned long xy = pow(x, n) + pow(y, n);
            cout << "y = "<< y << "\n";
            for(unsigned long z = 1; z < 0xffffffff; ++z){
                if(xy == pow(z, n)) cout << x << "n + "<< y << "n = "<< z << "n\n";
            }
        }
    }
}

the optimization diagnostic gives 15523

I'm using Intel C++ compiler 18.0

TCE Open Date: 

Saturday, November 16, 2019 - 08:22

Intel 19 type-deduction allows non-const lvalue reference to prvalue

$
0
0

Intel 19 (Update 5) for Windows introduces a regression in which it is possible to take a non-const l-value reference to a temporary (prvalue). This code is correctly flagged in VS2019 as aberrant.

#include <cstdio>

struct T
   {
   T(char ch) : m_ch( ch ) { printf("Constructing '%c' (0x%08p)\n", ch, this); }
  ~T() { printf("Destructing '%c' (0x%08p)\n", m_ch, this); }
   char m_ch;
   };

T CreateT(char ch)
   {
   return T{ch};
   }

template <typename T_>
void Func1(T_&& t)
   {
   printf("Calling Func1 on object '%c' (0x%08p)\n", t.m_ch, &t);
   }

void Func2(T& t)
   {
   printf("Calling Func2 on object '%c' (0x%08p)\n", t.m_ch, &t);
   }

int main()
{
    const auto& a = CreateT('A'); // ok, const l-value reference to r-value
    auto&& b = CreateT('B'); // ok, deduces to r-value (T&&)
    Func1(CreateT('C')); // ok, deduces to T&&
//  Func2(CreateT('D')); // error, cannot bind non-const l-value ref to r-value (Intel 19.0.5 allows this!)
//  auto& d = CreateT('D'); // error, cannot bind non-const l-value ref to r-value (Intel 19.0.5 allows this!)

    return 0;
}

 

TCE Open Date: 

Monday, November 18, 2019 - 17:13

operator with default definition fails to compile

$
0
0

When overriding operator `=` with default fails to compile.

Is this a bug or am I missing something?

Error Message

icpc -std=c++17 sample.cpp
ld: /tmp/icpczIU0ix.o:(.rodata._ZTV6Entity[_ZTV6Entity]+0x10): undefined reference to `Entity::operator=(Entity const&)'

Source code

#include <iostream>
class Entity {
    public:
        Entity() = default;
        virtual Entity & operator = ( Entity const & )=default;
    public:
        int index;
};

Entity e1 = Entity();

int main() {
    std::cout << e1.index;
    return(0);
}

Intel c++ compiler version

icpc (ICC) 19.0.5.281 20190815

TCE Open Date: 

Sunday, November 17, 2019 - 20:30

Assertion failed at "shared/cfe/edgcpfe/ms_lower_name.c"

$
0
0

Hello,

Our software product is built with MSVC. Now I want to only rebuild the computing module with Intel compiler while other parts are still compiled with MSVC. The computing module consists of three cpp files, and will be built as a .dll file. The following is about compiler versions.

MSVC: Microsoft (R) C/C++ Optimizing Compiler Version 19.23.28107 for x64 (from Visual Studio 2019)

Intel Compiler: Intel(R) 64, Version 19.0.5.281 Build 20190815

During the compilation, there is no any error reported for our source code,  but the compilation eventually ends up with the following error.

 C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.23.28105\include\complex(26): error : assertion failed at: "shared/cfe/edgcpfe/ms_lower_name.c", line 1826.

I have no idea which part of our code triggered this error, any suggestion about how to proceed? Many thanks.

 

TCE Open Date: 

Monday, November 18, 2019 - 04:54

command line remark #10148: option '/Qvec-report0' not supported

$
0
0

When I use Intel(R) compiler 19.0 to compile a program, a note appears: command line remark #10148: option '/Qvec-report0' not supported. I don't know what that means. Is there any expert who can help me? Thanks.

 

AttachmentSize
Downloadimage/png1.PNG97.37 KB

TCE Open Date: 

Wednesday, November 20, 2019 - 05:25

No intel C++ compiler installed even though I have installed it

$
0
0

I have installed intel c++ compiler  in windows  server 2012 R2 using PSXE2019 cluster edtion. But, I don't find the intel c++ compiler tool in the visual studio.

AttachmentSize
Downloadimage/pngNo-intelc++Compiler.png92.39 KB

TCE Open Date: 

Friday, November 22, 2019 - 01:41

License error installing icc from Parallel Studio XE Cluster Edition for Linux 2018

$
0
0

Dear all, 

I am trying to reinstall the icc compiler from an old version of Intel® Parallel Studio XE Cluster Edition for Linux (2018.2.199).

My current license has expired, but the registrationcenter lets me download some tools such as Intel® Parallel Studio XE Composer Edition for C++ Linux*.
However, once I downloaded the parallel_studio_xe_2018_update2_composer_edition_for_cpp.tgz file, I also receive a new license file by email, which is 
the one I am trying to use. 

However, when I try to install it using : 

./install.sh  -s silent.cfg

I've got the an error 

Product support for your Intel(R) Parallel Studio XE 2018 Update 2 Composer
Edition for C++ Linux* license has expired.  Please refer to
https://software.intel.com/en-us/faq/purchasing-renewing-upgrading#suppo...
ation for more information.

This is my silent.cfg configuration:

ACTIVATION_TYPE=serial_number
ACTIVATION_SERIAL_NUMBER=XXXX-XXXXXXXX
PSET_INSTALL_DIR=/software/RHEL/7/Broadwell/software/icc/2018.2.199-GCC-9.2.0-2.32
ACCEPT_EULA=accept
INSTALL_MODE=NONRPM
CONTINUE_WITH_OPTIONAL_ERROR=yes
COMPONENTS=intel-comp__x86_64;intel-comp-32bit__x86_64;intel-comp-doc__noarch;intel-comp-l-all-common__noarch;intel-comp-l-all-vars__noarch;intel-comp-nomcu-vars__noarch;intel-comp-ps-32bit__x86_64;intel-comp-ps__x86_64;intel-comp-ps-ss__x86_64;intel-comp-ps-ss-bec__x86_64;intel-comp-ps-ss-bec-32bit__x86_64;intel-compxe__noarch;intel-compxe-doc__noarch;intel-ccompxe__noarch;intel-ccompxe-doc__noarch;intel-icc__x86_64;intel-icc-32bit__x86_64;intel-icc-common__noarch;intel-icc-common-ps__noarch;intel-icc-common-ps-ss-bec__noarch;intel-icc-doc__noarch;intel-icc-doc-ps__noarch;intel-icc-ps__x86_64;intel-icc-ps-ss__x86_64;intel-icc-ps-ss-bec__x86_64;intel-icc-ps-ss-bec-32bit__x86_64;intel-openmp__x86_64;intel-openmp-32bit__x86_64;intel-openmp-common__noarch;intel-openmp-common-icc__noarch;intel-openmp-common-ifort__noarch;intel-openmp-ifort__x86_64;intel-openmp-ifort-32bit__x86_64;intel-ips__noarch;intel-ipsc__noarch;intel-gdb-gt__x86_64;intel-gdb-gt-src__noarch;intel-gdb-gt-doc__noarch;intel-gdb-gt-doc-ps__noarch;intel-gdb__x86_64;intel-gdb-source__noarch;intel-gdb-python-source__noarch;intel-gdb-common__noarch;intel-gdb-doc__noarch;intel-gdb-doc-ps__noarch

 

Is it not possible to re-install an already installed version of the compiler but in a different place?

Thank you so much !
Sincerely,
 

TCE Open Date: 

Friday, November 22, 2019 - 03:53

Download Intel parallel Studio 2013 update 4/5

$
0
0

Hello all, I am an Intel Employee and I can't find where to download Download Intel parallel Studio 2013 update 4/5

Can you please share a link?

I can download all of the other version but I can't find this one.

Thanks Gilad 

TCE Open Date: 

Sunday, November 24, 2019 - 00:48

Statically link dependencies

$
0
0

Hi,

I'm having some issues statically linking some dependencies when building a DLL with Cmake on Windows. 

When I perform a regular MSVC build I do the following:

:: Sets up compiler environment 
CALL "%VS2017INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64

:: Path gets very long and VS can no longer find cmd.exe if we don't prepend it
SET PATH=C:\windows\system32;%PATH%

:: Set vars to CMake and Ninja
SET CMAKE_EXE=%VS2017INSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe
SET NINJA_EXE=%VS2017INSTALLDIR%\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe

:BuildRelWithDebInfo
MKDIR Temp\RelWithDebInfo 2> NUL
PUSHD Temp\RelWithDebInfo
:: Configure build for RelWithDebugInfo
CALL "%CMAKE_EXE%" -G "Ninja" ^
	-DCMAKE_INSTALL_PREFIX="%~dp0\Install\RelWithDebInfo" ^
	-DCMAKE_BUILD_TYPE="RelWithDebInfo" ^
	-DCMAKE_MAKE_PROGRAM="%NINJA_EXE%""%~dp0"

set ERRORCODE=%ERRORLEVEL%
IF %ERRORCODE% NEQ 0 (
	echo Failed to configure build for 'RelWithDebInfo'
	exit /B %ERRORCODE%
)

:: Build and install
CALL "%CMAKE_EXE%" --build . --target install

set ERRORCODE=%ERRORLEVEL%
IF %ERRORCODE% NEQ 0 (
	echo Failed to compile build and install for 'RelWithDebInfo'
	exit /B %ERRORCODE%
)

To build with the Intel compiler I do this instead:

CALL "%ICPP_COMPILER19%\bin\ipsxe-comp-vars.bat" intel64 vs2017

:: Sets up environment to find intel compiler tools
CALL "%ICPP_COMPILER19%\bin\ipsxe-comp-vars.bat" intel64 vs2017
:: Path gets very long and VS can no longer find cmd.exe if we don't prepend it
SET PATH=C:\windows\system32;%PATH%

:: Set vars to CMake and Ninja
SET CMAKE_EXE=%VS2017INSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe
SET NINJA_EXE=%VS2017INSTALLDIR%\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe

SET COMPILER_NAME=icl.exe

:BuildRelWithDebInfo
MKDIR Temp\Intel-RelWithDebInfo 2> NUL
PUSHD Temp\Intel-RelWithDebInfo
:: Configure build for RelWithDebugInfo
CALL "%CMAKE_EXE%" -G "Ninja" ^
	-DCMAKE_INSTALL_PREFIX="%~dp0\Install\Intel-RelWithDebInfo" ^
	-DCMAKE_BUILD_TYPE="RelWithDebInfo" ^
	-DCMAKE_MAKE_PROGRAM="%NINJA_EXE%" ^
	-DCMAKE_CXX_COMPILER="%COMPILER_NAME%" ^
	-DCMAKE_C_COMPILER="%COMPILER_NAME%" ^
	"%~dp0"

set ERRORCODE=%ERRORLEVEL%
IF %ERRORCODE% NEQ 0 (
	echo Failed to configure build for 'Intel-RelWithDebInfo'
	exit /B %ERRORCODE%
)

:: Build and install
CALL "%CMAKE_EXE%" --build . --target install

The only real differences are which batch to call to setup the dev environment and for Intel builds I set CMAKE_CXX_COMPILER and CMAKE_C_COMPILER to icl.exe. 

I'm statically linking against hdf5.lib and hdf5_cpp.lib which when I build with MSVC is fine.

When I build with the Intel compiler however the resultant DLL has a dependency on hdf5.dll and hdf5_cpp.dll. 

Is this something I can avoid? I can't find much information on this issue as all the google search turn up results about statically linking openmp. 

Has anyone else had an issue like this? It may entirely be a Cmake issue but I can't see how right now. 

 

TCE Open Date: 

Monday, November 25, 2019 - 09:20

ICC fails in link but G++ can link

$
0
0

Simple hello world program(bottom of post) when I try to compile & link using ICC:

hmbp:nnCPPProf hima$ icpc -o test test.cpp 
Undefined symbols for architecture x86_64:
  "__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1Emc", referenced from:
      _main in icpcIBtuRJ.o
ld: symbol(s) not found for architecture x86_64

but g++ can do it:

hmbp:nnCPPProf hima$ g++ -o test test.cpp 
hmbp:nnCPPProf hima$ ./test 
Hello World.

 

The program:

hmbp:nnCPPProf hima$ cat test.cpp 
#include <iostream>
using namespace std;
int main(int argc, const char* argv[])
{
  cout<<"Hello World."<<endl;
  return 0;
}
hmbp:nnCPPProf hima$ 

 

I am missing some kind of setup but I ran the setup script suggested by the installer and still no difference.

TCE Open Date: 

Wednesday, November 27, 2019 - 01:33

CPP calls FORTRAN

$
0
0

Hello!

I have a problem with the mixed languages programming.

This is a task with the cpp/fortran pointers passing when the 2d dynamic array was created.

Main CPP program is calling FORTRAN array filling subroutine. Can't get the right results, please help.

PS I can't using an one-dimensional array, like this arr[i*N +j] :(

 

CPP TEXT:

#include <cstdlib>
#include <iostream>

using namespace std;

extern "C" void fill_array(int **, int, int);
int main()
{
    int i, j, N, M;
    int **arr;
    cout<<endl<<"rows Number  ="<<endl;    cin>>M;
    cout<<endl<<"cols Number  ="<<endl;    cin>>N;
    cout<<endl;
    arr = new int*[N];
    for(int i = 0; i < N; i++)arr[i] = new int[M];
//
    fill_array(arr,M,N);
//    
    for( i = 0; i < N; i++)
    {   
      for( j = 0; j < M; j++)
      {  
         cout << arr[i][j]<<"";
      }
      cout<<endl;
    }  
//    
    for( i = 0; i < N; i++)delete [] arr[i];
    delete [] arr;

    return EXIT_SUCCESS;
}

FORTRAN TEXT:

SUBROUTINE FILL_ARRAY(C,M,N)BIND(C,name="fill_array")
    USE, INTRINSIC                         :: ISO_C_BINDING
    INTEGER(KIND=C_INT), INTENT(IN), VALUE :: N,M
    TYPE(C_PTR)                            :: C
    INTEGER(C_INT), POINTER      :: F(:,:)
    INTEGER                                  :: I,J, RANK
    RANK = N*M
    CALL C_F_POINTER(C,F,[RANK])
    DO I=1, M
        DO J = 1, N
            F(I, J) = I + J
        ENDDO
    ENDDO
END SUBROUTINE    

Typical output for matrix 3x3 is not correct:

2 3 4

0 3 4

0 0 4

TCE Open Date: 

Wednesday, November 27, 2019 - 10:50

should i source iccvar.sh ia32 or intel64 when i use icc to compile code with -m32 option?

$
0
0

I compile an code in -m32 mode. My computer is intel 64bit cpu.

when i initial icc envirenment, should i source iccvar.sh ia32 or intel64 when i use icc to compile code with -m32 option? 

TCE Open Date: 

Thursday, November 28, 2019 - 21:28
Viewing all 2797 articles
Browse latest View live


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