AMDiSUse.cmake 1.11 KB
Newer Older
1
#load mpi-compiler for use with parmetis and parallel_domain
2
3
if(AMDiS_HAS_PARALLEL_DOMAIN)
	if(NOT AMDiS_NEED_PARMETIS)
4
5
6
7
	  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)
8
9
10
11
12
13
#	    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})
14
	  endif(MPI_FOUND)
15
	  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDiS_DIR})
16
	  set(PETSC_EXECUTABLE_RUNS ON)
17
18
	  find_package(PETSc REQUIRED)
	  if(PETSC_FOUND)
19
	    list(APPEND AMDiS_LIBRARIES ${PETSC_LIBRARY_SYS} ${PETSC_LIBRARIES})
20
	    list(APPEND AMDiS_INCLUDE_DIRS ${PETSC_INCLUDES})
21
22
23
	  endif(PETSC_FOUND)
	endif(NOT AMDiS_NEED_PARMETIS)
endif(AMDiS_HAS_PARALLEL_DOMAIN)
24
25
26
27
#thats bad because it affects each target
add_definitions(${AMDiS_COMPILEFLAGS})
include_directories(${AMDiS_INCLUDE_DIRS})