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

'undefined reference to...' Error when compling in linux

nvh10
New Contributor I
1,254 Views

My program is just simple, calculate inverse matrix by using mkl libraries. 

I used the following ifort command to compile:

 

 

ifort -c -qopenmp -I$/openmp/intel/oneapi/mkl/2022.1.0/include/intel64/ilb64-m64 -DMKL_ILP64 -i8  -I"$/opt/intel/oneapi/mkl/2022.1.0/include" -fpp -nologo -O3 -Os -parallel -heap-arrays[0] -qopenmp testmkl.f90
ifort -o testmkl testmkl.o

 

 

The following error appears:

 

testmkl.o: In function `inversematrixd_': testmkl.f90:(.text+0x97):

undefined reference to `dgetrf_' testmkl.f90:(.text+0xbc):

undefined reference to `dgetri_' testmkl.o: In function `MAIN__': testmkl.f90:(.text+0x12f): undefined reference to `__kmpc_begin' testmkl.f90:(.text+0x149):

undefined reference to `__kmpc_ok_to_fork' testmkl.f90:(.text+0x17d):

undefined reference to `__kmpc_fork_call' testmkl.f90:(.text+0x1c0):

undefined reference to `__kmpc_end' testmkl.f90:(.text+0x262):

undefined reference to `__kmpc_for_static_init_8' testmkl.f90:(.text+0x2b5):

undefined reference to `__kmpc_for_static_fini'

 

Please help me! Sorry, I am just a beginner so please instruct me step by step!

Thank you very much!

 

 

 

 

0 Kudos
1 Solution
nvh10
New Contributor I
1,235 Views

I solved it. Thank you very much for taking a look!

ifort -qopenmp -I$/openmp/intel/oneapi/mkl/2022.1.0/include/intel64/ilb64-m64 -DMKL_ILP64 -i8  -I"$/opt/intel/oneapi/mkl/2022.1.0/include" -fpp -qmkl -nologo -O3 -Os -parallel -heap-arrays[0] testmkl.f90 -o testmkl

View solution in original post

0 Kudos
2 Replies
nvh10
New Contributor I
1,236 Views

I solved it. Thank you very much for taking a look!

ifort -qopenmp -I$/openmp/intel/oneapi/mkl/2022.1.0/include/intel64/ilb64-m64 -DMKL_ILP64 -i8  -I"$/opt/intel/oneapi/mkl/2022.1.0/include" -fpp -qmkl -nologo -O3 -Os -parallel -heap-arrays[0] testmkl.f90 -o testmkl
0 Kudos
VidyalathaB_Intel
Moderator
1,225 Views

Hi,


Thanks for reaching out to us.

>>I solved it. Thank you very much for taking a look!

Glad to know that your issue is resolved. Please post a new question if you need any additional assistance from Intel as this thread will no longer be monitored.


Have a Nice Day!


Regards,

Vidya.


0 Kudos
Reply