-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable MKL TPL but then CMake Reports BLAS Not Found #101
Comments
Disabling blas and lapack would be a bad idea. Instead when using a library like MKL that provides those libraries as part of a large set of tools you'll need to tell Trilinos that the blas and lapack libraries are included in that set. Unfortunately that often means setting up a few variables with very long strings to match what the MKL link helper recommends. I found an example from the Trilinos sampleScripts dir. I can't speak to if this snippet still works, but it should give you an idea on which variables you need to set and with which libraries or paths. I pulled this specific snippet from linux-eleanor-gcc-4.1.2-mpi-cmake, there are others in the sampleScripts dir that you may want to look at. -D BLAS_LIBRARY_DIRS:STRING="/usr/local/intel/Compiler/11.1/064/mkl/lib/em64t;/usr/local/intel/Compiler/11.1/064/lib/intel64;/usr/lib64" |
Si, setenv BLAS_LIBRARY_DIRS /opt/intel/composer_xe_2013_sp1.4.211/mkl/intel64;/usr/lib64 -D BLAS_LIBRARY_DIRS:PATH="${BLAS_LIBRARY_DIRS}" |
Guys, thanks for your help I am modifying my scripts to do this but in general but I think this is something close to a usability bug. Can we not have MKL, ESSL/PESSL etc be resolved as the BLAS and LAPACK inputs? |
"MKL TPL" should really refer to the C / C++ API that MKL provides, not to the BLAS and LAPACK libraries (which come in through the linker, not through header files). Failure to detect MKL header files shouldn't disable the BLAS and LAPACK if CMake can find the latter, right? |
I think if MKL is found it should set the BLAS and LAPACK flags unless I override them because that gives me the fastest code. I talked with Mike about how I should feedback these kind of issues, he had suggested that I put these in as bugs so we can have a conversation about possible fixes. If MKL isn't found then standard BLAS and LAPACK dependency checking should be performed. In the end, I want a build system that does the best thing for performance if we can get to that? |
Mark, Finding (or not) MKL doesn't actually affect blas/lapack in anyway they are completely orthogonal in Tribits. The recommendation to disable blas came from Tribits which is trying to be useful here. When it detects that there is no blas library (in its narrow definition) it suggests a couple options, provide library paths or disable it. Clearly disabling isn't the right choice for blas though. However, on other TPLs this could be very good advice. As for Si's suggestion of if MKL is found we should use that for blas and lapack. This is a good idea, however, in our current implementation very difficult. If we were to use CMake's find_package on blas and lapack it would be much easier to have logic like that. In fact it looks like the default cmake find logic for blas might already do this. |
Si, Thanks for being proactive and filing issues. This is the right approach. All of these messages become searchable and help us build a body of knowledge, in addition to clarifying misconceptions and resolving the issue at hand. Mike
|
This might be an abuse of the *_LIBRARIES flags, but I've had success with this approach:
|
Hi Brent! It looks like you're saying that if CMake finds the BLAS and LAPACK, and finds out that they are the MKL, then CMake should look for the MKL header files and other libraries, and enable the MKL TPL if it exists. Is that right? |
This might also be resolved if the FIND_PACKAGE(BLAS) default could be fixed (see TriBITSPub/TriBITS#89). Changing any default behavior for Trilinos (if it is to fix things) becomes very hard given the large number of customers that depend on existing behavior. |
Easy fix (@nmhamster would this help?): If MKL is detected but BLAS / LAPACK not, configure should error out. That prevents surprise. What do you think? |
open; TribitsProcessEnabledTpl.cmake
ENDIF() ENDFUNCTION() after make and make install, a new problem arises. |
@nmhamster I think this got auto-closed; would you consider this fixed? If so, I'll leave it. |
Probably not doing this correctly. I have enabled the MKL TPL but when CMake is busy configuring it then reports BLAS is not found. Given that MKL provides BLAS routines at good performance, should this error occur? Is correct to disable BLAS if I am using MKL?
The text was updated successfully, but these errors were encountered: