这是linux中的命令行:
icc test.c -o test.o -L/opt/intel/current/mkl/intel64 -I/opt/intel/current/mkl/include -lmkl_intel_ilp64 -lmkl_core -lmkl_scalapack_ilp64
运行此命令后:我得到了一长串未定义的参考错误。我也在 eclipse 中尝试过,但也无法解决那里的链接问题。如果有人帮助我运行这样的小代码,我会很高兴:
//test.c- a sample code from user guide
#include "mkl.h"
#define N 5
void main()
{
int n, inca = 1, incb = 1, i;
typedef struct{ double re; double im; } complex16;
complex16 a[N], b[N], c;
void zdotc();
n = N;
for( i = 0; i < n; i++ ){
a[i].re = (double)i; a[i].im = (double)i * 2.0;
b[i].re = (double)(n - i); b[i].im = (double)i * 2.0;
}
zdotc( &c, &n, a, &inca, b, &incb );
printf( "The complex dot product is: ( %6.2f, %6.2f) ", c.re, c.im );
}
我的服务器
> MKLROOT: /opt/intel/current/mkl/
> library: $MKLROOT/lib/intel64/
> include:$MKLROOT/include
已安装 ICC 64 位。
提前致谢。