Compilation with icc and MAGMAmic fails

Compilation with icc and MAGMAmic fails

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?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

 

Great, you've already found solutions.

 

Regards,

Viet Hoang

Leave a Comment

Please sign in to add a comment. Not a member? Join today