diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-02-23 09:25:32 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-02-23 09:25:32 +0100 |
commit | 14b164b00e832241856c500f4f9a4e7ef2b6a59d (patch) | |
tree | 1787756786d23f912b469ddb243f412365821709 | |
parent | c78b5fd9aaf8fb3dd01e179c7912834f644fbf11 (diff) |
do not try to use Eigen's blas/lapack if they cannot be compiled
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | unsupported/test/CMakeLists.txt | 34 |
2 files changed, 26 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a09a2ea06..f2db30464 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -314,10 +314,6 @@ else() add_subdirectory(test EXCLUDE_FROM_ALL) endif() -add_subdirectory(unsupported) - -add_subdirectory(demos EXCLUDE_FROM_ALL) - if(NOT MSVC) if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) add_subdirectory(blas) @@ -328,6 +324,10 @@ if(NOT MSVC) endif() endif(NOT MSVC) +add_subdirectory(unsupported) + +add_subdirectory(demos EXCLUDE_FROM_ALL) + # must be after test and unsupported, for configuring buildtests.in add_subdirectory(scripts EXCLUDE_FROM_ALL) diff --git a/unsupported/test/CMakeLists.txt b/unsupported/test/CMakeLists.txt index 854a41e70..d3ed2b515 100644 --- a/unsupported/test/CMakeLists.txt +++ b/unsupported/test/CMakeLists.txt @@ -3,35 +3,45 @@ include_directories(../../test ../../unsupported ../../Eigen) set(SPARSE_LIBS "") +# configure blas/lapack +if(CMAKE_Fortran_COMPILER_WORKS) + set(BLAS_FOUND TRUE) + set(LAPACK_FOUND TRUE) + set(BLAS_LIBRARIES eigen_blas_static) + set(LAPACK_LIBRARIES eigen_lapack_static) +else() + # TODO search for default blas/lapack +endif() + find_package(Cholmod) -if(CHOLMOD_FOUND) +if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND) add_definitions("-DEIGEN_CHOLMOD_SUPPORT") include_directories(${CHOLMOD_INCLUDES}) - set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES} eigen_blas_static eigen_lapack_static) + set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) ei_add_property(EIGEN_TESTED_BACKENDS "Cholmod, ") -else(CHOLMOD_FOUND) +else() ei_add_property(EIGEN_MISSING_BACKENDS "Cholmod, ") -endif(CHOLMOD_FOUND) +endif() find_package(Umfpack) -if(UMFPACK_FOUND) +if(UMFPACK_FOUND AND BLAS_FOUND) add_definitions("-DEIGEN_UMFPACK_SUPPORT") include_directories(${UMFPACK_INCLUDES}) - set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES} eigen_blas_static) + set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES}) ei_add_property(EIGEN_TESTED_BACKENDS "UmfPack, ") -else(UMFPACK_FOUND) +else() ei_add_property(EIGEN_MISSING_BACKENDS "UmfPack, ") -endif(UMFPACK_FOUND) +endif() find_package(SuperLU) -if(SUPERLU_FOUND) +if(SUPERLU_FOUND AND BLAS_FOUND) add_definitions("-DEIGEN_SUPERLU_SUPPORT") include_directories(${SUPERLU_INCLUDES}) - set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} eigen_blas_static) + set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) ei_add_property(EIGEN_TESTED_BACKENDS "SuperLU, ") -else(SUPERLU_FOUND) +else() ei_add_property(EIGEN_MISSING_BACKENDS "SuperLU, ") -endif(SUPERLU_FOUND) +endif() find_package(GoogleHash) if(GOOGLEHASH_FOUND) |