Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

simple example

joleho
初学者
2,009 次查看
Hi,

I am new in Blas and Lapack and have probably a very simple question. I installed the MKL library 10 and tried to run the example from the User Guide for C++ but I got the error:

g++ -o tmp testblas2.cc -L$MKLPATH -I$MKLINCLUDE -lmkl

testblas2.cc:4: error: declaration of C function `void zdotc(complex16*, int*, complex16*, int*, complex16*, int*)' conflicts with
/opt/intel/mkl/10.0/include/mkl_blas.h:297: error: previous declaration `void zdotc(MKL_Complex16*, int*, MKL_Complex16*, int*, MKL_Complex16*, int*)' here
testblas2.cc:9: error: `main' must return `int'
testblas2.cc: In function `int main(...)':

what is wrong?

Jojo

0 项奖励
4 回复数
TimP
名誉分销商 III
2,009 次查看
You may have a more recent version of g++ than what testblas2 was written for, or the example may not be updated for consistency with MKL 10. It's better to rely entirely on the header file, and remove the conflicting declaration from the example source.
0 项奖励
joleho
初学者
2,009 次查看
Sorry, its not clear to me what to do?
May icc work for this example?
0 项奖励
TimP
名誉分销商 III
2,009 次查看
icc may not be as strict in comparing syntax as the latest g++ is, so it may work.
0 项奖励
joleho
初学者
2,009 次查看

Forall bloody beginners (like me)having the same problem:

#include "mkl_typse.h"

MKL_Complex16* a;

compile with:

g++ -o tmp testblas.cc -L$MKLPATH -I$MKLINCLUDE -lmkl -lguide -lpthread

then its fine...

0 项奖励
回复