Skip to content

Commit

Permalink
do not try to use Eigen's blas/lapack if they cannot be compiled
Browse files Browse the repository at this point in the history
  • Loading branch information
ggael committed Feb 23, 2011
1 parent 8200644 commit 13a2fbf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down
34 changes: 22 additions & 12 deletions unsupported/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 13a2fbf

Please sign in to comment.