forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QMCPACK package: update blas/lapack detection (spack#6753)
* Fix detection of blas and lapack: provide libraries/includes as arguments to CMake rather than using CMake's auto-detection. This includes a patch to QMCPACK's CMake files to refer to Spack-built blas/lapack implementations. This also includes special-case logic for the intel-mkl implementation of blas/lapack * Break up unit tests and short tests. Only hard failure if the unit tests fail, if short tests fail issue a warning only. * Add QMCPACK 3.3.0, get rid of 3.0.0
- Loading branch information
1 parent
0c1f4a7
commit 24743b7
Showing
2 changed files
with
125 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
diff --git a/CMake/FindMKL.cmake b/CMake/FindMKL.cmake | ||
index a457eaba0..66dc43ce6 100644 | ||
--- a/CMake/FindMKL.cmake | ||
+++ b/CMake/FindMKL.cmake | ||
@@ -7,21 +7,21 @@ FILE( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl.cxx" | ||
"#include <iostream>\n #include <mkl.h>\n int main() { return 0; }\n" ) | ||
try_compile(HAVE_MKL ${CMAKE_BINARY_DIR} | ||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl.cxx | ||
- CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" ) | ||
+ CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" "-DINCLUDE_DIRECTORIES=${LAPACK_INCLUDE_DIRS}") | ||
|
||
# Check for mkl_vml_functions.h | ||
FILE( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_vml.cxx" | ||
"#include <iostream>\n #include <mkl_vml_functions.h>\n int main() { return 0; }\n" ) | ||
try_compile(HAVE_MKL_VML ${CMAKE_BINARY_DIR} | ||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_vml.cxx | ||
- CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" ) | ||
+ CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" "-DINCLUDE_DIRECTORIES=${LAPACK_INCLUDE_DIRS}") | ||
|
||
# Check for fftw3 | ||
FILE( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_fftw3.cxx" | ||
"#include <iostream>\n #include <fftw/fftw3.h>\n int main() { return 0; }\n" ) | ||
try_compile(HAVE_MKL_FFTW3 ${CMAKE_BINARY_DIR} | ||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_fftw3.cxx | ||
- CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" ) | ||
+ CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" "-DINCLUDE_DIRECTORIES=${LAPACK_INCLUDE_DIRS}") | ||
|
||
IF ( HAVE_MKL ) | ||
SET( MKL_FOUND 1 ) | ||
diff --git a/CMake/FindVectorMath.cmake b/CMake/FindVectorMath.cmake | ||
index c0c919746..f5c511253 100644 | ||
--- a/CMake/FindVectorMath.cmake | ||
+++ b/CMake/FindVectorMath.cmake | ||
@@ -19,7 +19,7 @@ IF ( NOT HAVE_VECTOR_MATH ) | ||
"#include <iostream>\n #include <mkl_vml_functions.h>\n int main() { return 0; }\n" ) | ||
try_compile(HAVE_MKL_VML ${CMAKE_BINARY_DIR} | ||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_vml.cxx | ||
- CMAKE_FLAGS "${CMAKE_CXX_FLAGS}" ) | ||
+ CMAKE_FLAGS "${CMAKE_CXX_FLAGS}" "-DINCLUDE_DIRECTORIES=${LAPACK_INCLUDE_DIRS}") | ||
IF (HAVE_MKL_VML) | ||
# enable VML only when MKL libraries have been picked up | ||
IF (MKL_FOUND) | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 570d8a01f..56d939786 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -464,6 +464,8 @@ ELSE(CMAKE_TOOLCHAIN_FILE) | ||
MESSAGE(STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}") | ||
MESSAGE(STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS}") | ||
SET(LAPACK_LIBRARY ${LAPACK_LIBRARIES} ${LAPACK_LINKER_FLAGS}) | ||
+ MESSAGE(STATUS "LAPACK_INCLUDE_DIRS: ${LAPACK_INCLUDE_DIRS}") | ||
+ INCLUDE_DIRECTORIES(${LAPACK_INCLUDE_DIRS}) | ||
ELSE() | ||
MESSAGE(FATAL_ERROR "Could not find required libraries LAPACK &/or BLAS") | ||
ENDIF() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters