icc

icpc debug info with Eigen library

两盒软妹~` 提交于 2019-12-12 03:03:32
问题 Eigen is a popular C++ library, but icpc seems to have a problem generating debugging info from code that uses Eigen. I'm using the compiler icpc version 13.1.1. I checked with both Eigen 3.2.8 and 3.1.3. It's going to be hard to recompile all the libraries I need with another compiler, so does anyone see a good solution to get Eigen to work with a debugger? The problem is that variable values don't always get updated in the debugger. Here is main.cpp #include "stdio.h" #include "/home

Reading CF, PF, ZF, SF, OF

孤人 提交于 2019-12-11 23:29:38
问题 I am writing a virtual machine for my own assembly language, I want to be able to set the carry, parity, zero, sign and overflowflags as they are set in the x86-64 architecture, when I perform operations such as addition. Notes: I am using Microsoft Visual C++ 2015 & Intel C++ Compiler 16.0 I am compiling as a Win64 application. My virtual machine (currently) only does arithmetic on 8-bit integers I'm not (currently) interested in any other flags (e.g. AF) My current solution is using the

Intel Compiler uses wrong header

╄→尐↘猪︶ㄣ 提交于 2019-12-11 13:01:20
问题 I am trying to find out why the Intel Compiler 18.0 , which got installed after my Visual Studio 2017 installation, uses the header files of MSVC , instead of it's own one (since it results in errors). A simple #include <vector> triggers this error in an otherwise empty translation unit when compiled in a C++ project within Visual Studio 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\type_traits(1562): error : expected a ">" 1> _INLINE_VAR

warning: cannot find entry symbol _start - while compiling to .so

独自空忆成欢 提交于 2019-12-11 12:05:27
问题 Hello I am running Linux Ubuntu and am compiling using icpc (intel compiler), I want to get a shared library so I used the command: icpc -o myShared.so -std=c++11 -shared -DSTDC_HEADERS -D __cplusplus=201103L -fpermissive -DPT_XX_DEV -fexceptions -frtti -DANDROID -w -fstack-protector -fPIE -fPIC -pie -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -I/home/admins/aaa/include -I/home/admins/bbb/include a.cpp b.cpp c.cpp -lpthread -L./../../static_libs -lmyStatic I an getting a warning: ld:

Type Traits - Explicit template specialization. fails on xcode

二次信任 提交于 2019-12-11 11:08:15
问题 I'm trying to use type traits like in "Modern C++ Design" using a template to determine if a type has a variable size or not. e.g. a string requires variable size storage, an int has fixed-size storage. This code works on Microsoft C++, now I'm porting to mac and I get the error: explicit specialization is not allowed in the current scope What's the correct way to specialize this? template <typename T> class MyTypeTraits { template<class U> struct VariableLengthStorageTraits { enum { result =

ICC inline assembler doesn`t like push/pop

北战南征 提交于 2019-12-11 05:16:48
问题 I try to excute assembler inline with icc in msasm: int main (void) { __asm{ mov eax, 5h; //works push eax; // after shell command /opt/intel/bin/icc -use_msasm asm.c: // asm.c(7): (col. 5) error: Unsupported instruction form in asm // instruction push. //pop ebp; // the same }; printf("success!\n"); return 1; } Does anybody know why icc doesn`t accept push and pop? Thanks in advance! 回答1: You should use x64 version of registers instead. So the correct version should like this: __asm{ mov rax

Why does ICC produce “inc” instead of “add” in assembly on x86?

末鹿安然 提交于 2019-12-11 04:07:52
问题 While fiddling with simple C code, I noticed something strange. Why does ICC produces incl %eax in assembly code generated for increment instead of addl $1, %eax ? GCC behaves as expected though, using add . Example code ( -O3 used on both GCC and ICC) int A, B, C, D, E; void foo() { A = B + 1; B = 0; C++; D++; D++; E += 2; } Result on ICC L__routine_start_foo_0: foo: movl B(%rip), %eax #5.13 movl D(%rip), %edx #8.9 incl %eax #5.17 movl E(%rip), %ecx #10.9 addl $2, %edx #9.9 addl $2, %ecx #10

How to access stack base pointer (rbp) using inline assembly?

两盒软妹~` 提交于 2019-12-11 01:05:48
问题 My requirement is to access a function call parameters by offsetting rbp using inline assembly. But I couldn't find a suitable operand constraint to specify the base pointer in x86. I am using Intel compiler but it's documentation states that it supports GCC style inline assembly. So GCC based example would be sufficient. 回答1: You can try: #include <stdio.h> #include <inttypes.h> int main(int argc, char **argv) { uint64_t n; __asm__ __volatile__( "movq %%rbp, %0\n\t" : "=r"(n) ); printf("rbp

Xcode Intel compiler icc cannot find #include <algorithm>

馋奶兔 提交于 2019-12-10 18:43:56
问题 Hi I'm trying to compile a gcc based code on Xcode with the icc compiler (11.1.088) but i have the following error: catastrophic error: could not open source file "algorithm" After looking to this file, it is located in the gcc include directory, but i get hundreds of errors... Does anyone have suggestions ? Thanks. 回答1: What do you have set as your base SDK ? And what version of Xcode ? FWIW I just tried a test with Xcode 3.2.3 and ICC 11.1 (under OS X 10.6 of course) - created a new C++

Why do I get undefined behavior when using OpenMP's firstprivate with std::vector on Intel compiler?

∥☆過路亽.° 提交于 2019-12-10 18:29:59
问题 I have a problem when using OpenMP in combination with firstprivate and std::vector on the Intel c++ compiler. Take the following three functions: #include <omp.h> void pass_vector_by_value(std::vector<double> p) { #pragma omp parallel { //do sth } } void pass_vector_by_value_and_use_firstprivate(std::vector<double> p) { #pragma omp parallel firstprivate(p) { //do sth } } void create_vector_locally_and_use_firstprivate() { std::vector<double> p(3, 7); #pragma omp parallel firstprivate(p) { /