1 2 3 set(BLAS_FOUND TRUE) 4 set(LAPACK_FOUND TRUE) 5 set(BLAS_LIBRARIES eigen_blas_static) 6 set(LAPACK_LIBRARIES eigen_lapack_static) 7 8 set(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(PARDISO_LIBRARIES) 15 16 find_package(Cholmod) 17 if(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}) 22 endif() 23 24 find_package(Umfpack) 25 if(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}) 30 endif() 31 32 find_package(SuperLU) 33 if(SUPERLU_FOUND AND BLAS_FOUND) 34 add_definitions("-DEIGEN_SUPERLU_SUPPORT") 35 include_directories(${SUPERLU_INCLUDES}) 36 set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) 37 set(SUPERLU_ALL_LIBS ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) 38 endif() 39 40 41 find_package(Pastix) 42 find_package(Scotch) 43 find_package(Metis) 44 if(PASTIX_FOUND AND BLAS_FOUND) 45 add_definitions("-DEIGEN_PASTIX_SUPPORT") 46 include_directories(${PASTIX_INCLUDES}) 47 if(SCOTCH_FOUND) 48 include_directories(${SCOTCH_INCLUDES}) 49 set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${SCOTCH_LIBRARIES}) 50 elseif(METIS_FOUND) 51 include_directories(${METIS_INCLUDES}) 52 set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES}) 53 endif(SCOTCH_FOUND) 54 set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES} ${ORDERING_LIBRARIES} ${BLAS_LIBRARIES}) 55 set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES} ${BLAS_LIBRARIES}) 56 endif(PASTIX_FOUND AND BLAS_FOUND) 57 58 if(METIS_FOUND) 59 include_directories(${METIS_INCLUDES}) 60 set (SPARSE_LIBS ${SPARSE_LIBS} ${METIS_LIBRARIES}) 61 add_definitions("-DEIGEN_METIS_SUPPORT") 62 endif(METIS_FOUND) 63 64 find_library(RT_LIBRARY rt) 65 if(RT_LIBRARY) 66 set(SPARSE_LIBS ${SPARSE_LIBS} ${RT_LIBRARY}) 67 endif(RT_LIBRARY) 68 69 add_executable(spbenchsolver spbenchsolver.cpp) 70 target_link_libraries (spbenchsolver ${SPARSE_LIBS}) 71 72 add_executable(spsolver sp_solver.cpp) 73 target_link_libraries (spsolver ${SPARSE_LIBS}) 74 75 76 add_executable(test_sparseLU test_sparseLU.cpp) 77 target_link_libraries (test_sparseLU ${SPARSE_LIBS}) 78 79