1 2 3set(BLAS_FOUND TRUE) 4set(LAPACK_FOUND TRUE) 5set(BLAS_LIBRARIES eigen_blas_static) 6set(LAPACK_LIBRARIES eigen_lapack_static) 7 8set(SPARSE_LIBS "") 9 10# find_library(PARDISO_LIBRARIES pardiso412-GNU450-X86-64) 11# if(PARDISO_LIBRARIES) 12# add_definitions("-DEIGEN_PARDISO_SUPPORT") 13# set(SPARSE_LIBS ${SPARSE_LIBS} ${PARDISO_LIBRARIES}) 14# endif() 15 16find_package(CHOLMOD) 17if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND) 18 add_definitions("-DEIGEN_CHOLMOD_SUPPORT") 19 include_directories(${CHOLMOD_INCLUDES}) 20 set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) 21 set(CHOLMOD_ALL_LIBS ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) 22endif() 23 24find_package(UMFPACK) 25if(UMFPACK_FOUND AND BLAS_FOUND) 26 add_definitions("-DEIGEN_UMFPACK_SUPPORT") 27 include_directories(${UMFPACK_INCLUDES}) 28 set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES}) 29 set(UMFPACK_ALL_LIBS ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES}) 30endif() 31 32find_package(KLU) 33if(KLU_FOUND) 34 add_definitions("-DEIGEN_KLU_SUPPORT") 35 include_directories(${KLU_INCLUDES}) 36 set(SPARSE_LIBS ${SPARSE_LIBS} ${KLU_LIBRARIES}) 37endif() 38 39find_package(SuperLU 4.0) 40if(SuperLU_FOUND AND BLAS_FOUND) 41 add_definitions("-DEIGEN_SUPERLU_SUPPORT") 42 include_directories(${SUPERLU_INCLUDES}) 43 set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) 44 set(SUPERLU_ALL_LIBS ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) 45endif() 46 47 48find_package(PASTIX QUIET COMPONENTS METIS SCOTCH) 49# check that the PASTIX found is a version without MPI 50find_path(PASTIX_pastix_nompi.h_INCLUDE_DIRS 51 NAMES pastix_nompi.h 52 HINTS ${PASTIX_INCLUDE_DIRS} 53) 54if (NOT PASTIX_pastix_nompi.h_INCLUDE_DIRS) 55 message(STATUS "A version of Pastix has been found but pastix_nompi.h does not exist in the include directory." 56 " Because Eigen tests require a version without MPI, we disable the Pastix backend.") 57endif() 58if(PASTIX_FOUND AND PASTIX_pastix_nompi.h_INCLUDE_DIRS AND BLAS_FOUND) 59 add_definitions("-DEIGEN_PASTIX_SUPPORT") 60 include_directories(${PASTIX_INCLUDE_DIRS_DEP}) 61 if(SCOTCH_FOUND) 62 include_directories(${SCOTCH_INCLUDE_DIRS}) 63 set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${SCOTCH_LIBRARIES}) 64 elseif(METIS_FOUND) 65 include_directories(${METIS_INCLUDE_DIRS}) 66 set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES}) 67 endif() 68 set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES_DEP} ${ORDERING_LIBRARIES}) 69 set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES_DEP}) 70endif() 71 72if(METIS_FOUND) 73 include_directories(${METIS_INCLUDE_DIRS}) 74 set (SPARSE_LIBS ${SPARSE_LIBS} ${METIS_LIBRARIES}) 75 add_definitions("-DEIGEN_METIS_SUPPORT") 76endif() 77 78find_library(RT_LIBRARY rt) 79if(RT_LIBRARY) 80 set(SPARSE_LIBS ${SPARSE_LIBS} ${RT_LIBRARY}) 81endif() 82 83add_executable(spbenchsolver spbenchsolver.cpp) 84target_link_libraries (spbenchsolver ${SPARSE_LIBS}) 85 86add_executable(spsolver sp_solver.cpp) 87target_link_libraries (spsolver ${SPARSE_LIBS}) 88 89 90add_executable(test_sparseLU test_sparseLU.cpp) 91target_link_libraries (test_sparseLU ${SPARSE_LIBS}) 92 93