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

Undefined functions in customized shared library on Linux

sspine
Beginner
492 Views
I'm building customized MKL shared libray on Open Suse 10.2. I use the default settings in "mkl/10.0.3.020/tools/builder/makefile", my list file include some cblas and lapack functions, and my build command is "make threading=serial ia32" to build serial library for ia32 (my processor is intel core2).

The problem is when I try to use the build costomized libray, my application popup error message that several functions (mkl_lapack_*) are not defined. I use "nm -u" to see the undefined functions in my built library, I found many mkl_lapack_* functions undefined, like: mkl_lapack_dgbtrs, mkl_lapack_dgeqrf, ...
I didn't found the similar problems on windows.

My another question: on windows, if you set "threading=serial", libguide will not be included, but on linux, libguide will be included, why?

Thanks!

0 Kudos
8 Replies
TimP
Honored Contributor III
492 Views
The linux versions I'm looking at don't have a "serial" option. Perhaps you mean sequential, like the library name. The point of sequential is it doesn't use OpenMP threading, so doesn't require an OpenMP library (legacy libguide, or the forward compatible libiomp5).
0 Kudos
Amanda_S_Intel
Employee
492 Views

Thanks for reporting this issue with the 'threading=sequential' option in the Custom SO Builder. It is not neccessary tolink tolibguide in this case.This problem is verified and will be fixed in an upcoming release.

Regards,
--Amanda
Intel Corp.

0 Kudos
sspine
Beginner
492 Views
Amanda,

Thans for your reply of my second question. Would you please to have a look at my first question? That is some functions missed in the customized so file, like mkl_lapck_dgbtrs, mkl_lapack_dgeqrf and many other functions. I guess the makefile missed some static libraries.

BTW, the command should be "make threading=sequential ia32", not "serial". Also thanks tim for pointing out this issue.

0 Kudos
TimP
Honored Contributor III
492 Views
By visual inspection, it looks like the makefile should have surrounded the MKL static library references with
-Wl,--start-group ..... -Wl,--end-group
so as to permit resolution of circular references.
0 Kudos
sspine
Beginner
492 Views
Follow the following steps to reproduce my problem:

1. Edit functions_list file with the functions listed in the end.
2. Fetch "make ia32 threading=sequential" in command line to build sequential mkl_custom.so
3. Fetch "nm -u mkl_custom.so" to show undefined symbols in mkl_custom.so, the following undefined functions will show up:
U mkl_lapack_dgbtrf
U mkl_lapack_dgbtrs
U mkl_lapack_dgeqrf
U mkl_lapack_dlabrd
U mkl_lapack_dlaed0
U mkl_lapack_dlasr3
U mkl_lapack_dormlq
U mkl_lapack_dormql
U mkl_lapack_dormqr
U mkl_lapack_dsytrd
U mkl_lapack_zgbtrf
U mkl_lapack_zgbtrs
U mkl_lapack_zgeqrf
U mkl_lapack_zhetrd
U mkl_lapack_zlabrd
U mkl_lapack_zlaed0
U mkl_lapack_zunmlq
U mkl_lapack_zunmql
U mkl_lapack_zunmqr
U mkl_serv_mkl_get_max_threads
4. Build parallel version with the same settings, in addition to the above undefined functions, there are more functions undefined:
U omp_get_max_threads
U omp_get_num_procs
U omp_get_thread_num
U omp_in_parallel

The items in functions_list are:
cblas_dgemm
cblas_dcopy
cblas_dsyrk
cblas_ddot
cblas_daxpy
cblas_dgemv
cblas_dnrm2
cblas_dscal
cblas_zscal
cblas_dznrm2
cblas_zgemm
cblas_zcopy
cblas_idamax
cblas_zdotu_sub
cblas_zgemv
cblas_dasum
cblas_drot
cblas_drotg
cblas_drotm
cblas_drotmg
cblas_dswap
cblas_dzasum
cblas_idamin
cblas_izamax
cblas_izamin
cblas_zaxpy
cblas_zdotc_sub
cblas_zswap
cblas_dger
cblas_dsymv
cblas_dsyr
cblas_dsyr2
cblas_dtrmv
cblas_dtrsv
cblas_zgeru
cblas_zgerc
cblas_zhemv
cblas_ztrsv
cblas_dsymm
cblas_dsyr2k
cblas_dtrmm
cblas_dtrsm
cblas_zhemm
cblas_zher2k
cblas_zherk
cblas_zsymm
cblas_zsyr2k
cblas_zsyrk
cblas_ztrmm
cblas_ztrsm
cblas_ztrmv
zdrot
zrotg_
dpptrs
dpptri
dgetri
dgebak
dgetrf
dpotrf
dgeev
dgesv
dposv
dgelsd
dggsvd
dorghr
dgehrd
dpotri
dtrsyl
dgees
dorglq
dgelqf
dgeqp3
dtrexc
dlapy2
dsyevd
dtgevc
dtgexc
dgbsv
dpptrf
dtrtri
dgebal
d orgqr
dgesdd
dhgeqz
dgghrd
dtptrs
dtptri
zgbsv
zpptrs
zpptri
zpptrf
zgetri
zunghr
zgehrd
zpotri
zgeev
zheevd
ztptri
ztptrs
zgghrd
zhgeqz
zgetrf
zpotrf
zgebak
zgesv
zposv
zggsvd
ztrtri
ztrsyl
zgees
zgebal
zunglq
zgelqf
zungqr
zgeqp3
ztrexc
zgesdd
ztgexc
ztgevc


0 Kudos
sspine
Beginner
492 Views
Anymore ideas?

0 Kudos
Todd_R_Intel
Employee
492 Views
Did you try the grouping suggestion from tim18? Amanda suggested there were some known issues to be fixed, so you might need to edit the makefile to add to the link line.
-Todd
0 Kudos
sspine
Beginner
492 Views
Finally, I got it work for parallel. There are still undefined symbols for sequential. But fortunately, I do not need sequential one.

I did not find related information on "Known issues of Intel MKL 10.0 for Linux" web page. I think anyone want to build custom SO on linux will encounter the bug like me. In another word, the custom shared library feature on linux Intel announced can NOT work. You even did not test it! I'm surprised Intel did not aware this is a serious problem.
0 Kudos
Reply