Commit 9835dec9 authored by Naumann, Andreas's avatar Naumann, Andreas

prepared rpm package with dependencies.... and centos sucks

parent 0f34c01d
set(MTL_DIR ${AMDiS_DIR}/mtl4 CACHE PATH "the mtl directory")
set(AMDiS_INCLUDE_DIR ${AMDiS_DIR}/include ${MTL_DIR})
set(AMDiS_LIBRARIES amdis compositeFEM)
set(AMDiS_LIBRARY_DIRS ${AMDiS_DIR}/lib)
#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)
get_filename_component(AMDiS_INCLUDE_DIR ${_AMDiS_H} PATH CACHE)
set(AMDiS_INCLUDE_DIRS ${AMDiS_INCLUDE_DIR})
else()
message(ERROR "could not detect the AMDiS include directory. Please set the variable AMDiS_INCLUDE_DIR to the directory containing the AMDiS headers.")
endif()
unset(_AMDiS_H CACHE)
set(MTL_DIR ${AMDiS_INCLUDE_DIR}/mtl4 CACHE PATH "the mtl directory")
list(APPEND AMDiS_INCLUDE_DIRS ${MTL_DIR})
find_library(_AMDiS_LIB amdis PATHS ${AMDiS_LIBRARY_DIR} ${AMDiS_DIR}/../../lib/amdis/ /usr/include/amdis)
if(_AMDiS_LIB)
get_filename_component(AMDiS_LIBRARY_DIR ${_AMDiS_LIB} PATH CACHE)
set(AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIR})
set(AMDiS_LIBRARIES amdis compositeFEM)
else()
message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDiS_LIBRARY_DIR to the directory containg the AMDiS library")
endif()
unset(_AMDiS_LIB CACHE)
find_package(Boost 1.42 REQUIRED system iostreams)
if(Boost_FOUND)
set(AMDiS_LIBRARIES ${AMDiS_LIBRARIES} ${Boost_LIBRARIES})
set(AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
list(APPEND AMDiS_INCLUDE_DIR ${Boost_INCLUDE_DIR})
list(APPEND AMDiS_LIBRARIES ${Boost_LIBRARIES})
list(APPEND AMDiS_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
list(APPEND AMDiS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
endif(Boost_FOUND)
set(AMDiS_NEED_PARMETIS @ENABLE_PARMETIS@)
......@@ -18,21 +36,26 @@ set(AMDiS_USE_FILE ${AMDiS_DIR}/AMDiSUse.cmake)
set(AMDiS_COMPILEFLAGS "@COMPILEFLAGS@")
message("find-components: ${AMDiS_FIND_COMPONENTS}")
if(AMDiS_NEED_UMFPACK)
set(BLAS_LIBRARY_DIR "" CACHE STRING "the blas library directory")
if(${AMDiS_NEED_UMFPACK})
set(BLAS_LIBRARY_DIR "" CACHE PATH "the blas library directory")
set(BLAS_LIBRARY "blas" CACHE STRING "the blas library")
set(AMDiS_LIBRARIES ${AMDiS_LIBRARIES} umfpack amd ${BLAS_LIBRARY})
set(AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIRS} ${AMDiS_DIR}/umfpack ${AMDiS_DIR}/amd ${BLAS_LIBRARY_DIR})
set(AMDiS_INCLUDE_DIR ${AMDiS_INCLUDE_DIR}
${AMDiS_DIR}/umfpack/include/
${AMDiS_DIR}/amd/include
${AMDiS_DIR}/ufconfig
${AMDiS_DIR}/ufconfig/xerbla
find_library(_BLAS_LIB ${BLAS_LIBRARY} PATHS ${BLAS_LIBRARY_DIR})
if(NOT _BLAS_LIB)
message(ERROR "could not find the blas library. please set the variables BLAS_LIBRARY_DIR and BLAS_LIBRARY")
endif()
list(APPEND AMDiS_LIBRARIES umfpack amd ${BLAS_LIBRARY})
list(APPEND AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIR}/umfpack ${AMDiS_LIBRARY_DIR}/amd ${BLAS_LIBRARY_DIR})
list(APPEND AMDiS_INCLUDE_DIRS
${AMDiS_INCLUDE_DIR}/umfpack
${AMDiS_INCLUDE_DIR}/amd
${AMDiS_INCLUDE_DIR}/ufconfig
${AMDiS_INCLUDE_DIR}/ufconfig/xerbla
)
endif(AMDiS_NEED_UMFPACK)
endif(${AMDiS_NEED_UMFPACK})
if(${AMDiS_FIND_COMPONENTS} MATCHES umfpack )
if( ${AMDiS_NEED_UMFPACK} )
set(AMDiS_LIBRARIES ${AMDiS_LIBRARIES} umfpack blas)
list(APPEND AMDiS_LIBRARIES umfpack blas)
else()
set( AMDiS_umfpack_FOUND FALSE)
message(SEND_ERROR "the selected amdis was not compiled with umfpack")
......@@ -40,7 +63,7 @@ if(${AMDiS_FIND_COMPONENTS} MATCHES umfpack )
endif()
if( ${AMDiS_NEED_PARMETIS} )
set(AMDiS_LIBRARIES ${AMDiS_LIBRARIES} parmetis metis)
list(APPEND AMDiS_LIBRARIES parmetis metis)
endif()
if(${AMDiS_FIND_COMPONENTS} MATCHES parmetis AND NOT ${AMDiS_NEED_PARMETIS})
......
link_directories(${AMDiS_LIBRARY_DIRS})
include_directories(${AMDiS_INCLUDE_DIR})
include_directories(${AMDiS_INCLUDE_DIRS})
#load mpi-compiler for use with parmetis and parallel_domain
if(${AMDiS_HAS_PARALLEL_DOMAIN})
......
......@@ -168,9 +168,9 @@ if(ENABLE_PARMETIS)
${SOURCE_DIR}/PollutionError.cc)
SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_PARALLEL_AMDIS=1")
INSTALL(FILES ${LIB_DIR}/ParMetis-3.1/parmetis.h
${LIB_DIR}/ParMetis-3.1/libparmetis.a
${LIB_DIR}/ParMetis-3.1/libmetis.a
DESTINATION amdis/parmetis
${LIB_DIR}/ParMetis-3.1/libparmetis.a
${LIB_DIR}/ParMetis-3.1/libmetis.a
DESTINATION lib/parmetis
)
endif(ENABLE_PARMETIS)
......@@ -202,19 +202,26 @@ if(ENABLE_UMFPACK)
include_directories(${LIB_DIR}/UFconfig ${LIB_DIR}/AMD/Include ${LIB_DIR}/UMFPACK/Include)
SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_UMFPACK=1 -DMTL_HAS_UMFPACK")
FILE(GLOB UMFPACK_HEADERS "${LIB_DIR}/UMFPACK/Include/*.h")
INSTALL(FILES ${UMFPACK_HEADERS} DESTINATION amdis/umfpack/include)
INSTALL(FILES ${UMFPACK_HEADERS}
DESTINATION include/amdis/umfpack/)
FILE(GLOB UMFPACK_HEADERS "${LIB_DIR}/AMD/Include/*.h")
INSTALL(FILES ${UMFPACK_HEADERS} DESTINATION amdis/amd/include)
INSTALL(FILES ${UMFPACK_HEADERS}
DESTINATION include/amdis/amd/)
FILE(GLOB HEADERS "${LIB_DIR}/UFconfig/*.h")
INSTALL(FILES ${HEADERS} DESTINATION amdis/ufconfig/)
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/ufconfig/)
FILE(GLOB HEADERS "${LIB_DIR}/UFconfig/xerbla/*.h")
INSTALL(FILES ${HEADERS} DESTINATION amdis/ufconfig/xerbla)
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/ufconfig/xerbla)
INSTALL(FILES ${LIB_DIR}/UMFPACK/Lib/libumfpack.a DESTINATION amdis/umfpack/)
INSTALL(FILES ${LIB_DIR}/AMD/Lib/libamd.a DESTINATION amdis/amd/)
INSTALL(FILES ${LIB_DIR}/UMFPACK/Lib/libumfpack.a
DESTINATION lib/amdis/umfpack/)
INSTALL(FILES ${LIB_DIR}/AMD/Lib/libamd.a
DESTINATION lib/amdis/amd/)
SET(RPM_DEPEND_STR "blas")
endif(ENABLE_UMFPACK)
if(ENABLE_MKL)
......@@ -252,42 +259,50 @@ if(ENABLE_MARMOT)
endif(ENABLE_MARMOT)
install(TARGETS amdis compositeFEM
LIBRARY DESTINATION amdis/lib )
LIBRARY DESTINATION lib/amdis/ )
FILE(GLOB HEADERS "${AMDiS_SOURCE_DIR}/*.h")
INSTALL(FILES ${HEADERS} DESTINATION amdis/include)
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/)
FILE(GLOB HEADERS "${AMDiS_SOURCE_DIR}/*.hh")
INSTALL(FILES ${HEADERS} DESTINATION amdis/include)
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/)
FILE(GLOB HEADERS "${AMDiS_SOURCE_DIR}/parallel/*.h")
INSTALL(FILES ${HEADERS} DESTINATION amdis/include/parallel/)
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/parallel/)
FILE(GLOB HEADERS "${AMDiS_SOURCE_DIR}/time/*.h")
INSTALL(FILES ${HEADERS} DESTINATION amdis/include/time/)
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/time/)
FILE(GLOB HEADERS "${AMDiS_SOURCE_DIR}/itl/*.hpp")
INSTALL(FILES ${HEADERS} DESTINATION amdis/include/itl)
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/itl)
configure_file(${AMDiS_BINARY_DIR}/AMDiSConfig.cmake.in
${AMDiS_BINARY_DIR}/AMDiSConfig.cmake
@ONLY
)
INSTALL(FILES ${AMDiS_BINARY_DIR}/AMDiSConfig.cmake DESTINATION amdis/)
INSTALL(FILES ${AMDiS_BINARY_DIR}/AMDiSUse.cmake DESTINATION amdis/)
INSTALL(FILES ${AMDiS_BINARY_DIR}/AMDiSConfig.cmake
DESTINATION share/amdis/)
INSTALL(FILES ${AMDiS_BINARY_DIR}/AMDiSUse.cmake
DESTINATION share/amdis/)
#install mtl
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/lib/mtl4/
DESTINATION amdis/mtl4
FILES_MATCHING PATTERN "*.hpp"
PATTERN ".svn" EXCLUDE
PATTERN ".svn/*" EXCLUDE
DESTINATION include/amdis/mtl4/
FILES_MATCHING PATTERN "*.hpp"
PATTERN ".svn" EXCLUDE
PATTERN ".svn/*" EXCLUDE
PATTERN "mtl4/libs" EXCLUDE
PATTERN "mtl4/extern" EXCLUDE
)
if(ENABLE_GUI)
add_subdirectory(other/tools/amdis_gui)
endif(ENABLE_GUI)
set(CPACK_PACKAGE_CONTACT "Me")
set(CPACK_BINARY_DEB "on")
set(CPACK_BINARY_RPM "on")
#set(CPACK_SET_DESTDIR "true")
set(CPACK_INSTALL_PREFIX "")
#PACKAGES
set(CPACK_PACKAGE_CONTACT "Andreas.Naumann@tu-dresden.de")
set(CPACK_GENERATOR "RPM" "DEB" "TGZ")
set(CPACK_INSTALL_PREFIX "/usr/")
set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel >= 1.42, ${RPM_DEPEND_STR}")
include(CPack)
if(ENABLE_TESTS)
#ENABLE_TESTING()
......
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