- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am just getting started with the Intel C++ compiler and the Intel Math Kernel Library. As a first step I am trying to compile the examples from:
http://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-blas-cblas-and-lapack-compilinglinking-functions-fortran-and-cc-calls/
To setup the environment I run the "C++ Build Environment for applications running on Intel 64" bat file to start the command window. Then I run the "F:\\Intel\\MKL\\10.2.5.035\\tools\\environment\\mklvars64.bat" file to set the MKL environment variables.
Then I attempt to compile with icl:
icl main.cpp
The error that I get is:
main.cpp(5): error: more than one instance of overloaded function "cblas_zdotc_sub" has "C" linkage
#include
#include "mkl.h"
typedef struct{ double re; double im; } complex16;
extern "C" void cblas_zdotc_sub(complex16*, int *, complex16 *, int *, complex16 *, int *);
#define N 5
int main()
{
int n, inca = 1, incb = 1, i;
complex16 a, b, c;
n = N;
for( i = 0; i < n; i++ ){
a.re = (double)i; a.im = (double)i * 2.0;
b.re = (double)(n - i); b.im = (double)i * 2.0;
}
cblas_zdotc_sub(&c, &n, a, &inca, b, &incb );
printf( "The complex dot product is: ( %6.2f, %6.2f) ", c.re, c.im );
return 0;
}
I am just getting started with the Intel C++ compiler and the Intel Math Kernel Library. As a first step I am trying to compile the examples from:
http://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-blas-cblas-and-lapack-compilinglinking-functions-fortran-and-cc-calls/
To setup the environment I run the "C++ Build Environment for applications running on Intel 64" bat file to start the command window. Then I run the "F:\\Intel\\MKL\\10.2.5.035\\tools\\environment\\mklvars64.bat" file to set the MKL environment variables.
Then I attempt to compile with icl:
icl main.cpp
The error that I get is:
main.cpp(5): error: more than one instance of overloaded function "cblas_zdotc_sub" has "C" linkage
extern "C" void cblas_zdotc_sub(complex16*, int *, complex16 *, int *, complex16 *, int *);
I have tried various permutations of linking -lmkl libraries and different command line options. Can anyone provide some advice? Thanks.
Bob
The exact source code is:
#include
#include "mkl.h"
typedef struct{ double re; double im; } complex16;
extern "C" void cblas_zdotc_sub(complex16*, int *, complex16 *, int *, complex16 *, int *);
#define N 5
int main()
{
int n, inca = 1, incb = 1, i;
complex16 a
n = N;
for( i = 0; i < n; i++ ){
a.re = (double)i; a.im = (double)i * 2.0;
b.re = (double)(n - i); b.im = (double)i * 2.0;
}
cblas_zdotc_sub(&c, &n, a, &inca, b, &incb );
printf( "The complex dot product is: ( %6.2f, %6.2f) ", c.re, c.im );
return 0;
}
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bob,
let's try to modify the code:
complex16 res;
//cblas_zdotc_sub(&c, &n, a, &inca, b, &incb );
cblas_zdotc_sub( n, a, inca, b, incb, &res );
--Gennady
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page