Commit 99f1286b authored by Thomas Witkowski's avatar Thomas Witkowski

Work in cmake configuration, maybe it will work better.

parent 6ffc619b
......@@ -58,18 +58,17 @@ if(Boost_FOUND)
list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
endif(Boost_FOUND)
set(AMDiS_NEED_PARMETIS @ENABLE_PARMETIS@)
set(AMDiS_NEED_ZOLTAN @ENABLE_ZOLTAN@)
set(AMDiS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(AMDiS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDiS_NEED_MKL @ENABLE_MKL@)
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDiSUse.cmake)
set(AMDiS_COMPILEFLAGS "@COMPILEFLAGS@")
set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@)
set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDIS_NEED_MKL @ENABLE_MKL@)
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake)
set(AMDIS_COMPILEFLAGS "@COMPILEFLAGS@")
set(AMDIS_VERSION @CurrentRevision@)
set(AMDIS_MAJOR_VERSION @AMDIS_MAJOR@)
set(AMDIS_MINOR_VERSION @AMDIS_MINOR@)
if(AMDiS_NEED_UMFPACK)
if(AMDIS_NEED_UMFPACK)
#look for umfpack, we need the headers only
find_file(UMFPACK_H umfpack.h
HINTS /usr/include /usr/include/suitesparse /usr/include/ufsparse
......@@ -127,7 +126,7 @@ if(AMDiS_NEED_UMFPACK)
endif()
#message("amdis-libs: ${AMDIS_LIBRARIES}")
list(APPEND AMDIS_LIBRARY_DIRS ${BLAS_LIBRARY_DIR})
endif(AMDiS_NEED_UMFPACK)
endif(AMDIS_NEED_UMFPACK)
#add directories for reinit
......@@ -136,21 +135,13 @@ list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/compositeFEM)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/muparser)
if(${AMDIS_FIND_COMPONENTS} MATCHES umfpack )
if( NOT AMDiS_NEED_UMFPACK )
set( AMDiS_umfpack_FOUND FALSE)
if( NOT AMDIS_NEED_UMFPACK )
set( AMDIS_umfpack_FOUND FALSE)
message(SEND_ERROR "the selected amdis was not compiled with umfpack")
endif()
endif()
if( AMDiS_NEED_PARMETIS )
list(APPEND AMDIS_LIBRARY_DIRS ${AMDIS_LIBRARY_DIR}/parmetis)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/parmetis/libparmetis.a ${AMDIS_LIBRARY_DIR}/parmetis/libmetis.a)
endif()
if( AMDiS_NEED_ZOLTAN )
if(AMDIS_NEED_ZOLTAN)
find_library(ZOLTAN_LIB zoltan DOC "full path to the zoltan library")
list(APPEND AMDIS_LIBRARIES ${ZOLTAN_LIB})
endif()
if(${AMDIS_FIND_COMPONENTS} MATCHES parmetis AND NOT AMDiS_NEED_PARMETIS)
message(SEND_ERROR "amdis was not compiled with parmetis")
endif()
#load mpi-compiler for use with parmetis and parallel_domain
if(AMDIS_HAS_PARALLEL_DOMAIN)
find_package(MPI REQUIRED)
if(MPI_FOUND)
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})
else()
message(FATAL_ERROR "Could nit find PETSc!")
endif(PETSC_FOUND)
elseif(AMDIS_HAS_PARALLEL_DOMAIN STREQUAL "PMTL")
find_package(MTL REQUIRED)
list(APPEND AMDIS_LIBRARIES ${MTL_LIBRARIES})
endif()
endif(AMDIS_HAS_PARALLEL_DOMAIN)
#thats bad because it affects each target
add_definitions(${AMDIS_COMPILEFLAGS})
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)
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})
This diff is collapsed.
......@@ -1252,18 +1252,11 @@ namespace AMDiS {
localAdmin->setNumberOfDofs(admin[0]->getNumberOfDofs());
testMesh.addDOFAdmin(localAdmin);
MSG("START READ FILE %s\n", macroFilename);
MacroInfo *testMacroInfo =
MacroReader::readMacro(macroFilename, &testMesh, periodicFilename, check);
testMacroInfo->clear();
delete testMacroInfo;
MSG("TEST MESH HAS %d ELEMENTS\n", testMesh.getNumberOfMacros());
MPI::Finalize();
exit(0);
// === Check the mesh structure. ===
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment