Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Compilation with icc and MAGMAmic fails

Dimitar_S_
Beginner
521 Views

Hello,

I am trying to compile code that uses the magma_dgesv_mic routine.

1. The compilation however fails with:
icc -mkl -O3 -qopenmp -DADD_ -Wall -DHAVE_MIC -I/opt/intel/mic/coi/include -I/usr/include/intel-coi -I/home/dslavchev/install/magmamic-1.4.0/include -I/home/dslavchev/install/magmamic-1.4.0/contol -c -o direct.o direct.c
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>
^

compilation aborted for direct.c (code 4)
make: *** [direct.o] Error 4


2. The includes at the beginning of the file are:

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <omp.h>

// MAGMA headers
#include "magma.h"
#include "magma_lapack.h"
#include "magma_types.h"

3. The system is a Red Hat cluster with Intel Xeon Phi coprocessors.

4. MAGMAmic installed correctly and I am able to run testing_dgesv_mic test and see results. When I try to compile my code however it fails with the above error.

Any idea what might cause this?

0 Kudos
2 Replies
Dimitar_S_1
Beginner
521 Views

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

0 Kudos
Viet_H_Intel
Moderator
521 Views

 

Great, you've already found solutions.

 

Regards,

Viet Hoang

0 Kudos
Reply