Re: linking to MKL
Posted: Mon Sep 13, 2010 11:25 am
Hi,
it's the third time I'm trying to post a message but when I go back to the forum I cannot find my message, I'm making some mistake but I cannot understand which.......could you please reply to this just to be sure that you were able to read it????
Well, I think that the "specific" names of the libraries should not be so important because they do depend on the library you ar using. I set:
and
because this is enough for MKL. In this case, as you can see, you must also call other libraries, that have nothing to do with blacs and scalapack, just to prevent from unresolved link to MKL calls!
Currently, the options for blas and lapack just do the same job, because they require the specification of the library and do not look for any specific name. For example, I successfully compiled the code using:
Another strategy would be to use LIBS and LDFLAGS variables also, that means that I can specify LDFLAGS or LIBS="$MKL_PATH/libmkl_scalapack_lp64.a MKL_PATH/libmkl_solver_lp64_sequential.a $MKL_PATH/libmkl_intel_lp64.a $MKL_PATH/libmkl_sequential.a $MKL_PATH/libmkl_core.a $MKL_PATH/libmkl_blacs_openmpi_lp64.a -lpthread". If the options --with-blacs and/or --with-scalapack are not set, the configure might try to compile a dummy program containing a call to a routine of a given library like (this is an example for lapack)
and then decide if that library is available or not depending on whether the link procedure found or not unresolved calls.
Giovanni
it's the third time I'm trying to post a message but when I go back to the forum I cannot find my message, I'm making some mistake but I cannot understand which.......could you please reply to this just to be sure that you were able to read it????
Well, I think that the "specific" names of the libraries should not be so important because they do depend on the library you ar using. I set:
Code: Select all
BLACS_LIBS="$MKL_PATH/libmkl_solver_lp64_sequential.a $MKL_PATH/libmkl_intel_lp64.a $MKL_PATH/libmkl_sequential.a $MKL_PATH/libmkl_core.a $MKL_PATH/libmkl_blacs_openmpi_lp64.a -lpthread"
Code: Select all
SCALAPACK_LIBS="$MKL_PATH/libmkl_scalapack_lp64.a"
Currently, the options for blas and lapack just do the same job, because they require the specification of the library and do not look for any specific name. For example, I successfully compiled the code using:
Code: Select all
--with-blas="-L$MKL_PATH -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread" \
--with-lapack="-L$MKL_PATH -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread"
Code: Select all
program main
call dgemm
end
Giovanni