Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

Intel compiler returns error when linking to mkl

mihan99
Beginner
771 Views

I get the following message when I compile my program:

/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `z_abs'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `c_sqrt'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `z_exp'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `c_exp'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `z_sqrt'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `s_cat'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `c_abs'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `s_copy'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `z_abs'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `c_sqrt'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `z_exp'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `c_exp'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `z_sqrt'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `s_cat'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `c_abs'
/usr/local/lib/intel/mkl/lib/32/libmkl_lapack.so: undefined reference to `s_copy'

It looks like it cannot find some library, but which one?

My linking command are:

ifort80 -o getgeo.x getgeo.o nr.o supprt.o extern.o rddata.o prutil.o -L/usr/local/lib/intel/intel_cc_80/lib/ -lsvml -lguide -lcxa -limf -lcprts -lifcore -L/usr/local/lib/intel/mkl/lib/32 -lmkl_lapack -lmkl_p4 -lmkl_def -lguide -lmkl

Thanks in advance

Mikkel

0 Kudos
4 Replies
Steven_L_Intel1
Employee
771 Views
Actually, you're getting errors from ld, not from the compiler. I suggest asking in the MKL section of the forum.
0 Kudos
TimP
Honored Contributor III
771 Views
Those appear to be libg2c calls. Do you have an old mkl_lapack meant to be used with g77?
0 Kudos
mihan99
Beginner
771 Views
Hi,

Thanks for fast answer (even though I did not post it in the right environment)...

I think the libraries are supposed to be used by an intel compiler, but I do not know for sure, as I am not the administrator of the system. Is there any way to work around that if it is the case, that the library should be used with g77? Allthoug I am 99% sure that it is intended for intel compilers.

Mikkel
0 Kudos
TimP
Honored Contributor III
771 Views
If the problem is due to an old version of MKL, it would be solved by upgrading. Other possibilities, like linking against the libg2c which comes with g77, could present run-time library conflicts.
0 Kudos
Reply