Skip to content
Snippets Groups Projects
AMDiSUse.cmake 1.40 KiB
#load mpi-compiler for use with parmetis and parallel_domain
if(AMDiS_HAS_PARALLEL_DOMAIN)
	if(NOT AMDiS_NEED_PARMETIS)
	  message(SEND_ERROR "parallel domain needs parmetis, but AMDiS was not compiled with parmetis support. There's something really odd..")
	else()
	  find_package(MPI REQUIRED)
	  if(MPI_FOUND)
#	    INCLUDE(CMakeForceCompiler)
#	    CMAKE_FORCE_CXX_COMPILER(mpicxx "The MPI C++ compiler")
#	    CMAKE_FORCE_C_COMPILER(mpicc "The MPI C Compiler")
	    list(APPEND AMDIS_LIBRARIES ${MPI_LIBRARIES})
	    list(APPEND AMDiS_COMPILEFLAGS ${MPI_COMPILE_FLAGS})
	    list(APPEND AMDIS_INCLUDE_DIRS ${MPI_INCLUDE_PATH})
	  endif(MPI_FOUND)
	  if(AMDiS_HAS_PARALLEL_DOMAIN STREQUAL "PETSC")
	    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDIS_DIR})
	    set(PETSC_EXECUTABLE_RUNS ON)
	    find_package(PETSc REQUIRED)
	    if(PETSC_FOUND)
	    list(APPEND AMDIS_LIBRARIES ${PETSC_LIBRARY_SYS} ${PETSC_LIBRARIES})
	    list(APPEND AMDIS_INCLUDE_DIRS ${PETSC_INCLUDES})
	    endif(PETSc_FOUND)
	  elseif(AMDiS_HAS_PARALLEL_DOMAIN STREQUAL "PMTL")
	    find_package(MTL REQUIRED)
	    list(APPEND AMDIS_LIBRARIES ${MTL_LIBRARIES})
#	    set(AMDiS_COMPILEFLAGS "${AMDIS_COMPILEFLAGS} -DMTL_HAS_MPI -DHAVE_PARALLEL_MTL4")
	  endif()
	endif(NOT AMDiS_NEED_PARMETIS)
endif(AMDiS_HAS_PARALLEL_DOMAIN)
#thats bad because it affects each target
add_definitions(${AMDiS_COMPILEFLAGS})
include_directories(${AMDIS_INCLUDE_DIRS})