- "Setting CP2K_BLAS_VENDOR=CUSTOM imply setting CP2K_BLAS_LINK_LIBRARIES\n and CP2K_LAPACK_LINK_LIBRARIES to the right libraries. See the README_cmake.md for more details"
+ "Invalid parameters. Blas and lapack can exist in two flavors 32 or 64 bits interfaces (relevant mostly for mkl)"
)
endif()
- if(DEFINED CP2K_BLAS_LINK_LIBRARIES)
- set(CP2K_BLAS_FOUND TRUE)
+ set(CP2K_BLAS_FOUND FALSE)
+
+ # first check for a specific implementation if requested
+ if(CP2K_BLAS_VENDOR MATCHES "CUSTOM" AND NOT DEFINED
+ CP2K_BLAS_LINK_LIBRARIES)
+ message(
+ FATAL_ERROR
+ "Setting CP2K_BLAS_VENDOR=CUSTOM imply setting CP2K_BLAS_LINK_LIBRARIES\n and CP2K_LAPACK_LINK_LIBRARIES to the right libraries. See the README_cmake.md for more details"
+ )
+ endif()
+
+ if(DEFINED CP2K_BLAS_LINK_LIBRARIES)
+ set(CP2K_BLAS_FOUND TRUE)
+ else()
+ # search for any blas implementation and exit immediately if one is found.
+ # we could also give a full list of found implementation and let the user