I'm using the intel compiler 19.0.3.199 on ubuntu 18.04 and I have a problem when I include the file immintrin.h.
The error is:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h(41), from ../lib/io/exchange_format.c(38): /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h(615): error: identifier "____m128d" is undefined return (__m128d) __builtin_ia32_vpermilvarpd ((__v2df)__A, ^ In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h(41), from ../lib/io/exchange_format.c(38): /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h(615): error: expected a ")" return (__m128d) __builtin_ia32_vpermilvarpd ((__v2df)__A, ^ In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h(41), from ../lib/io/exchange_format.c(38): /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h(615): internal error: assertion failed at: "shared/cfe/edgcpfe/sys_predef.c", line 485 return (__m128d) __builtin_ia32_vpermilvarpd ((__v2df)__A, ^ compilation aborted for ../lib/io/exchange_format.c (code 4) Makefile:1178: recipe for target '../obj/exchange_format.o' failed
The compiler seems to use the header file of gcc instead of the one in the directory /opt/intel/compilers_and_libraries_2019/linux/include/icc.
If I add the option -I/opt/intel/compilers_and_libraries_2019/linux/include/icc to the makefile rule I can compile this object.
I'd like to understand why icc doesn't look into its own include directories but it looks into the gcc ones.
P.S. I launched the script compilervars.sh before compiling.