0

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.

Dimitar Slavchev
  • 192
  • 2
  • 11
  • #include_next in complex header shipped with Intel C++ Compiler 17.0 Update 2 is looking for next available complex header (looking for the one provided by GNU). Which version of GCC are you using? – Anoop - Intel Sep 18 '17 at 16:55
  • I use icc (Intel compiler) version 17.0.2 – Dimitar Slavchev Sep 18 '17 at 20:11
  • and which GCC compatibility mode are you running ICC. You can get this info by running the following command icc -v – Anoop - Intel Sep 18 '17 at 21:16
  • I think it was 4.7.2, I will check when I am back at the lab. The wierd thing here is that Magma uses the same options to compile testing_dgesv_mic and it compiles correctly for them, but not for me. – Dimitar Slavchev Sep 19 '17 at 06:53
  • [dslavchev@sl051 results]$ icc -v icc version 17.0.2 (gcc version 4.4.7 compatibility) – Dimitar Slavchev Sep 19 '17 at 09:06

1 Answers1

0

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

Dimitar Slavchev
  • 192
  • 2
  • 11