用 icc 和 MAGMAmic 编译找不到 "complex" 系统文件

Compiling with icc and MAGMAmic cannot find "complex" system file

我正在尝试使用 icc 编译器和 MAGMAmic 库编译源文件。但是我收到以下错误:

icc -c -o  direct.o direct.c -O3 -openmp -DADD_ -Wall -DHAVE_MIC -I/opt/intel/mic/coi/include -I/usr/include/intel-coi -I/opt/intel/compilers_and_libraries_2017.2.174/linux/mkl/include:/opt/intel/compilers_and_libraries_2017.2.174/linux/ipp/include:/opt/intel/compilers_and_libraries_2017.2.174/linux/mkl/include:/opt/intel/compilers_and_libraries_2017.2.174/linux/tbb/include:/opt/intel/compilers_and_libraries_2017.2.174/linux/daal/include -I/home/dslavchev/install/magmamic-1.4.0/include -I/home/dslavchev/install/magmamic-1.4.0/contol
icc: command line remark #10411: option '-openmp' is deprecated and will be removed in a future release. Please use the replacement option '-qopenmp'
In file included from /home/dslavchev/install/magmamic-1.4.0/include/magma_types.h(134),
             from /home/dslavchev/install/magmamic-1.4.0/include/magmablas_z.h(17),
             from /home/dslavchev/install/magmamic-1.4.0/include/magmablas.h(12),
             from /home/dslavchev/install/magmamic-1.4.0/include/magma.h(17),
             from direct.c(21):
/opt/intel/compilers_and_libraries_2017.2.174/linux/compiler/include/complex(30): catastrophic error: cannot open source file "complex"
#include_next <complex>
                     ^

MAGMAmic 库已正确编译,我可以 运行 测试正常。 我查看了 testing_dgesv_mic.cpp 示例编译的方式并使用了相同的包含和 link,但是在我的例子中我得到了上述错误。

我在我的 .bashrc 文件中添加了以下内容以获取英特尔编译器和库的环境变量:

#for MAGMA mic
export MAGMA_PATH=/home/dslavchev/install/magmamic-1.4.0

source /opt/intel/bin/compilervars.sh  intel64
source /opt/intel/mkl/bin/mklvars.sh  intel64

任何可能导致 icc 无法包含 "complex" 文件的想法?

文件复合体确实存在于“/opt/intel/compilers_and_libraries_2017.2.174/linux/compiler/include/complex”

icc 版本是:

[dslavchev@sl051 results]$ icc -v
icc version 17.0.2 (gcc version 4.4.7 compatibility)

magmamic 版本为 magmamic-1.4.0

编辑:删除了不必要的代码注释 EDIT2:添加了版本信息。

MAGMAmic 是一个 C++ 库,不能直接与 C 代码一起使用。

当 icc 检测到您要编译 .c++ 文件时,它会自动切换到 icpc(Intel C++ 编译器),从而导致上述错误。

解决方案:切换到 icpc 或将文件重命名为 .c++

马克在 MAGMA 论坛上回答了这个问题。 Link: http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=1587&p=4442#p4442