- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I tried a bunch of things to link my (correctly) compiled c++ object code with mkl but all of them failed. Tried compiling static/dynamic ; read the mkl-manual tried a bunch of things there ; changed paths relative etc etc... didn`t work. As an error I get a lot of undefined references, which means something is wrongly linked (right?)
The only files I use from mkl are mkl_dfti.h and mkl_cblas.h .I`m using the intel compiler (vs 10) MKL (vs 10) on a openSUSE 10.2 (i586) and all this on an intell quadcore2 Q9550.
Can someone point out which libraries I should include in the linking process? And if possible give a correct linking line?
Its like I`m looking for a tree but lost in the woods.
PS: I putted my code online together with the makefile http://iks32.fys.kuleuven.be/files/PIC.rar
I tried a bunch of things to link my (correctly) compiled c++ object code with mkl but all of them failed. Tried compiling static/dynamic ; read the mkl-manual tried a bunch of things there ; changed paths relative etc etc... didn`t work. As an error I get a lot of undefined references, which means something is wrongly linked (right?)
The only files I use from mkl are mkl_dfti.h and mkl_cblas.h .I`m using the intel compiler (vs 10) MKL (vs 10) on a openSUSE 10.2 (i586) and all this on an intell quadcore2 Q9550.
Can someone point out which libraries I should include in the linking process? And if possible give a correct linking line?
Its like I`m looking for a tree but lost in the woods.
PS: I putted my code online together with the makefile http://iks32.fys.kuleuven.be/files/PIC.rar
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - svangorp
The only files I use from mkl are mkl_dfti.h and mkl_cblas.h .I`m using the intel compiler (vs 10) MKL (vs 10) on a openSUSE 10.2 (i586) and all this on an intell quadcore2 Q9550.
Can someone point out which libraries I should include in the linking process? And if possible give a correct linking line?
Its like I`m looking for a tree but lost in the woods.
PS: I putted my code online together with the makefile http://iks32.fys.kuleuven.be/files/PIC.rar
Can someone point out which libraries I should include in the linking process? And if possible give a correct linking line?
Its like I`m looking for a tree but lost in the woods.
PS: I putted my code online together with the makefile http://iks32.fys.kuleuven.be/files/PIC.rar
Hi,
I didn't see your attachment, though, a few tips (you can post a valid lines here, so everybody can take a look and offer some help).
Table 5-3 Computational libraries to link, by function domain (page 5-9 in User's Manual) is always helpful when trying to find what to link. It seems you need FFT and CBLAS, so you need to link to mkl_core.lib only (as far as computational libs are concerned).
You need alsothreading and RTL libs depending on your architecture (IA32, intel-64, IA64). I assume the simple case, that you have IA32. Then you need mkl_intel_c.lib (CDECL interface, ***_s.lib is for STDCALL) mkl_intel_thread.lib and libiomp5md.lib (OMP). If you have 64-bit, then you'll need ***_ilp64.lib or ***_lp64.lib (interface).
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply. With the help of the manual I removed my link errors to just a small set :)
At first this is my makefile:
intell_compiler_options="-xT -O3 -no-prec-div -c "
liblocation="/opt/imkl10.0/lib/32"
#Compile all
icpc $intell_compiler_options cylpotsolver.cpp
icpc $intell_compiler_options capmatrix.cpp
icpc $intell_compiler_options create_capmatrix.cpp
#Link all
icpc -O3 -no-prec-div -o test01 create_capmatrix.o capmatrix.o cylpotsolver.o $liblocation/libmkl_blacs.a $liblocation/libmkl_core.so $liblocation/libmkl_intel.so $liblocation/libmkl_intel_thread.so $liblocation/libiomp5.so $liblocation/libmkl_lapack.so
And I got these link errors:
cylpotsolver.o: In function `_ZN12cylpotsolver12solveLinSys2Ev.':
cylpotsolver.cpp:(.text+0x51c): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x569): undefined reference to `pardiso_'
cylpotsolver.o: In function `cylpotsolver::solveLinSys()':
cylpotsolver.cpp:(.text+0x32b1): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x3305): undefined reference to `pardiso_'
/opt/imkl10.0/lib/32/libiomp5.so: undefined reference to `pthread_atfork'
Furthermore. I believe I`m working on a 64bit CPU so if I try to use the /lib/64 instead of /lib/32 I get the error:
"/opt/imkl10.0/lib/64/libmkl_core.so: could not read symbols: File in wrong format"
Which is weird because the file existst.
PS: I uploaded my files to http://iks32.fys.kuleuven.be/files/PIC.rar so you can try it yourself.
At first this is my makefile:
intell_compiler_options="-xT -O3 -no-prec-div -c "
liblocation="/opt/imkl10.0/lib/32"
#Compile all
icpc $intell_compiler_options cylpotsolver.cpp
icpc $intell_compiler_options capmatrix.cpp
icpc $intell_compiler_options create_capmatrix.cpp
#Link all
icpc -O3 -no-prec-div -o test01 create_capmatrix.o capmatrix.o cylpotsolver.o $liblocation/libmkl_blacs.a $liblocation/libmkl_core.so $liblocation/libmkl_intel.so $liblocation/libmkl_intel_thread.so $liblocation/libiomp5.so $liblocation/libmkl_lapack.so
And I got these link errors:
cylpotsolver.o: In function `_ZN12cylpotsolver12solveLinSys2Ev.':
cylpotsolver.cpp:(.text+0x51c): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x569): undefined reference to `pardiso_'
cylpotsolver.o: In function `cylpotsolver::solveLinSys()':
cylpotsolver.cpp:(.text+0x32b1): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x3305): undefined reference to `pardiso_'
/opt/imkl10.0/lib/32/libiomp5.so: undefined reference to `pthread_atfork'
Furthermore. I believe I`m working on a 64bit CPU so if I try to use the /lib/64 instead of /lib/32 I get the error:
"/opt/imkl10.0/lib/64/libmkl_core.so: could not read symbols: File in wrong format"
Which is weird because the file existst.
PS: I uploaded my files to http://iks32.fys.kuleuven.be/files/PIC.rar so you can try it yourself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your specification of i586 OS implies that you installed the 32-bit linux. If you would install the x86_64, you could use the corresponding compilers and libraries, but you can't mix them with 32-bit objects and libraries. The Itanium MKL libraries which you are interested in will not work on your Core 2 QuAD, regardless of which OS you install. The weird part is your idea that you could emulate Itanium 64-bit under the 32-bit OS.
Assuming there is a dynamic version of mkl_blacs, wouldn't that be a better choice along with the other dynamic libraries?
Are you telling us that you are using an old Intel 10.0 compiler (which doesn't include libiomp5) along with a more up to date MKL? If so, and you wish to use libiomp5, you must avoid using any OpenMP or parallel in the compiler, specify the libiomp5 explicitly in the link (as you did), and also specify -lpthread, as the examples show you.
I don't see how a .rar file would help many of the people reading this.
Assuming there is a dynamic version of mkl_blacs, wouldn't that be a better choice along with the other dynamic libraries?
Are you telling us that you are using an old Intel 10.0 compiler (which doesn't include libiomp5) along with a more up to date MKL? If so, and you wish to use libiomp5, you must avoid using any OpenMP or parallel in the compiler, specify the libiomp5 explicitly in the link (as you did), and also specify -lpthread, as the examples show you.
I don't see how a .rar file would help many of the people reading this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - svangorp
Thanks for the reply. With the help of the manual I removed my link errors to just a small set :)
At first this is my makefile:
intell_compiler_options="-xT -O3 -no-prec-div -c "
liblocation="/opt/imkl10.0/lib/32"
#Compile all
icpc $intell_compiler_options cylpotsolver.cpp
icpc $intell_compiler_options capmatrix.cpp
icpc $intell_compiler_options create_capmatrix.cpp
#Link all
icpc -O3 -no-prec-div -o test01 create_capmatrix.o capmatrix.o cylpotsolver.o $liblocation/libmkl_blacs.a $liblocation/libmkl_core.so $liblocation/libmkl_intel.so $liblocation/libmkl_intel_thread.so $liblocation/libiomp5.so $liblocation/libmkl_lapack.so
And I got these link errors:
cylpotsolver.o: In function `_ZN12cylpotsolver12solveLinSys2Ev.':
cylpotsolver.cpp:(.text+0x51c): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x569): undefined reference to `pardiso_'
cylpotsolver.o: In function `cylpotsolver::solveLinSys()':
cylpotsolver.cpp:(.text+0x32b1): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x3305): undefined reference to `pardiso_'
/opt/imkl10.0/lib/32/libiomp5.so: undefined reference to `pthread_atfork'
Furthermore. I believe I`m working on a 64bit CPU so if I try to use the /lib/64 instead of /lib/32 I get the error:
"/opt/imkl10.0/lib/64/libmkl_core.so: could not read symbols: File in wrong format"
Which is weird because the file existst.
PS: I uploaded my files to http://iks32.fys.kuleuven.be/files/PIC.rar so you can try it yourself.
At first this is my makefile:
intell_compiler_options="-xT -O3 -no-prec-div -c "
liblocation="/opt/imkl10.0/lib/32"
#Compile all
icpc $intell_compiler_options cylpotsolver.cpp
icpc $intell_compiler_options capmatrix.cpp
icpc $intell_compiler_options create_capmatrix.cpp
#Link all
icpc -O3 -no-prec-div -o test01 create_capmatrix.o capmatrix.o cylpotsolver.o $liblocation/libmkl_blacs.a $liblocation/libmkl_core.so $liblocation/libmkl_intel.so $liblocation/libmkl_intel_thread.so $liblocation/libiomp5.so $liblocation/libmkl_lapack.so
And I got these link errors:
cylpotsolver.o: In function `_ZN12cylpotsolver12solveLinSys2Ev.':
cylpotsolver.cpp:(.text+0x51c): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x569): undefined reference to `pardiso_'
cylpotsolver.o: In function `cylpotsolver::solveLinSys()':
cylpotsolver.cpp:(.text+0x32b1): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x3305): undefined reference to `pardiso_'
/opt/imkl10.0/lib/32/libiomp5.so: undefined reference to `pthread_atfork'
Furthermore. I believe I`m working on a 64bit CPU so if I try to use the /lib/64 instead of /lib/32 I get the error:
"/opt/imkl10.0/lib/64/libmkl_core.so: could not read symbols: File in wrong format"
Which is weird because the file existst.
PS: I uploaded my files to http://iks32.fys.kuleuven.be/files/PIC.rar so you can try it yourself.
As Tim pointed out, it seems that you mixed up couple of things that don't go together. Apart from sorting system/architecture/installed libs/compiler/MKL version, your link should contain something along the lines: -L$MKLPATH -lmkl_blas95 -lguide -lpthread .... (example), shouldn't it?
and from Realese Notes
If you use dynamic linking (libguide.so (libiomp5d as well)) of Intel MKL (recommended), make sure the LD_LIBRARY_PATH is defined so that exactly this version of libguide is found and used at runtime.
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - ArturGuzik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
Your specification of i586 OS implies that you installed the 32-bit linux. If you would install the x86_64, you could use the corresponding compilers and libraries, but you can't mix them with 32-bit objects and libraries. The Itanium MKL libraries which you are interested in will not work on your Core 2 QuAD, regardless of which OS you install. The weird part is your idea that you could emulate Itanium 64-bit under the 32-bit OS.
Assuming there is a dynamic version of mkl_blacs, wouldn't that be a better choice along with the other dynamic libraries?
Are you telling us that you are using an old Intel 10.0 compiler (which doesn't include libiomp5) along with a more up to date MKL? If so, and you wish to use libiomp5, you must avoid using any OpenMP or parallel in the compiler, specify the libiomp5 explicitly in the link (as you did), and also specify -lpthread, as the examples show you.
I don't see how a .rar file would help many of the people reading this.
Assuming there is a dynamic version of mkl_blacs, wouldn't that be a better choice along with the other dynamic libraries?
Are you telling us that you are using an old Intel 10.0 compiler (which doesn't include libiomp5) along with a more up to date MKL? If so, and you wish to use libiomp5, you must avoid using any OpenMP or parallel in the compiler, specify the libiomp5 explicitly in the link (as you did), and also specify -lpthread, as the examples show you.
I don't see how a .rar file would help many of the people reading this.
I changed everything to 32bit because the OS is indeed a 32-bit linux (confused by my quadcore CPU which is 64-bit ready).
As compiler I am using the 10.0 compiler with the 10.0 version of MKL. If I use the version 11 of the Compiler can I than use libiomp5 with OpenMP and Parallellism, Or what is the problem with libiomp5?
Thanks you for pointing out -lpthread; this removes the /opt/imkl10.0/lib/32/libiomp5.so: undefined reference to `pthread_atfork' error.
In the .rar file you find the files I try to compile. But for the ease I added my files to this reply as well.
And /opt/imkl10.0/lib/32 is included in LD_LIBRARY_PATH
I also tried the options -lmkl_blas95 which the linker could not found. And the option -lguide didn`t improved on my link erorrs.
For some reason I`m still stuck with
cylpotsolver.o: In function `_ZN12cylpotsolver12solveLinSys2Ev.':
cylpotsolver.cpp:(.text+0x492): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x4e2): undefined reference to `pardiso_'
cylpotsolver.o: In function `cylpotsolver::solveLinSys()':
cylpotsolver.cpp:(.text+0x2ea7): undefined reference to `pardiso_'
cylpotsolver.cpp:(.text+0x2ef4): undefined reference to `pardiso_'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also tried the options -lmkl_blas95 which the linker could not found. And the option -lguide didn`t improved on my link erorrs.
This one is easy. -lmkl_blas95 is an interface to BLAS lib in Fortran 95. You use C++ so obviously don't have it. I actually went as far as trying to build your project (on Windows x64) and receive compilation errors. Will go back to this tomorrow. Are the newer files attached modified comparing to *.rar?
A.
Edit: actually I just realized that it's my fault, showing (and misleading) you the linker line. I wrote (example) and intended as it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The 11.0 compiler includes an integrated installation of MKL, and libiomp5 is the default library for the -openmp option in the compiler. So, linking with -openmp set would take care of libiomp5 and libpthread, without requiring any PATH setting beyond what is already in the compile environment.
As libiomp5 was introduced in 10.1, the -openmp option in 10.0 would not work with libiomp5. 10.1 has a "compatibility" option to work with libiomp5, while "legacy" in 10.1 and 11.0 mean the libguide used from 8.0 through 10.0. "compatibility" doesn't follow the Red Hat usage of that term. libiomp5 for linux supports the gcc/g++/gfortran -fopenmp as well as the Intel -openmp.
As libiomp5 was introduced in 10.1, the -openmp option in 10.0 would not work with libiomp5. 10.1 has a "compatibility" option to work with libiomp5, while "legacy" in 10.1 and 11.0 mean the libguide used from 8.0 through 10.0. "compatibility" doesn't follow the Red Hat usage of that term. libiomp5 for linux supports the gcc/g++/gfortran -fopenmp as well as the Intel -openmp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for all the reply's guys, linking issues are now solved. The project compiles like a charm ;)
For future readers of this thread the link line that worked:
icpc -o test01 create_capmatrix.o capmatrix.o cylpotsolver.o -L$IMKLSYS $liblocation/libmkl_blacs.a $liblocation/libmkl_core.so $liblocation/libmkl_intel.so $liblocation/libmkl_intel_thread.so $liblocation/libiomp5.so $liblocation/libmkl_lapack.so $liblocation/libmkl_solver.a -lpthread
For future readers of this thread the link line that worked:
icpc -o test01 create_capmatrix.o capmatrix.o cylpotsolver.o -L$IMKLSYS $liblocation/libmkl_blacs.a $liblocation/libmkl_core.so $liblocation/libmkl_intel.so $liblocation/libmkl_intel_thread.so $liblocation/libiomp5.so $liblocation/libmkl_lapack.so $liblocation/libmkl_solver.a -lpthread

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