Skip to content
Snippets Groups Projects
Commit 93d0049e authored by Naumann, Andreas's avatar Naumann, Andreas
Browse files

providing petsc directly now, dont know, if it works on deimos

parent 4e04364c
No related branches found
No related tags found
No related merge requests found
#This configuration file is shipped with the great FEM-Toolbox AMDiS.
#It simplifies the configure of different amdis-version and sets some variables.
#We set the following variables:
# AMDiS_INCLUDE_DIR the amdis-directory only
# AMDiS_INCLUDE_DIRS all include directories (mtl, umfpack, parmetis, metis, ...)
# AMDiS_LIBRARIES the needed libraries
# AMDiS_LIBRARY_DIRS the link directories
# AMDiS_COMPILEFLAGS some compile flags for amdis
#
#
# For a fast start, you use this package in the following way
# simply look for it, possibly set the AMDiS directory
# find_package(AMDiS )
# include(${AMDiS_USE_FILE})
# add_executable(yourTarget <yourSources>)
# target_link_libraries(yourTarget ${AMDiS_LIBRARIES})
#
#
#The AMDiS_USE_FILE adds the include and link-directories for amdis to cmake.
#
#If you use the parallel amdis-version, the AMDiS_USE_FILE also trys to detect
#the mpi and petsc configuration. If those versions don't fit your needs,
#you can change the corresponding directories, or simply do this work at your own
#and omit the AMDiS_USE_FILE. Then you also have to set the flags, include
#and library directories.
#try to detect the AMDiS include directory
find_file(_AMDiS_H AMDiS.h PATHS ${AMDiS_INCLUDE_DIR} ${AMDiS_DIR}/../../include/amdis/ /usr/include/amdis/)
if(_AMDiS_H)
......@@ -31,7 +58,6 @@ set(AMDiS_NEED_PARMETIS @ENABLE_PARMETIS@)
set(AMDiS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(AMDiS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDiS_NEED_MKL @ENABLE_MKL@)
set(AMDiS_NEED_DUNE @ENABLE_DUNE@)
set(AMDiS_USE_FILE ${AMDiS_DIR}/AMDiSUse.cmake)
set(AMDiS_COMPILEFLAGS "@COMPILEFLAGS@")
message("find-components: ${AMDiS_FIND_COMPONENTS}")
......
link_directories(${AMDiS_LIBRARY_DIRS})
include_directories(${AMDiS_INCLUDE_DIRS})
#load mpi-compiler for use with parmetis and parallel_domain
if(${AMDiS_HAS_PARALLEL_DOMAIN})
if(NOT ${AMDiS_NEED_PARMETIS})
......@@ -12,5 +9,15 @@ if(${AMDiS_HAS_PARALLEL_DOMAIN})
CMAKE_FORCE_CXX_COMPILER(mpicxx "The MPI C++ compiler")
CMAKE_FORCE_C_COMPILER(mpicc "The MPI C Compiler")
endif(MPI_FOUND)
find_package(PETSc REQUIRED)
if(PETSC_FOUND)
list(APPEND AMDiS_LIBRARIES ${PETSC_LIBRARIES})
list(APPEND AMDiS_INCLUDE_DIRS ${PETSC_INCLUDES})
endif(PETSc_FOUND)
endif(NOT ${AMDiS_NEED_PARMETIS})
endif(${AMDiS_HAS_PARALLEL_DOMAIN})
#thats bad because it affects each target
add_definitions(${AMDiS_COMPILEFLAGS})
link_directories(${AMDiS_LIBRARY_DIRS})
include_directories(${AMDiS_INCLUDE_DIRS})
......@@ -22,8 +22,9 @@ endif()
#option(ENABLE_INTEL "use intel compiler" false)
option(ENABLE_OPENMP "use openmp" false)
option(ENABLE_PARALLEL_DOMAIN "use parallel domain decomposition" false)
SET(PETSC_DIR "" CACHE PATH "Petsc directory for parallel domain decomposition" )
SET(PETSC_ARCH "" CACHE STRING "Petsc architecture")
set(ENABLE_PARMETIS off)
#SET(PETSC_DIR "" CACHE PATH "Petsc directory for parallel domain decomposition" )
#SET(PETSC_ARCH "" CACHE STRING "Petsc architecture")
option(ENABLE_UMFPACK "use umfpack solver" false)
option(ENABLE_MKL "use the mkl" false)
SET(MKL_DIR "" CACHE PATH "MKL directory")
......@@ -172,14 +173,15 @@ if(ENABLE_PARALLEL_DOMAIN)
${LIB_DIR}/ParMetis-3.1/libmetis.a
DESTINATION lib/parmetis
)
set(ENABLE_PARMETIS ON)
find_package(PETSc REQUIRED)
include_directories(${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include)
SET(PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
${SOURCE_DIR}/parallel/MeshDistributor.cc
${SOURCE_DIR}/parallel/StdMpi.cc
${SOURCE_DIR}/parallel/ParallelDebug.cc
${SOURCE_DIR}/parallel/GlobalMatrixSolver.cc
${SOURCE_DIR}/parallel/MpiHelper.cc
${SOURCE_DIR}/parallel/ElementObjectData.cc
${SOURCE_DIR}/parallel/PetscSolver.cc)
......@@ -257,7 +259,8 @@ if(WIN32)
SET(COMPILEFLAGS "${COMPILEFLAGS} -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS")
endif(WIN32)
message("compileflags: ${COMPILEFLAGS}")
SET_TARGET_PROPERTIES(amdis PROPERTIES COMPILE_FLAGS "${COMPILEFLAGS}")
#SET_TARGET_PROPERTIES(amdis PROPERTIES COMPILE_FLAGS "${COMPILEFLAGS}")
add_definitions(${COMPILEFLAGS})
if(ENABLE_MARMOT)
Message("please set marmotcc manually")
endif(ENABLE_MARMOT)
......
......@@ -148,7 +148,7 @@ namespace AMDiS {
while (pos < bufSize) {
int codeSize = buf[pos++];
int nElements = buf[pos++];
std::vector<unsigned long int> code;
std::vector<long long unsigned int> code;
code.resize(codeSize);
for (int i = 0; i < codeSize; i++)
code[i] = buf[pos++];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment