Hi, something seems not right with the functioning of in intel's valarray implementation. I tried using both the previous compilers as well as the most recent 2017 version of icpc. For instance, when we compile with icpc, we find that 0.1 - 0.05 = -0.05, instead of 0.1-0.05 = 0.05. g++ works fine though. Please find attached an example C++ file, and the makefile. Note that the makefile has a .txt extension that needs to be removed, or copy paste its contents in the terminal.
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Parallel Computing
Is it only a problem when you use the -use-intel-optimized-headers switch?
I had to remove the switch because it wouldn't compile for me and I don't see the problem without it.
ptel42-80> make -f makefile.save
icpc -use-intel-optimized-headers simple.cpp -I/opt/intel/mkl/include -L/opt/intel/mkl/lib -Wl,-rpath,/opt/intel/mkl/lib -lmkl_rt -lm
In file included from /rdrive/crunlib/mainline_20170707/efi2/linux_test/include/perf_headers/c++/valarray(47),
/rdrive/crunlib/mainline_20170707/efi2/linux_test/include/perf_headers/c++/ippvalarray(37): catastrophic error: cannot open source file "ipp.h"
compilation aborted for simple.cpp (code 4)
Normally we would just the valarray from GNU but it looks like with that switch we have our own version of valarray.
Sorry about the slightly wrong report, I thought I was using the 2017 version of Intel compiler, while I was using the 2015 version. Everything seems to work fine with the 2017 version. I think this must have already been addressed.
Without the flags -use-intel-optimized-headers I believe we use only GNU's version of valarray (according to Intel's documentation), and GNU's version seems okay for this case, as compiling with g++/gcc produces right results.