- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
i've written the following code:#include
#include
#include "mkl.h"
int main(int argc, char *argv[])
{
MKL_INT n,incx=1,incy=1;
double x[2],y[2],res;
x[0]=1,x[1]=2;
y[0]=1;y[1]=3;
res = DDOT(&n, x, &incx, y, &incy);
return 0;
}
to compute the scalarproduct.
The compiling has completed succesfull with the gcc C compiler.
(I use Anjuta as IDE)
Now I tried to link tho main.o file with the following commandld main.o -L$MKLPATH -lmkl_ia32 -lguide -lpthread
and I got the following errorld: warning: cannot find entry symbol _start; defaulting to 00000000080486f0
main.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
with
MKLPATH="/opt/intel/mkl/9.1.021/lib/32/"
I hope anyone can help me.
Thomas
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks as if you invoked g++ (inadvertently, perhaps by using a .C file type). If you have a reason for not simply using g++ rather than ld to drive the link, you will still need to find out which libraries g++ would have used (at a minimum, -lstdc++). You might find it easier to use lib_serial until you have a reason for using the threaded MKL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello tim18,
thank you for your reply.
Now I run the linker with
g++ main.o -L$MKLPATH -lpthread -lmkl -lmkl_ia32
and
MKLPATH="/opt/intel/mkl/9.1.021/lib_serial/32/"
I got the file a.out and run it, tehn I got the following error message
thomas@linux-q9zf:~/Projects/test/src> ./a.out
./a.out: error while loading shared libraries: libmkl.so: cannot open shared object file: No such file or directory
But I do have such file in the corresponding directory.
thank you for your reply.
Now I run the linker with
g++ main.o -L$MKLPATH -lpthread -lmkl -lmkl_ia32
and
MKLPATH="/opt/intel/mkl/9.1.021/lib_serial/32/"
I got the file a.out and run it, tehn I got the following error message
thomas@linux-q9zf:~/Projects/test/src> ./a.out
./a.out: error while loading shared libraries: libmkl.so: cannot open shared object file: No such file or directory
But I do have such file in the corresponding directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok thank you I solved the problem, now it works.
I run the linker with the following command
thomas@linux-q9zf:~/Projects/test/src> g++ main.o -static -L$MKLPATH -lpthread -lmkl_ia32 -o exe
thomas@linux-q9zf:~/Projects/test/src> ./exe
I run the linker with the following command
thomas@linux-q9zf:~/Projects/test/src> g++ main.o -static -L$MKLPATH -lpthread -lmkl_ia32 -o exe
thomas@linux-q9zf:~/Projects/test/src> ./exe
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