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

MKL/Lapack compilation problem

scousemouse
Beginner
1,268 Views
This message has been moved to the Intel Math Kenel Library forum which launched on Dec. 18, 2003.
0 Kudos
7 Replies
Martyn_C_Intel
Employee
1,268 Views
Yes, seems odd. Where does the reference come from? Perhaps try linking with the mkl shared libraries?
0 Kudos
scousemouse
Beginner
1,268 Views
OK, please excuse my ignorance but how do I link with the shared libraries as opposed to the static?

The reference comes from my program which is calling sgesv as a test.

Well, now if I compile with:

ifc -o test_lapack -L/opt/intel/mkl/lib/32/ -lmkl_lapack32 -lmkl_p3 -lguide test_lapack.f90

I can compile fine. When it comes to running the executable I get:

error while loading shared libraries: libmkl_lapack.so: cannot open shared object file: No such file or directory

Which is strange because I've quoted -lmkl_lapack32 and libmkl_lapack32.so exists! Also, my LD_LIBRARY_PATH is set correctly.

Thanks for any further pointers.

0 Kudos
TimP
Honored Contributor III
1,268 Views
When you say that your LD_LIBRARY_PATH is set correctly, do you mean that the MKL library path is included? I don't have the latest version of MKL, but mine doesn't set this up automatically. When I have set up the compiler environment variables, the compiler library path is added to LD_LIBRARY_PATH, but the MKL library path is still not included. If you are implying that these things should be set up automatically, I agree, but apparently that is not the case. It is a traditional problem with g77 as well; the libraries aren't necessarily picked up from the same software installation you used to build.

I believe that only the older versions of MKL support static linking. If you have a preferred solution, such as having the mkl libraries become sym-linked automatically into the ifc library path, or the standard paths according to LSB, you might consider filing a report on premier.intel.com. Give your version details and the explanation of how your executable can't find the .so, without your taking additional steps beyond the basic installation.
0 Kudos
scousemouse
Beginner
1,272 Views
Yes, I set LD_LIBRARY_PATH explicitly in my shell .bashrc script - echo $LD_LIBRARY_PATH gives:

/opt/intel/compiler70/ia32/lib:/opt/intel/mkl/lib/32

My IFC is version 7.0 and MKL version 5.2.

Is this not an issue with the way I am calling the compiler/or exactly which libraries I am using given that I can compile and link and run sucessfully with the MKL BLAS library, with exactly the same compiler options/environment (apart from obviously the specified libraries)?

Feeling very confused!
0 Kudos
scousemouse
Beginner
1,272 Views
OK, phrasing this another way, I've posted the 2 code snippets at:

http://eiger.jaeggi.co.uk/fortran/

I can compile and run test_blas.f90 fine. Please can someone let me know what command line options I need to use to get test_lapack.f90 to compile and run.

Thanks!
0 Kudos
mr-todd
Beginner
1,272 Views
I'm not sure if this is a bug or a feature:

You have linked test_lapack with -lmkl_lapack32 but a
'ldd test_lapack' searches for 'libmkl_lapack.so'.

A quick and dirty solution, link libmkl_lapack32.so to libmkl_lapack.so and it works.

Cheers, mr-todd.
0 Kudos
scousemouse
Beginner
1,272 Views
Thanks a bunch! Quick and dirty and it does work.

Now, to help with future problems, could you explain _why_ it works?!



0 Kudos
Reply