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 4.0) 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 QUIET COMPONENTS METIS SCOTCH) 42 # check that the PASTIX found is a version without MPI 43 find_path(PASTIX_pastix_nompi.h_INCLUDE_DIRS 44 NAMES pastix_nompi.h 45 HINTS ${PASTIX_INCLUDE_DIRS} 46 ) 47 if (NOT PASTIX_pastix_nompi.h_INCLUDE_DIRS) 48 message(STATUS "A version of Pastix has been found but pastix_nompi.h does not exist in the include directory." 49 " Because Eigen tests require a version without MPI, we disable the Pastix backend.") 50 endif() 51 if(PASTIX_FOUND AND PASTIX_pastix_nompi.h_INCLUDE_DIRS AND BLAS_FOUND) 52 add_definitions("-DEIGEN_PASTIX_SUPPORT") 53 include_directories(${PASTIX_INCLUDE_DIRS_DEP}) 54 if(SCOTCH_FOUND) 55 include_directories(${SCOTCH_INCLUDE_DIRS}) 56 set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${SCOTCH_LIBRARIES}) 57 elseif(METIS_FOUND) 58 include_directories(${METIS_INCLUDE_DIRS}) 59 set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES}) 60 endif(SCOTCH_FOUND) 61 set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES_DEP} ${ORDERING_LIBRARIES}) 62 set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES_DEP}) 63 endif(PASTIX_FOUND AND BLAS_FOUND) 64 65 if(METIS_FOUND) 66 include_directories(${METIS_INCLUDE_DIRS}) 67 set (SPARSE_LIBS ${SPARSE_LIBS} ${METIS_LIBRARIES}) 68 add_definitions("-DEIGEN_METIS_SUPPORT") 69 endif(METIS_FOUND) 70 71 find_library(RT_LIBRARY rt) 72 if(RT_LIBRARY) 73 set(SPARSE_LIBS ${SPARSE_LIBS} ${RT_LIBRARY}) 74 endif(RT_LIBRARY) 75 76 add_executable(spbenchsolver spbenchsolver.cpp) 77 target_link_libraries (spbenchsolver ${SPARSE_LIBS}) 78 79 add_executable(spsolver sp_solver.cpp) 80 target_link_libraries (spsolver ${SPARSE_LIBS}) 81 82 83 add_executable(test_sparseLU test_sparseLU.cpp) 84 target_link_libraries (test_sparseLU ${SPARSE_LIBS}) 85 86