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.

65 lines
2.1 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("-DEIGEN_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("-DEIGEN_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("-DEIGEN_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)
  26. if(SUPERLU_FOUND AND BLAS_FOUND)
  27. add_definitions("-DEIGEN_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("-DEIGEN_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. find_library(RT_LIBRARY rt)
  49. if(RT_LIBRARY)
  50. set(SPARSE_LIBS ${SPARSE_LIBS} ${RT_LIBRARY})
  51. endif(RT_LIBRARY)
  52. add_executable(spbenchsolver spbenchsolver.cpp)
  53. target_link_libraries (spbenchsolver ${SPARSE_LIBS})