123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- # Configure EMSchur3D
- set(EMSCHUR3D_VERSION_MAJOR "0")
- set(EMSCHUR3D_VERSION_MINOR "0")
- set(EMSCHUR3D_VERSION_PATCH "1")
- set(EMSCHUR3D_VERSION "\"${EMSCHUR3D_VERSION_MAJOR}.${EMSCHUR3D_VERSION_MINOR}.${EMSCHUR3D_VERSION_PATCH}\"")
- set(EMSCHUR3D_VERSION_NOQUOTES "${EMSCHUR3D_VERSION_MAJOR}.${EMSCHUR3D_VERSION_MINOR}.${EMSCHUR3D_VERSION_PATCH}")
-
- option ( LEMMA_MODULE_EMSCHUR3D TRUE )
-
- find_package( SuperLU )
- if (SUPERLU_FOUND)
- message( STATUS "SuperLU was found" )
- add_compile_options(-DHAVE_SUPERLU)
- INCLUDE_DIRECTORIES(${SUPERLU_INCLUDES})
- endif()
-
- #find_package( PaSTiX )
- find_package( PaSTiX COMPONENTS METIS SEQ )
-
- find_path(PASTIX_pastix_nompi.h_INCLUDE_DIRS
- #NAMES pastix/nompi.h
- NAMES pastix_nompi.h
- HINTS ${PASTIX_INCLUDE_DIRS}
- )
- if (NOT PASTIX_pastix_nompi.h_INCLUDE_DIRS)
- message(STATUS "A version of Pastix has been found but pastix_nompi.h does not exist in the include directory."
- " Because Eigen tests require a version without MPI, we disable the Pastix backend.")
- endif()
- if(PASTIX_FOUND AND PASTIX_pastix_nompi.h_INCLUDE_DIRS)
- add_definitions("-DEIGEN_PASTIX_SUPPORT")
- include_directories(${PASTIX_INCLUDE_DIRS_DEP})
- if(SCOTCH_FOUND)
- include_directories(${SCOTCH_INCLUDE_DIRS})
- set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${SCOTCH_LIBRARIES})
- elseif(METIS_FOUND)
- include_directories(${METIS_INCLUDE_DIRS})
- set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES})
- else(SCOTCH_FOUND)
- # ei_add_property(EIGEN_MISSING_BACKENDS "PaStiX, ")
- endif(SCOTCH_FOUND)
- set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES_DEP} ${ORDERING_LIBRARIES})
- set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES_DEP})
- # ei_add_property(EIGEN_TESTED_BACKENDS "PaStiX, ")
- else()
- # ei_add_property(EIGEN_MISSING_BACKENDS "PaStiX, ")
- endif()
-
- if ( PASTIX_FOUND )
- message( STATUS "PaSTiX was found" )
- add_compile_options(-DHAVE_PASTIX)
- INCLUDE_DIRECTORIES(${PASTIX_INCLUDES})
- endif()
-
-
-
- find_package( Umfpack )
- if ( UMFPACK_FOUND )
- message( STATUS "Umfpack was found" )
- add_compile_options(-DHAVE_UMFPACK)
- INCLUDE_DIRECTORIES(${UMFPACK_INCLUDES})
- endif()
-
- if ( LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT OR LEMMA_VTK8_SUPPORT AND LEMMA_MODULE_EMSCHUR3D )
-
- configure_file (
- "${CMAKE_CURRENT_SOURCE_DIR}/config/EMSchur3DConfig.h.in"
- "${PROJECT_BINARY_DIR}/include/EMSchur3DConfig.h"
- )
- install ( FILES ${PROJECT_BINARY_DIR}/include/EMSchur3DConfig.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ )
-
- add_subdirectory("src")
- add_library( emschur3d ${EMSCHUR3DSOURCE} )
- target_include_directories( emschur3d PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
-
- set_target_properties(emschur3d PROPERTIES
- VERSION "${EMSCHUR3D_VERSION_NOQUOTES}"
- SOVERSION "${EMSCHUR3D_VERSION_MAJOR}.${LEMMA_VERSION_MINOR}"
- PROJECT_LABEL "EMSCHUR3D ${LABEL_SUFFIX}"
- CXX_STANDARD_14
- CXX_STANDARD_REQUIRED_ON
- )
-
- option ( EMSCHUR3D_ON_KINGSPEAK FALSE )
- if ( EMSCHUR3D_ON_KINGSPEAK )
- # No OpenMP
- add_compile_options(-DHAVE_PARDISO)
- #set (MKLLINK "-L$MKLROOT/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -Wl,-rpath=$MKLROOT/lib/intel64")
- # OpenMP R3
- set (MKLLINK "-L$MKLROOT/lib/intel64 -Wl,-rpath=$MKLROOT/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread")
- target_link_libraries(emschur3d "lemmacore" ${MKLLINK})
- endif()
-
- # Linking
- target_link_libraries(emschur3d "lemmacore" "fdem1d" )
-
- # Linking
- target_link_libraries(emschur3d ${VTK_LIBRARIES})
-
- if ( SUPERLU_FOUND )
- target_link_libraries(emschur3d ${SUPERLU_LIBRARIES})
- endif()
- if ( PASTIX_FOUND )
- target_link_libraries(emschur3d ${PASTIX_LIBRARIES})
- target_link_libraries(emschur3d "blas" "metis" "scotch" "scotchmetis" "scotcherr" "scotcherrexit" "hwloc")
- endif()
- if ( UMFPACK_FOUND )
- target_link_libraries(emschur3d ${UMFPACK_LIBRARIES})
- endif()
-
- # Testing
- if (LEMMA_ENABLE_TESTING)
- add_subdirectory(testing)
- endif()
-
- # Install
- install ( TARGETS emschur3d DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
- install ( FILES include/EMSchur3D DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma )
- install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma FILES_MATCHING PATTERN "*.h")
-
- #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ FILES_MATCHING PATTERN "FDEM1D")
- #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/FDEM1D FILES_MATCHING PATTERN "*.h")
-
- # Examples
- if ( LEMMA_BUILD_EXAMPLES)
- add_subdirectory(examples)
- endif()
- else()
- if ( LEMMA_MODULE_EMSCHUR3D )
- message ( FATAL_ERROR
- "EMSChur3D requires VTK 6, 7, or 8"
- )
- endif()
-
- endif()
|