You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.5 KiB

  1. set(BLAS_FOUND TRUE)
  2. set(LAPACK_FOUND TRUE)
  3. set(BLAS_LIBRARIES eigen_blas_static)
  4. set(LAPACK_LIBRARIES eigen_lapack_static)
  5. set(SPARSE_LIBS "")
  6. # find_library(PARDISO_LIBRARIES pardiso412-GNU450-X86-64)
  7. # if(PARDISO_LIBRARIES)
  8. # add_definitions("-DSTORMEIGEN_PARDISO_SUPPORT")
  9. # set(SPARSE_LIBS ${SPARSE_LIBS} ${PARDISO_LIBRARIES})
  10. # endif(PARDISO_LIBRARIES)
  11. find_package(Cholmod)
  12. if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND)
  13. add_definitions("-DSTORMEIGEN_CHOLMOD_SUPPORT")
  14. include_directories(${CHOLMOD_INCLUDES})
  15. set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
  16. set(CHOLMOD_ALL_LIBS ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
  17. endif()
  18. find_package(Umfpack)
  19. if(UMFPACK_FOUND AND BLAS_FOUND)
  20. add_definitions("-DSTORMEIGEN_UMFPACK_SUPPORT")
  21. include_directories(${UMFPACK_INCLUDES})
  22. set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES})
  23. set(UMFPACK_ALL_LIBS ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES})
  24. endif()
  25. find_package(SuperLU 4.0)
  26. if(SUPERLU_FOUND AND BLAS_FOUND)
  27. add_definitions("-DSTORMEIGEN_SUPERLU_SUPPORT")
  28. include_directories(${SUPERLU_INCLUDES})
  29. set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES})
  30. set(SUPERLU_ALL_LIBS ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES})
  31. endif()
  32. find_package(Pastix)
  33. find_package(Scotch)
  34. find_package(Metis)
  35. if(PASTIX_FOUND AND BLAS_FOUND)
  36. add_definitions("-DSTORMEIGEN_PASTIX_SUPPORT")
  37. include_directories(${PASTIX_INCLUDES})
  38. if(SCOTCH_FOUND)
  39. include_directories(${SCOTCH_INCLUDES})
  40. set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${SCOTCH_LIBRARIES})
  41. elseif(METIS_FOUND)
  42. include_directories(${METIS_INCLUDES})
  43. set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES})
  44. endif(SCOTCH_FOUND)
  45. set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES} ${ORDERING_LIBRARIES} ${BLAS_LIBRARIES})
  46. set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES} ${BLAS_LIBRARIES})
  47. endif(PASTIX_FOUND AND BLAS_FOUND)
  48. if(METIS_FOUND)
  49. include_directories(${METIS_INCLUDES})
  50. set (SPARSE_LIBS ${SPARSE_LIBS} ${METIS_LIBRARIES})
  51. add_definitions("-DSTORMEIGEN_METIS_SUPPORT")
  52. endif(METIS_FOUND)
  53. find_library(RT_LIBRARY rt)
  54. if(RT_LIBRARY)
  55. set(SPARSE_LIBS ${SPARSE_LIBS} ${RT_LIBRARY})
  56. endif(RT_LIBRARY)
  57. add_executable(spbenchsolver spbenchsolver.cpp)
  58. target_link_libraries (spbenchsolver ${SPARSE_LIBS})
  59. add_executable(spsolver sp_solver.cpp)
  60. target_link_libraries (spsolver ${SPARSE_LIBS})
  61. add_executable(test_sparseLU test_sparseLU.cpp)
  62. target_link_libraries (test_sparseLU ${SPARSE_LIBS})