3D EM based on Schur decomposition
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

CMakeLists.txt 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. # Configure EMSchur3D
  2. set(EMSCHUR3D_VERSION_MAJOR "0")
  3. set(EMSCHUR3D_VERSION_MINOR "0")
  4. set(EMSCHUR3D_VERSION_PATCH "1")
  5. set(EMSCHUR3D_VERSION "\"${EMSCHUR3D_VERSION_MAJOR}.${EMSCHUR3D_VERSION_MINOR}.${EMSCHUR3D_VERSION_PATCH}\"")
  6. set(EMSCHUR3D_VERSION_NOQUOTES "${EMSCHUR3D_VERSION_MAJOR}.${EMSCHUR3D_VERSION_MINOR}.${EMSCHUR3D_VERSION_PATCH}")
  7. option ( LEMMA_MODULE_EMSCHUR3D TRUE )
  8. find_package( SuperLU )
  9. if (SUPERLU_FOUND)
  10. message( STATUS "SuperLU was found" )
  11. add_compile_options(-DHAVE_SUPERLU)
  12. INCLUDE_DIRECTORIES(${SUPERLU_INCLUDES})
  13. endif()
  14. #find_package( PaSTiX )
  15. find_package( PaSTiX COMPONENTS METIS SEQ )
  16. find_path(PASTIX_pastix_nompi.h_INCLUDE_DIRS
  17. #NAMES pastix/nompi.h
  18. NAMES pastix_nompi.h
  19. HINTS ${PASTIX_INCLUDE_DIRS}
  20. )
  21. if (NOT PASTIX_pastix_nompi.h_INCLUDE_DIRS)
  22. message(STATUS "A version of Pastix has been found but pastix_nompi.h does not exist in the include directory."
  23. " Because Eigen tests require a version without MPI, we disable the Pastix backend.")
  24. endif()
  25. if(PASTIX_FOUND AND PASTIX_pastix_nompi.h_INCLUDE_DIRS)
  26. add_definitions("-DEIGEN_PASTIX_SUPPORT")
  27. include_directories(${PASTIX_INCLUDE_DIRS_DEP})
  28. if(SCOTCH_FOUND)
  29. include_directories(${SCOTCH_INCLUDE_DIRS})
  30. set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${SCOTCH_LIBRARIES})
  31. elseif(METIS_FOUND)
  32. include_directories(${METIS_INCLUDE_DIRS})
  33. set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES})
  34. else(SCOTCH_FOUND)
  35. # ei_add_property(EIGEN_MISSING_BACKENDS "PaStiX, ")
  36. endif(SCOTCH_FOUND)
  37. set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES_DEP} ${ORDERING_LIBRARIES})
  38. set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES_DEP})
  39. # ei_add_property(EIGEN_TESTED_BACKENDS "PaStiX, ")
  40. else()
  41. # ei_add_property(EIGEN_MISSING_BACKENDS "PaStiX, ")
  42. endif()
  43. if ( PASTIX_FOUND )
  44. message( STATUS "PaSTiX was found" )
  45. add_compile_options(-DHAVE_PASTIX)
  46. INCLUDE_DIRECTORIES(${PASTIX_INCLUDES})
  47. endif()
  48. find_package( Umfpack )
  49. if ( UMFPACK_FOUND )
  50. message( STATUS "Umfpack was found" )
  51. add_compile_options(-DHAVE_UMFPACK)
  52. INCLUDE_DIRECTORIES(${UMFPACK_INCLUDES})
  53. endif()
  54. if ( LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT OR LEMMA_VTK8_SUPPORT AND LEMMA_MODULE_EMSCHUR3D )
  55. configure_file (
  56. "${CMAKE_CURRENT_SOURCE_DIR}/config/EMSchur3DConfig.h.in"
  57. "${PROJECT_BINARY_DIR}/include/EMSchur3DConfig.h"
  58. )
  59. install ( FILES ${PROJECT_BINARY_DIR}/include/EMSchur3DConfig.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ )
  60. add_subdirectory("src")
  61. add_library( emschur3d ${EMSCHUR3DSOURCE} )
  62. target_include_directories( emschur3d PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
  63. set_target_properties(emschur3d PROPERTIES
  64. VERSION "${EMSCHUR3D_VERSION_NOQUOTES}"
  65. SOVERSION "${EMSCHUR3D_VERSION_MAJOR}.${LEMMA_VERSION_MINOR}"
  66. PROJECT_LABEL "EMSCHUR3D ${LABEL_SUFFIX}"
  67. CXX_STANDARD_14
  68. CXX_STANDARD_REQUIRED_ON
  69. )
  70. option ( EMSCHUR3D_ON_KINGSPEAK FALSE )
  71. if ( EMSCHUR3D_ON_KINGSPEAK )
  72. # No OpenMP
  73. add_compile_options(-DHAVE_PARDISO)
  74. #set (MKLLINK "-L$MKLROOT/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -Wl,-rpath=$MKLROOT/lib/intel64")
  75. # OpenMP R3
  76. set (MKLLINK "-L$MKLROOT/lib/intel64 -Wl,-rpath=$MKLROOT/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread")
  77. target_link_libraries(emschur3d "lemmacore" ${MKLLINK})
  78. endif()
  79. # Linking
  80. target_link_libraries(emschur3d "lemmacore" "fdem1d" )
  81. # Linking
  82. target_link_libraries(emschur3d ${VTK_LIBRARIES})
  83. if ( SUPERLU_FOUND )
  84. target_link_libraries(emschur3d ${SUPERLU_LIBRARIES})
  85. endif()
  86. if ( PASTIX_FOUND )
  87. target_link_libraries(emschur3d ${PASTIX_LIBRARIES})
  88. target_link_libraries(emschur3d "blas" "metis" "scotch" "scotchmetis" "scotcherr" "scotcherrexit" "hwloc")
  89. endif()
  90. if ( UMFPACK_FOUND )
  91. target_link_libraries(emschur3d ${UMFPACK_LIBRARIES})
  92. endif()
  93. # Testing
  94. if (LEMMA_ENABLE_TESTING)
  95. add_subdirectory(testing)
  96. endif()
  97. # Install
  98. install ( TARGETS emschur3d DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
  99. install ( FILES include/EMSchur3D DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma )
  100. install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma FILES_MATCHING PATTERN "*.h")
  101. #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ FILES_MATCHING PATTERN "FDEM1D")
  102. #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/FDEM1D FILES_MATCHING PATTERN "*.h")
  103. # Examples
  104. if ( LEMMA_BUILD_EXAMPLES)
  105. add_subdirectory(examples)
  106. endif()
  107. else()
  108. if ( LEMMA_MODULE_EMSCHUR3D )
  109. message ( FATAL_ERROR
  110. "EMSChur3D requires VTK 6, 7, or 8"
  111. )
  112. endif()
  113. endif()