Add an option to test with external BLAS library

This commit is contained in:
Christoph Hertzberg
2018-05-22 21:04:32 +02:00
parent d06a753d10
commit 750af06362
2 changed files with 13 additions and 0 deletions

View File

@@ -30,6 +30,15 @@ if(NOT EIGEN_Fortran_COMPILER_WORKS)
find_package(LAPACK QUIET)
endif()
# TODO do the same for EXTERNAL_LAPACK
option(EIGEN_TEST_EXTERNAL_BLAS "Use external BLAS library for testsuite" OFF)
if(EIGEN_TEST_EXTERNAL_BLAS)
find_package(BLAS REQUIRED)
message(STATUS "BLAS_COMPILER_FLAGS: ${BLAS_COMPILER_FLAGS}")
add_definitions("-DEIGEN_USE_BLAS") # is adding ${BLAS_COMPILER_FLAGS} necessary?
list(APPEND EXTERNAL_LIBS "${BLAS_LIBRARIES}")
endif(EIGEN_TEST_EXTERNAL_BLAS)
# configure blas/lapack (use Eigen's ones)
set(EIGEN_BLAS_LIBRARIES eigen_blas)
set(EIGEN_LAPACK_LIBRARIES eigen_lapack)