简体   繁体   中英

Compiling with icc and MAGMAmic cannot find “complex” system file

I am trying to compile a source file with icc compiler and MAGMAmic library. However I get the following error:

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>
                     ^

The MAGMAmic library has compiled correctly and I can run it's test ok. I have looked at the way testing_dgesv_mic.cpp example compiles and used the same includes and link, however in my case I get the above error.

I have added the following in my .bashrc file in order to get the Intel compilers' and libraries' enviromental variables:

#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

Any ideas what might cause icc to be unable to include the "complex" file?

The file complex really exists in "/opt/intel/compilers_and_libraries_2017.2.174/linux/compiler/include/complex"

icc vesrion is:

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

magmamic version is magmamic-1.4.0

EDIT: Removed unnecessary code comment EDIT2: Added version info.

MAGMAmic is a C++ library and it cannot be used with C code directly.

When icc detects that you want to compile .c++ file it automatically switches to icpc (Intel C++ compiler) which in turn results in the above error.

Solution: Either switch to icpc or rename your files to .c++

This question was answered by mark on the MAGMA forums. Link: http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=1587&p=4442#p4442

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM