SET(CMAKE_INCLUDE_CURRENT_DIR true)
+
#
# General configuration options:
#
-OPTION(DEAL_II_USE_CONTRIB "Build and use contrib libraries bundled with the source tarball." OFF)
+OPTION(DEAL_II_USE_CONTRIB "Build and use contrib libraries bundled with the source tarball." ON)
OPTION(DEAL_II_WITH_THREADS "Build deal.II with support for threads. This pulls in libtbb as a dependency." ON)
OPTION(DEAL_II_FUNCTIONPARSER "BUild deal.II with support for functionparser" ON)
OPTION(DEAL_II_MPI "Build deal.II with support for openmpi." OFF)
# TODO: The rest ;-)
+
#
-# Configure:
+# Now, configure and prepare a lot of things:
#
SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
- "${CMAKE_SOURCE_DIR}/contrib/cmake/macros/"
+ # We outsource all the gory details:
"${CMAKE_SOURCE_DIR}/contrib/cmake/modules/"
)
+#
+# used as a dummy target for all the stuff that has to be done before the
+# library can be compiled:
+#
+ADD_CUSTOM_TARGET(deal_ii_target_dependencies)
+
IF(DEAL_II_WITH_THREADS)
INCLUDE(deal_ii_with_threads)
ENDIF()
ENDIF()
+
#
-# Build the toolchain and contrib libraries:
+# Build the toolchain:
#
ADD_SUBDIRECTORY(common/expand_instantiations)
+
#
# Compile the library:
#
--- /dev/null
+# Try to find AMD
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_PATH(AMD_INCLUDE_DIR amd.h
+ HINTS
+ $ENV{AMD_INCLUDE_DIR}
+ ${AMD_INCLUDE_DIR}
+)
+
+FIND_LIBRARY(AMD_LIBRARY
+ NAMES libumfpack.so
+ PATHS
+ $ENV{AMD_LIBRARY_DIR}
+ ${AMD_LIBRARY_DIR}
+ PATH_SUFFIXES lib64 lib
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(AMD DEFAULT_MSG AMD_LIBRARY AMD_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(
+ AMD_LIBRARY
+ AMD_INCLUDE_DIR
+)
--- /dev/null
+# Try to find Umfpack
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_PATH(Umfpack_INCLUDE_DIR umfpack.h
+ HINTS
+ $ENV{Umfpack_INCLUDE_DIR}
+ ${Umfpack_INCLUDE_DIR}
+)
+
+FIND_LIBRARY(Umfpack_LIBRARY
+ NAMES libumfpack.so
+ PATHS
+ $ENV{Umfpack_LIBRARY_DIR}
+ ${Umfpack_LIBRARY_DIR}
+ PATH_SUFFIXES lib64 lib
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Umfpack DEFAULT_MSG Umfpack_LIBRARY Umfpack_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(
+ Umfpack_LIBRARY
+ Umfpack_INCLUDE_DIR
+)
ENDIF()
INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
-# TODO: external_libraries
+
+SET(deal_ii_external_libraries
+ ${deal_ii_external_libraries}
+ ${TBB_LIBRARY}
+ )
+SET(deal_ii_external_debug_libraries
+ ${deal_ii_external_debug_libraries}
+ ${TBB_DEBUG_LIBRARY}) #TODO
SET(DEAL_II_USE_MT TRUE)
SET(DEAL_II_USE_MT_POSIX TRUE)
+FIND_PACKAGE(LAPACK REQUIRED)
+FIND_PACKAGE(BLAS REQUIRED)
+
+IF(DEAL_II_USE_CONTRIB)
+ # Compiles and links libumfpack, exports the Umfpack_* variables as well:
+ ADD_SUBDIRECTORY(contrib/umfpack)
+ELSE()
+ FIND_PACKAGE(Umfpack REQUIRED)
+ FIND_PACKAGE(AMD REQUIRED)
+ENDIF()
+
+INCLUDE_DIRECTORIES(${Umfpack_INCLUDE_DIR} ${AMD_INCLUDE_DIR})
+
+SET(deal_ii_external_libraries
+ ${deal_ii_external_libraries}
+ ${Umfpack_LIBRARY} ${AMD_LIBRARY} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
+ )
+
+SET(deal_ii_external_debug_libraries
+ ${deal_ii_external_debug_libraries}
+ ${Umfpack_LIBRARY} ${AMD_LIBRARY} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
+ )
${CMAKE_CURRENT_BINARY_DIR}/deal.II/base/config.h
)
-
#
#TODO: This perl script has to die...:
#
> ${CMAKE_CURRENT_BINARY_DIR}/deal.II/lac/lapack_templates.h
)
-ADD_CUSTOM_TARGET(deal_ii_target_dependencies ALL
+ADD_CUSTOM_TARGET(lapack_templates ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/deal.II/lac/lapack_templates.h
)
+
+ADD_DEPENDENCIES(deal_ii_target_dependencies lapack_templates)
+
ADD_SUBDIRECTORY(multigrid)
ADD_SUBDIRECTORY(numerics)
-ADD_LIBRARY(deal_II
+ADD_LIBRARY(deal_II SHARED
$<TARGET_OBJECTS:obj_base>
$<TARGET_OBJECTS:obj_distributed>
$<TARGET_OBJECTS:obj_dofs>