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

ifort - "undefined reference"

jenwang
Beginner
835 Views
Hi, I was trying to compile a set of program using ifort and received the following error at the final linking stage: lapack_single/my/test_psvd.o(.text+0xa52): In function `MAIN__': : undefined reference to `s_wsle' lapack_single/my/test_psvd.o(.text+0xa82): In function `MAIN__': : undefined reference to `do_lio' ... Here are just some of the lines in the error message, there are more than 20 such lines stating the similar problem. test_psvd.f is the main program. My calling sequence is ifort -o test.out when I replaced ifort with g77, I can link just fine and executable test.out is produced, so I am sure that I incluced all the object files. Apparently, this is a problem with ifort. Does any one have any suggestion how to get around this? Thanks! Jeni
0 Kudos
3 Replies
TimP
Honored Contributor III
835 Views
References to the g77 runtime library would not be created in .o files built by ifort. If you have the source code, you must rebuild those g77 .o files using ifort.
0 Kudos
jenwang
Beginner
835 Views
I did recompile using ifort and the same error occurs.
I pointed out that the program links successfully under the use of g77 in order to point out that non of the object files are missing from the source.

by the way, I am using MKL 7.2.1.
0 Kudos
yager
Beginner
835 Views
Those functions are in libg2c.a. If you are lucky, add a "-lg2c" option at linking stage should solve the problem, or you need to search "libg2c.a" at /usr/lib or other directories, and using its absolute path.

Old mkl refers to those g2c functions.
0 Kudos
Reply