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(PARDISO_LIBRARIES) 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(SuperLU 4.0) 33if(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}) 38endif() 39 40 41find_package(PASTIX QUIET COMPONENTS METIS SCOTCH) 42# check that the PASTIX found is a version without MPI 43find_path(PASTIX_pastix_nompi.h_INCLUDE_DIRS 44 NAMES pastix_nompi.h 45 HINTS ${PASTIX_INCLUDE_DIRS} 46) 47if (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.") 50endif() 51if(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}) 63endif(PASTIX_FOUND AND BLAS_FOUND) 64 65if(METIS_FOUND) 66 include_directories(${METIS_INCLUDE_DIRS}) 67 set (SPARSE_LIBS ${SPARSE_LIBS} ${METIS_LIBRARIES}) 68 add_definitions("-DEIGEN_METIS_SUPPORT") 69endif(METIS_FOUND) 70 71find_library(RT_LIBRARY rt) 72if(RT_LIBRARY) 73 set(SPARSE_LIBS ${SPARSE_LIBS} ${RT_LIBRARY}) 74endif(RT_LIBRARY) 75 76add_executable(spbenchsolver spbenchsolver.cpp) 77target_link_libraries (spbenchsolver ${SPARSE_LIBS}) 78 79add_executable(spsolver sp_solver.cpp) 80target_link_libraries (spsolver ${SPARSE_LIBS}) 81 82 83add_executable(test_sparseLU test_sparseLU.cpp) 84target_link_libraries (test_sparseLU ${SPARSE_LIBS}) 85 86