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

[SOLVED] Compilation error

matse
Beginner
904 Views
Hello again...,
so I just wanted to compile my first program that uses IMKL.
I chose one example from the userguide, it's in
$MKL_Install_Path/Documentation/en_US/mkl/mkl_userguide/MKL_UG_coding_calls/Calling_BLAS_Functions_that_Return_the_Complex_Values_in_C_C.htm

And here is the code:

[cpp]#include 
#include 
#define MKL_Complex16 std::complex
#include"/opt/intel/composerxe/mkl/include/mkl.h" //adjusted to my needs
#define N 5

int main()
{
        int n; int inca = 1, incb = 1, i;
        std::complex a, b, c;
        n = N;
        
        for( i = 0; i < n; i++ ){
                a = std::complex(i,i*2.0);
                b = std::complex(n-i,i*2.0);
        }
        zdotc(&c, &n, a, &inca, b, &incb );
        std::cout << "The complex dot product is: " << c << std::endl;
        return 0;
}[/cpp]

I used the Parameters from the Link Advisor Website for compiling / Linking (http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ ) and tried:

[bash]g++ -Wall -DMKL_ILP64  -m64 -c main.cpp[/bash]

Unfortunately this leads to the following error:

[plain]main.cpp:26:42: error: cannot convert int* to const long long int* for argument 2 to void zdotc(std::complex*, const long long int*, const std::complex*, const long long int*, const std::complex*, const long long int*)[/plain]

Any ideas why this is happening?
matse

//Edit: This problem is also solved... maybe I shouldn't just make a guess about the compiler options... withhout the "-DMKL_ILP64" it works fine.
0 Kudos
0 Replies
Reply