Unable to link Intel MKL
I'm unable to link my program correctly. I use the following command line, but get an error.
g++ -I/home/blah/intel/composerxe/mkl/include dotProduct.cpp /home/blah/intel/composerxe/mkl/lib/intel64/libmkl_core.a
The output is this:
/tmp/ccvw6w13.o: In function `main':
dotProduct.cpp:(.text+0x108): undefined reference to `cblas_sdot'
col开发者_运维知识库lect2: ld returned 1 exit status
I also tried running a script that tries to link one by one against all .a files, but they all fail. Can anybody please suggest a solution. Thanks.
Here's a KB article from Intel:
http://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-for-linux-linking-applications-with-intel-mkl-version-100/
On a side note, if you can use Intel compiler instead of gcc, this works (at least it does for me):
icpc files -mkl
Notice there's no l in front, it's just -mkl.
精彩评论