使用icc和MAGMAmic进行编译无法找到“复杂”的系统文件

时间:2017-09-15 12:31:59

标签: icc magma

我正在尝试使用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示例编译和使用相同的包含和链接的方式,但在我的情况下,我得到了上述错误。

我在.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无法包含“复杂”文件的想法?

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

icc vesrion是:

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

magmamic版本是magmamic-1.4.0

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

1 个答案:

答案 0 :(得分:0)

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

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

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

MAGMA论坛上的标记回答了这个问题。链接: http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=1587&p=4442#p4442