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

Same operation, different results

$
0
0

Hi,

    When executing the program below, icc produced different results for Y and Y2. The result of Y is 12. I guess it multiplied the VALUE constant first, and got the result of 4, then cast the int 4 as long long type. Finally it is multiplied by 3 to get 12. And the value of Y2 is -4611686044197191668. Instead, it is possible to convert the type t to long long first and then multiply the variables t to produce the result of 4611686009837453316 which is long long type. Finally it is multiplied by 3 to get -4611686044197191668.

    Is this a correct behavior for intel c complier?  Sorry if i misunderstood something.

 

TestCase:

 

#include <stdio.h>

#define VALUE ((int)((long long)U1 * (long long)3) + 2)

 

int main(void)

{

    long long Y, Y2;

    int U1;

    int t;

    U1 = -2147483648;

    Y = ((long long)(VALUE * VALUE) * 3);

    t = VALUE;

    Y2 = ((long long)(t * t) * 3);

    if (Y != Y2)

        printf("%lld,%lld\n", Y, Y2);

    return 0;

}

 

The OS is:

Linux version 4.15.0-65-generic

 

Compiler Version:

icc (ICC) 19.0.4.243 20190416

 

Output:

12,-4611686044197191668

 

Expected output:

12,12

TCE Open Date: 

Friday, February 14, 2020 - 05:24

macOS Catalina must set sysroot for icpc?

$
0
0

I'm running macOS Catalina 10.15.3, Xcode 11.3.1 (all is a fresh install, new computer) with Intel C++ 2020 Initial Release. When trying to compile the simple program "main.cpp" :

- - - - - - - 

#include <iostream>
int main() {
  std::cout << "hello world"<< std::endl;
  return 0;
}

- - - - - - - - 

with the command "icpc main.cpp" I get the following error:

- - - - - - - - 

In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iosfwd(96),

                 from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios(215),

                 from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream(38),

                 from main.cpp(1):

/Library/Developer/CommandLineTools/usr/include/c++/v1/wchar.h(119): catastrophic error: cannot open source file "wchar.h"  #include_next <wchar.h>

                         ^

compilation aborted for main.cpp (code 4)

- - - - - - - - 

 

The error goes away and the code compiles fine when I use: "icpc main.cpp -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"

How come Intel doesn't ship these headers so that the compiler is self-contained? I'm executing the compilervars script when I launch my terminal, why is this directory not set? Is there a way around setting sysroot when compiling? This was also address in stack overflow, but no alternative solution was proposed:

https://stackoverflow.com/questions/59938881/intel-c-cannot-open-wchar-h...

Thanks - 

Mike

TCE Open Date: 

Friday, February 14, 2020 - 13:52

Issues with std::weak_ptr and Visual Studio 2019 16.4.4

$
0
0

There seems to be quite a serious issue with std::weak_ptr<> and Intel Compiler 19.0 and 19.1 with Visual Studio 2019.

The problem appears to be that the class _Ref_count_base, which includes the code

    _Atomic_counter_t _Uses  = 1;
    _Atomic_counter_t _Weaks = 1;

Does not appear to be initializing _Weaks to 1 ( when using Intel, not MSVC)

Run this simple program under the debugger and examine the values of _Weaks after the std::weak_ptr<int> has been constructed

Compiled with MSVC and with Intel. Debug at the return statement. You will see _Weaks=2 with MSVC but _Weaks=1 with Intel

 

int main()
{
    std::shared_ptr<int> aStrong = std::make_shared<int>(10);
    std::weak_ptr<int> aWeak(aStrong);

return 0;
}

AttachmentSize
Downloadimage/pngIntel.png26.95 KB
Downloadimage/pngMSVC.png28.6 KB

TCE Open Date: 

Tuesday, February 18, 2020 - 11:33

Official CMake (3.0+) support for MKL

$
0
0

Latest release of "Intel® Parallel Studio XE Cluster Edition for Linux* 2020" comes with no cmake support.

It makes hard to maintain applications which rely on MKL or has it as optional dependency.

CMake currently dominates the industry and missing it's support in one of most used math library is at least strange.

Is there any plans to add official CMake support?

I wish usage of MKL it would be as simple as

find_package(IntelMKL REQUIRED CONFIG)
target_link_library(my_lib PUBLIC IntelMKL::Base)

but currently it's much more involved.

Standard modules (FindLAPACK and FindBLAS) do not cover all usages of MKL.

3rd party implementations of FindMKL module (PyTorch and AmberMD) seems to be incomplete, with questionable compatibility and configurational freedom:

https://github.com/pytorch/pytorch/blob/master/cmake/Modules/FindMKL.cmake

https://gist.github.com/multiplemonomials/6ee074038778a21cd25b73659a6a82d9

 

TCE Open Date: 

Tuesday, February 18, 2020 - 10:31

Converting constructor issue with std::variant

$
0
0

Apologies if the issue was already reported but have a look at the following code snippet

#include <variant>

std::variant<int, char*> foo()
{
    return 0xD;
}

This should compile by choosing the converting constructor overload of the variant whose definition is

template< class T >
constexpr variant(T&& t) noexcept(...);

but it does not compile as can be seen here.

Compiler flags used: -std=c++17 -O3 -Wall -Werror

Compiler version: v19.0.1

TCE Level: 

TCE Open Date: 

Tuesday, February 4, 2020 - 01:36

The behavior ICC triggers unused_function warning is odd

$
0
0

I'm using ICC Version 19.0.6 Build 20191202 to build on Ubuntu 18.04.1.  

I found that the warning [-Wunused_function] only take class into consideration, meaning if the member function of a class is never referenced, it trigger the warning, however while if a free function is never referenced, no such warning will be shown. I also try on GCC, which shows a opposite behavior.

For example, the following cpp codes will trigger no warning by ICC, but a warning [-Wunused_function] by GCC.

static void SFoo() { return;}

int main()
{
    return 0;
}

 

Is the behavior of ICC expected?  

 

TCE Open Date: 

Friday, February 21, 2020 - 01:13

How are we supposed to migrate from #pragma simd?

$
0
0

If I try

double* ptr1;
double* ptr2;
__assume_aligned(ptr1, 64);
__assume_aligned(ptr2, 64);
#pragma simd
for (int i=0; i<n; ++i)
   ptr1[i] = ptr2[i];

it will vectorise the loop with aligned access, but gives a warning that #pragma simd is deprecated.

If I swap "simd" for "vector aligned", it does not vectorise and  the optimisation report says "use the simd directive".

The documentation for #pragma simd (https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-simd) doesn't mention deprecation or any alternatives.

Is there any documentation/articles that tells us how we are supposed to do this these days?

TCE Open Date: 

Sunday, February 23, 2020 - 10:41

ICPC compiler core dump mcpcom

$
0
0

Good Afternoon

I have been running into an issue when compiling using the 2020 parallel studio XE.
I am compiling the SLATE libraries. There is no issue with the configuration of the Intel compilers and including and linking MKL
However, during some of the build steps, I encounter

": internal error: ** The compiler has encountered an unexpected problem.
** Segmentation violation signal raised. **
Access violation or stack overflow. Please contact Intel Support for assistance.

icpc: error #10105: /opt/intel/compilers_and_libraries_2020.0.166/linux/bin/intel64/mcpcom: core dumped
icpc: warning #10102: unknown signal(1440094384)
icpc: error #10106: Fatal error in /opt/intel/compilers_and_libraries_2020.0.166/linux/bin/intel64/mcpcom, terminated by unknown

which halts the compilation. I removed the optimization flags based on some much older threads I saw but this didn't seem to help. I believe all the includes are correct and I was able to compile using gcc. Linking is also fine but should be irrelevant at this stage. 

Any assistance would be appreciated. I can provide OS and PATH's if needed.

 

TCE Open Date: 

Friday, February 21, 2020 - 14:29

Error Compiling python 3.8.1 with icc 2020

$
0
0

I'm trying to build Python 3.8.1 on ICC and getting the following error

/opt/intel/bin/xiar rcs libpython3.8.a Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/token.o  Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/hamt.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/peephole.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o    Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.o Python/frozen.o
xiar: executing 'ar'
/opt/intel/bin/icc -pthread     -Xlinker -export-dynamic -o python Programs/python.o libpython3.8.a -lcrypt -lpthread -ldl  -lutil -lm   -lm 
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
    echo "generate-posix-vars failed" ; \
    rm -f ./pybuilddir.txt ; \
    exit 1 ; \
fi
Segmentation fault (core dumped)
generate-posix-vars failed
Makefile:591: recipe for target 'pybuilddir.txt' failed
 

 

Any idea what's going on ?

 

thanks

TCE Open Date: 

Saturday, February 22, 2020 - 16:55

Where is the x32 ABI compiler libraries?

$
0
0

I am using icc19.4 on ubuntu18.

I want to use -mx32 option to generate some Linux x32 ABI object files and link the x32-compatible libraries (libimf.so and libirc.so).

But I didn't found the x32-compatible libraries in the directory icc19.4/compiler/lib.

So how to do it?

TCE Open Date: 

Monday, February 24, 2020 - 17:38

Undefined reference to explicitly instantiated template with template template parameter and alias template

$
0
0

Hello everyone, I would like to report a bug in the Intel C++ compiler regarding alias templates.

I am attaching a MWE consisting of the following files:

// RFASolver.h

#ifndef RFASOLVER_H
#define RFASOLVER_H

class BioLinearisedSolver
{
};

template <typename BSP>
class RFALinearisedSolver
{
};

template <template <typename> class RFASolverPolicy, typename BioSolverPolicy>
class RFASolver
{
public:
    void run();
};

#endif /* end of include guard: RFASOLVER_H */

 

// RFASolver.cpp

#include "RFASolver.h"

template <template <typename> class RFASolverPolicy, typename BioSolverPolicy>
void RFASolver<RFASolverPolicy, BioSolverPolicy>::run()
{
}

template class RFALinearisedSolver<BioLinearisedSolver>;

template class RFASolver<RFALinearisedSolver, BioLinearisedSolver>;

 

// rfa.cpp

#include "RFASolver.h"

template <typename T>
using RFASolverPolicy = RFALinearisedSolver<T>;

int main(int argc, char* argv[])
{
    RFASolver<RFASolverPolicy, BioLinearisedSolver> rfaSolver;

    rfaSolver.run();

    return 0;
}

 

Now, this code compiles fine with g++, but with icpc version 19.0.1.144, compiling with

icpc -pedantic -std=c++14 -c RFASolver.cpp -o RFASolver.o
icpc -pedantic -std=c++14 -c rfa.cpp -o rfa.o
icpc -o rfa RFASolver.o rfa.o -pedantic -std=c++14

 

I get

 

rfa.cpp:(.text+0x30): undefined reference to `RFASolver<RFASolverPolicy, BioLinearisedSolver>::run()'

 

However, if I remove the alias template and use its value directly, as in

 

#include "RFASolver.h"

int main(int argc, char* argv[])
{
    RFASolver<RFALinearisedSolver, BioLinearisedSolver> rfaSolver;

    rfaSolver.run();

    return 0;
}

 

it links fine, meaning the bug seems to be related to the use of an alias template.

I understand users like me cannot report bugs directly, is this correct? Can you please report this bug?

In case this matters, I am compiling on an HPC cluster based on Intel architecture. I tried two different clusters and multiple versions of icpc and the result is always the same.

AttachmentSize
Downloadtext/x-c++srcrfa.cpp236 bytes
Downloadtext/x-c++srcRFASolver.cpp290 bytes
Downloadtext/x-chdrRFASolver.h301 bytes

TCE Open Date: 

Tuesday, February 25, 2020 - 08:49

where can we find command line options of mcpcom

$
0
0

Hi Folks,

I want to modify the command line options for mcpcom like -mGLOB etc but no idea where are these found.

This is related to a problem where I am trying to compile the binaries with check-pointers options but getting errors of undefined symbols for _intel_fast_memmove, __intel_sse2_strlen, __intel_sse2_strchr

 

Also the file libimf.so is not found even though I gave correct path during compilation and linking.

Any suggestions?

TCE Open Date: 

Tuesday, February 25, 2020 - 08:56

backspace still does not work in gdb-ia

$
0
0

This was already noted in post by  mahler, aaron Tue, 01/14/2020 - 08:20.  Post was closed without a resolution.  His second post is missing.

gdb-ia 8.2.1/redhat, shipped with Parallel studio (parallel_studio_xe_2019.5.075) has broken command line.  Backspace does not work with any terminal setting, even though regular gdb works fine. This is definitely gdb-ia frontend bug.

Is there any resolution for this, please?  Debugger is very hard to use because of this bug.

TCE Open Date: 

Thursday, February 27, 2020 - 18:00

Getting hold of Parallel Studio for OpenSource

$
0
0

I'm one the main developers of an Open Source project (DeepSkyStacker) <https://github.com/deepskystacker/DSS>

We currently run code with OpenMP and built on Windows using MSVC but are seriously looking at TBB and Parallel Studio using the Intel Compiler as we want to support MacOS and Linux as well as Windows.

I went to download Parallel Studio for OpenSource projects and found that I was only offered the Linux variant - how can we get hold of the Windows and MacOS version as well please?

Many thanks

David Partridge

TCE Level: 

TCE Open Date: 

Saturday, February 29, 2020 - 21:16

Compiler doesn't serialize calls in OpenMP SIMD loop properly in some (Windows / complex) cases

$
0
0

Description:

When calling a function from a `<complex>` library in a SIMD loop, the Intel Compiler uses implementations provided by Microsoft. These are not SIMD declared functions and from the optimization report it can be seen that some of the function calls are serialized.

The issue is even weirder, it occurs only when the `std::complex` object is constructed right before calling a function on it. See the attached minimal example. In the example. I use `std::exp(const std::complex&)` function and this was originally observed when calculating something like `std::exp(std::complex<float>{0.0, array[i]})` in a SIMD loop. I tried to remove the function call completely and the bug disappears, then I tried a different function (`std::sin(const std::complex&)`) and the bug occurred again.

The bug is Windows-specific and I wasn't able to reproduce it on GNU/Linux.

Compilation of the attached example:

icl /Qx:AVX /Qopenmp-simd /Qopt-report=3 exptest.cpp -o exptest.exe

Example output:

Copy + exp error:       0
SIMD exp error:         3.81745e-16
SIMD copy + exp error:  1.99676
Expanded formula error: 6.14074e-16

Environment:

Intel C++ Compiler Version 19.1.0.166 (but you can obtain the same results with 19.0 versions of the compiler)
Visual Studio 2017 Version 15.9.15 (Visual Studio 2019 was also tested at some point but I cannot remember the results)

 

AttachmentSize
Downloadtext/x-c++srcexptest.cpp3.62 KB

TCE Open Date: 

Monday, March 2, 2020 - 05:20

Request for .deb's

$
0
0

Hello,

In my humble opinion, one feature that would make it tremendously more convenient to use System Studio tools would be to establish an intel linux package repository much like NVIDIA did for CUDA: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=...

I realize that this would be a new packaging format that would be linux specific, but I assume that Intel *wants* folks like me to use these tools now that we can get a 1-year free forum-support license.  Improving the packaging of the goods would make it *so* much easier to install on docker images, build machines, and whatnot -- it would be *so* much easier to upgrade and maintain.

Any up-votes??

Glen

TCE Open Date: 

Monday, March 2, 2020 - 09:24

How to install the static library only?

$
0
0

 

Hello, developers

I am writing to ask some question related installing Parallel studio especially C++ compiler.

To avoid creating shared library(*.so, *.so.*), I was finding some install options to create static library only.

(In GNU compiler, disable-shared & enable-static is works)

But I could not find the similar options during installing C++ comiler via install.sh or install_GUI.sh

Please let me know the option I have found and how to apply.

Thank you all.

TCE Level: 

TCE Open Date: 

Sunday, March 8, 2020 - 15:03

Segmentation violation on simple piece of code

$
0
0

Hello everyone, I am experiencing a nasty bug with icpc version 19.0.1.144. When compiling the following code, that I am also attaching,

class nseh12_cell_integral_0_0
{
public:
  virtual void tabulate_tensor(double* A,
                               const double * const * w) const;
};

void nseh12_cell_integral_0_0::tabulate_tensor(double* A,
                                    const double * const * w) const
{   
    static const double FE0_D001[14][2] = \
    {{-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0},
    {-1.0, 1.0}};

    static const unsigned int nzc2[2] = {0, 1};
    static const unsigned int nzc1[2] = {0, 2};

    A[0] = 0.0;
    for (unsigned int ip = 0; ip < 14; ip++)
    { 

      double F0 = 0.0;
      double F1 = 0.0;

      for (unsigned int r = 0; r < 2; r++)
      { 
        F0 += FE0_D001[ip][r]*w[1][nzc2[r]];
        F1 += FE0_D001[ip][r]*w[1][nzc1[r]];
      }// end loop over 'r'

      double I[1];
      I[0] = F0*F1;

      A[0] += I[0];
    }// end loop over 'ip'
}

 

I get

 

$ icpc -c NSEH12.cpp
": internal error: ** The compiler has encountered an unexpected problem.
** Segmentation violation signal raised. **
Access violation or stack overflow. Please contact Intel Support for assistance.

icpc: error #10105: /cfs/klemming/pdc.vol.beskow/intel/19.0.1.144/compilers_and_libraries_2019.1.144/linux/bin/intel64/mcpcom: core dumped
icpc: warning #10102: unknown signal(1029699696)
icpc: error #10106: Fatal error in /cfs/klemming/pdc.vol.beskow/intel/19.0.1.144/compilers_and_libraries_2019.1.144/linux/bin/intel64/mcpcom, terminated by unknown
compilation aborted for NSEH12.cpp (code 1)

 

This used to work with icpc v17 and stopped with v18, so it seems to be a regression.

Can anyone reproduce it and, if yes, report the bug upstream?

By the way, compiling with

$ icpc -fast -c NSEH12.cpp

works fine.

Thanks and best regards,
Massimiliano Leoni

AttachmentSize
Downloadtext/x-c++srcNSEH12.cpp1.04 KB

TCE Open Date: 

Monday, March 9, 2020 - 10:03

Parsing Error templated constexpr member variable

$
0
0

Description:

When intializing a static constexpr class member variable using a brace-enclosed expression, compilation fails with error "expected a ")"".

Affected Versions:

icpc (ICC) 19.1.0.166 20191121

Minimal example:

class Test
{
template< typename Foo >
static constexpr bool UseSMPAssign_v =  (true) ;
};

int main(int argc, char** argv)
{
    return 0;
}

 

Expected Result:

Minimal example compiles without errors

Actual Result:

Compilation Fails with

testmain2.cpp(4): error: expected a ")"
  static constexpr bool UseSMPAssign_v =  (true) ;
                                                 ^

compilation aborted for testmain2.cpp (code 2)

Other Compilers:

GCC 8.3 and 9.2 are compiling the example

Note:

Omitting the Braces fixes the issue, but syntactically there should be nothing wrong adding them.

TCE Level: 

TCE Open Date: 

Friday, March 6, 2020 - 05:51

Are Intel C++ Runtime Libraries Complete?

$
0
0

I am using Intel Parallel Studio XE 2020. Do the runtime libraries supplied with the Intel C++ compiler replace all of the functionality supplied by the Microsoft Visual C++ runtime libraries?

If so, how do I keep the DLL I am building in Visual Studio from referencing the Microsoft libraries? This cannot be as simple as using the /NODEFAULTLIB linker option, because when I do this, I get errors like this:

>ipo: : warning #11021: unresolved free
>        Referenced in ipo_1142035obj3.obj
>        Referenced in MSVCRT.lib(delete_scalar.obj)

If the Intel runtime libraries do not completely replace the Microsoft runtime libraries, then what functionality is missing?

TCE Level: 

TCE Open Date: 

Friday, March 6, 2020 - 07:59
Viewing all 2797 articles
Browse latest View live


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