Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
6681 Discussions

error compiling mkl example :undefined reference to GetIntegerParameters

liunsteingmail_com
1,292 Views
~/Desktop $ gcc -o test cblas_zgbmvx.c -Wl,-rpath=/opt/intel/mkl/10.1.3.027/lib/32 -L/opt/intel/mkl/10.1.3.027/lib/32 -lmkl_gf -liomp5 -lmkl_intel -lmkl_intel_thread -lmkl_core -lpthread -lm
/tmp/ccETbui0.o: In function `main':
cblas_zgbmvx.c:(.text+0xc9): undefined reference to `GetIntegerParameters'
cblas_zgbmvx.c:(.text+0x103): undefined reference to `GetIntegerParameters'
cblas_zgbmvx.c:(.text+0x13d): undefined reference to `GetScalarsZ'
cblas_zgbmvx.c:(.text+0x177): undefined reference to `GetCblasCharParameters'
cblas_zgbmvx.c:(.text+0x322): undefined reference to `GetVectorZ'
cblas_zgbmvx.c:(.text+0x36e): undefined reference to `GetVectorZ'
cblas_zgbmvx.c:(.text+0x3f4): undefined reference to `GetBandArrayZ'
cblas_zgbmvx.c:(.text+0x492): undefined reference to `PrintParameters'
cblas_zgbmvx.c:(.text+0x4a6): undefined reference to `PrintParameters'
cblas_zgbmvx.c:(.text+0x4d8): undefined reference to `PrintVectorZ'
cblas_zgbmvx.c:(.text+0x50a): undefined reference to `PrintVectorZ'
cblas_zgbmvx.c:(.text+0x568): undefined reference to `PrintBandArrayZ'
cblas_zgbmvx.c:(.text+0x643): undefined reference to `PrintVectorZ'
collect2: ld returned 1 exit status

what should i do ?
thx
0 Kudos
1 Solution
Vladimir_Lunev
New Contributor I
1,291 Views
Yes one more source file need to be compiled - common_func.c.
The other way is to use the provided makefile in the directory examples/cblas to build and run the examples.
This command
>make so32 compiler=gnu function=cblas_zgbmv
will compile the required sources by gnu compiler, link the correct MKL libraries and run cblas_zgbmv example.
-Vladimir

View solution in original post

6 Replies
TimP
Black Belt
1,291 Views
~/Desktop $ gcc -o test cblas_zgbmvx.c -Wl,-rpath=/opt/intel/mkl/10.1.3.027/lib/32 -L/opt/intel/mkl/10.1.3.027/lib/32 -lmkl_gf -liomp5 -lmkl_intel -lmkl_intel_thread -lmkl_core -lpthread -lm
/tmp/ccETbui0.o: In function `main':
cblas_zgbmvx.c:(.text+0xc9): undefined reference to `GetIntegerParameters'

I suppose libmkl_gf and libmkl_intel conflict with each other; just one of those two should be used. The link advisor on the right hand side of the forum page recommends only-lmkl_intel. Doesn't cblas also require its own library or common_func.c?
liunsteingmail_com
1,291 Views
Quoting - tim18
I suppose libmkl_gf and libmkl_intel conflict with each other; just one of those two should be used. The link advisor on the right hand side of the forum page recommends only-lmkl_intel. Doesn't cblas also require its own library or common_func.c?

thx for the reply
i later found out that it might not be a linking error
those "functions" or "macros" that caused the problem are declared in mkl_example.h
but i dont think it's implemented anywhere since it's just examples, not part of the mkl library
Vladimir_Lunev
New Contributor I
1,292 Views
Yes one more source file need to be compiled - common_func.c.
The other way is to use the provided makefile in the directory examples/cblas to build and run the examples.
This command
>make so32 compiler=gnu function=cblas_zgbmv
will compile the required sources by gnu compiler, link the correct MKL libraries and run cblas_zgbmv example.
-Vladimir

liunsteingmail_com
1,291 Views
Yes one more source file need to be compiled - common_func.c.
The other way is to use the provided makefile in the directory examples/cblas to build and run the examples.
This command
>make so32 compiler=gnu function=cblas_zgbmv
will compile the required sources by gnu compiler, link the correct MKL libraries and run cblas_zgbmv example.
-Vladimir

thx man !
i've tried to use make but passed the wrong arguments: make lib32 function=common_func compiler=gnu
but now it works !
Sahar_A_
Beginner
1,291 Views
OK I am getting this error: for the make file: Dgemm_mkl: gcc -c -o Dgemm.o cblas_dgemmx.c gcc -L -o Dgemm Dgemm.o I get: [sahar@kw2227 myMKLtests]$ make gcc -c -o Dgemm.o cblas_dgemmx.c gcc -o Dgemm Dgemm.o Dgemm.o: In function `main': cblas_dgemmx.c:(.text+0xb8): undefined reference to `GetIntegerParameters' cblas_dgemmx.c:(.text+0xed): undefined reference to `GetScalarsD' cblas_dgemmx.c:(.text+0x129): undefined reference to `GetCblasCharParameters' cblas_dgemmx.c:(.text+0x2cc): undefined reference to `GetArrayD' cblas_dgemmx.c:(.text+0x31f): undefined reference to `GetArrayD' cblas_dgemmx.c:(.text+0x36c): undefined reference to `GetArrayD' cblas_dgemmx.c:(.text+0x3f5): undefined reference to `PrintParameters' cblas_dgemmx.c:(.text+0x409): undefined reference to `PrintParameters' cblas_dgemmx.c:(.text+0x44b): undefined reference to `PrintArrayD' cblas_dgemmx.c:(.text+0x48d): undefined reference to `PrintArrayD' cblas_dgemmx.c:(.text+0x4c9): undefined reference to `PrintArrayD' cblas_dgemmx.c:(.text+0x527): undefined reference to `cblas_dgemm' cblas_dgemmx.c:(.text+0x575): undefined reference to `PrintArrayD' collect2: ld returned 1 exit status make: *** [Dgemm_mkl] Error 1 if it wasn't a linking problem then what is it??
Gennady_F_Intel
Moderator
1,291 Views
these references like 'GetIntegerParameters' and others are defined into common_func.c file.
Reply