From: maier Date: Wed, 12 Sep 2012 17:25:59 +0000 (+0000) Subject: Rudimentary linkage X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f412a9c1c8d6b3f5aaeedf14156b42f7282c384;p=dealii-svn.git Rudimentary linkage git-svn-id: https://svn.dealii.org/branches/branch_cmake@26320 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 8b8c927da1..6ce276ec48 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -42,51 +42,6 @@ SET(VERSION "8.0.pre") # # - - - -# -# General configuration for cmake: -# - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -SET(CMAKE_INCLUDE_CURRENT_DIR true) - -SET(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - "${CMAKE_SOURCE_DIR}/contrib/cmake/check/" - "${CMAKE_SOURCE_DIR}/contrib/cmake/configure/" - "${CMAKE_SOURCE_DIR}/contrib/cmake/macros/" - "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/" - ) - - - - -# -# Set up deal.II specific variables -# - -SET(DEAL_II_PACKAGE_BUGREPORT "dealii@dealii.org") -SET(DEAL_II_PACKAGE_NAME "deal.II") -SET(DEAL_II_PACKAGE_TARNAME ${DEAL_II_PACKAGE_NAME}) -SET(DEAL_II_PACKAGE_VERSION ${VERSION}) -SET(DEAL_II_PACKAGE_STRING "${DEAL_II_PACKAGE_NAME} ${DEAL_II_PACKAGE_VERSION}") -SET(DEAL_II_PACKAGE_URL "") -STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" DEAL_II_MAJOR "${VERSION}") -STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_MINOR "${VERSION}") -SET(DEAL_II_PATH ${CMAKE_INSTALL_PREFIX}) - - - -#TODO: -SET(CMAKE_CXX_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") -SET(CMAKE_C_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") - - - - # # General configuration options: # @@ -119,6 +74,10 @@ OPTION(DEAL_II_WITH_ZLIB "Build deal.II with support for zlib." ON) +# +# Options for library selection: +# + OPTION(DEAL_II_ALLOW_CONTRIB "Allow the use of contrib libraries bundled with the source tarball. Note: If set to off DEAL_II_FORCE_CONTRIB* will still pull in bundled @@ -143,9 +102,66 @@ OPTION(DEAL_II_FORCE_CONTRIB_UMFPACK "Always use the bundled umfpack library instead of an external one." OFF) +# +# Configuration options regarding linkage: +# + +#OPTION(DEAL_II_SET_SONAME +# "Set the soname." +# ON) + +# +# Compatibility support: +# + +OPTION(DEAL_II_COMPAT_MAPPING + "Backward compatibility support for functions and classes that do not + take an explicit mapping variable, but rather use a default Q1 mapping + instead." + ON) + + + +# +# General configuration for cmake: +# + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) + +SET(CMAKE_INCLUDE_CURRENT_DIR true) + +SET(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_SOURCE_DIR}/contrib/cmake/check/" + "${CMAKE_SOURCE_DIR}/contrib/cmake/configure/" + "${CMAKE_SOURCE_DIR}/contrib/cmake/macros/" + "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/" + ) + + + + +# +# Set up deal.II specific variables +# + +SET(DEAL_II_PACKAGE_BUGREPORT "dealii@dealii.org") +SET(DEAL_II_PACKAGE_NAME "deal.II") +SET(DEAL_II_PACKAGE_TARNAME ${DEAL_II_PACKAGE_NAME}) +SET(DEAL_II_PACKAGE_VERSION ${VERSION}) +SET(DEAL_II_PACKAGE_STRING "${DEAL_II_PACKAGE_NAME} ${DEAL_II_PACKAGE_VERSION}") +SET(DEAL_II_PACKAGE_URL "") +STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" DEAL_II_MAJOR "${VERSION}") +STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_MINOR "${VERSION}") +SET(DEAL_II_PATH ${CMAKE_INSTALL_PREFIX}) +#TODO: +SET(CMAKE_CXX_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") +SET(CMAKE_C_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") + + # # Now, configure a lot of things: # @@ -157,7 +173,7 @@ ADD_CUSTOM_TARGET(deal_ii_target_dependencies) # used to keep track of external libraries and necessary linker flags SET(deal_ii_external_libraries "") SET(deal_ii_external_debug_libraries "") -SET(deal_II_required_linker_flags "") +SET(deal_ii_required_linker_flags "") @@ -236,4 +252,3 @@ INCLUDE(macro_expand_instantiations) ADD_SUBDIRECTORY(include) ADD_SUBDIRECTORY(source) - diff --git a/deal.II/cmake-TODO b/deal.II/cmake-TODO index 9bfd63ef28..8f87d5bf13 100644 --- a/deal.II/cmake-TODO +++ b/deal.II/cmake-TODO @@ -2,6 +2,10 @@ Next steps: * Add the CFLAGS and CXXFLAGS magic. (With an option to overwrite for distribution packaging.) +* DEAL_II_DEPRECATED is not used at all... + +* Sanitize the building of the shared library. (At least for Linux...) + * Add Bug tests. * HDF5 diff --git a/deal.II/contrib/cmake/configure/configure_mpi.cmake b/deal.II/contrib/cmake/configure/configure_mpi.cmake index c0881018db..79b8ab1b6f 100644 --- a/deal.II/contrib/cmake/configure/configure_mpi.cmake +++ b/deal.II/contrib/cmake/configure/configure_mpi.cmake @@ -2,7 +2,7 @@ FIND_PACKAGE(MPI REQUIRED CXX) INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH}) -LIST(APPEND deal_II_required_linker_flags ${MPI_CXX_LINK_FLAGS}) +# LIST(APPEND deal_ii_required_linker_flags ${MPI_CXX_LINK_FLAGS}) # TODO LIST(APPEND deal_ii_external_libraries ${MPI_CXX_LIBRARIES}) LIST(APPEND deal_ii_external_debug_libraries ${MPI_CXX_LIBRARIES}) diff --git a/deal.II/contrib/cmake/configure/configure_umfpack.cmake b/deal.II/contrib/cmake/configure/configure_umfpack.cmake index 73b33ecbe9..ddf986f3c1 100644 --- a/deal.II/contrib/cmake/configure/configure_umfpack.cmake +++ b/deal.II/contrib/cmake/configure/configure_umfpack.cmake @@ -40,7 +40,7 @@ ELSE() INCLUDE_DIRECTORIES(${Umfpack_INCLUDE_DIR} ${AMD_INCLUDE_DIR}) - LIST(APPEND deal_II_required_linker_flags + LIST(APPEND deal_ii_required_linker_flags ${BLAS_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS} ) diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index e6c1a0bdd9..9f1adec80e 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -51,6 +51,13 @@ +/* Backward compatibility support for functions and classes that do not take + an explicit mapping variable, but rather use a default Q1 mapping instead + */ +#cmakedefine DEAL_II_COMPAT_MAPPING + + + /* * Configured in configure_boost.cmake: @@ -179,8 +186,6 @@ libstdc++ interface. */ #cmakedefine HAVE_LIBSTDCXX_DEMANGLER - SET(DEAL_II_DEPRECATED TRUE) - /* Equal to 0 in the generic case, equal to 1 if CPU compiled for supports SSE2, equal to 2 if CPU compiled for supports AVX */ #define DEAL_II_COMPILER_VECTORIZATION_LEVEL @DEAL_II_COMPILER_VECTORIZATION_LEVEL@ diff --git a/deal.II/include/deal.II/base/config.h.in.old b/deal.II/include/deal.II/base/config.h.in.old index 6ce0d15cfa..a0b43ac677 100644 --- a/deal.II/include/deal.II/base/config.h.in.old +++ b/deal.II/include/deal.II/base/config.h.in.old @@ -46,11 +46,6 @@ provided by the compiler. */ #cmakedefine DEAL_II_USE_DIRECT_ERRNO_H -/* Backward compatibility support for functions and classes that do not take - an explicit mapping variable, but rather use a default Q1 mapping instead - */ -#cmakedefine DEAL_II_COMPAT_MAPPING - /* Defined if the compiler has a bug in deducing the type of pointers to const member functions. */ #cmakedefine DEAL_II_CONST_MEMBER_DEDUCTION_BUG diff --git a/deal.II/source/CMakeLists.txt b/deal.II/source/CMakeLists.txt index b9d3d6dc78..2024a9dc7e 100644 --- a/deal.II/source/CMakeLists.txt +++ b/deal.II/source/CMakeLists.txt @@ -1,3 +1,10 @@ +# +# Compile the deal.II library +# + +# +# Each subdirectory specifies an OBJECT target: +# ADD_SUBDIRECTORY(base) ADD_SUBDIRECTORY(distributed) ADD_SUBDIRECTORY(dofs) @@ -8,6 +15,10 @@ ADD_SUBDIRECTORY(lac) ADD_SUBDIRECTORY(multigrid) ADD_SUBDIRECTORY(numerics) +# +# Combine all OBJECT targets to a shared library: +# + ADD_LIBRARY(deal_II SHARED $ $ @@ -18,5 +29,18 @@ ADD_LIBRARY(deal_II SHARED $ $ $ + + # for contrib stuff: ${deal_ii_additional_object_files} ) + +# +# Link all external libraries into the target: +# TODO: toggle for as-needed +# + +IF (CMAKE_BUILD_TYPE MATCHES "debug") + TARGET_LINK_LIBRARIES(deal_II ${deal_ii_required_linker_flags} ${deal_ii_external_debug_libraries}) +ELSE() + TARGET_LINK_LIBRARIES(deal_II ${deal_ii_required_linker_flags} ${deal_ii_external_libraries}) +ENDIF()