From c0eed76d31a4b44b2493017eef52ca710c016181 Mon Sep 17 00:00:00 2001 From: maier Date: Tue, 4 Feb 2014 18:57:07 +0000 Subject: [PATCH] CMake: Fix a configuration error on Debian Testing wrt. libSuiteSparse_config.a git-svn-id: https://svn.dealii.org/trunk@32403 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/modules/FindDEALII_LAPACK.cmake | 15 +++------------ deal.II/cmake/modules/FindUMFPACK.cmake | 19 ++++++++++++++++++- deal.II/cmake/setup_finalize.cmake | 5 ++--- deal.II/doc/news/changes.h | 6 ++++++ 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/deal.II/cmake/modules/FindDEALII_LAPACK.cmake b/deal.II/cmake/modules/FindDEALII_LAPACK.cmake index 4257ab332d..b16cf25b13 100644 --- a/deal.II/cmake/modules/FindDEALII_LAPACK.cmake +++ b/deal.II/cmake/modules/FindDEALII_LAPACK.cmake @@ -50,18 +50,9 @@ FIND_PACKAGE(LAPACK) SET(CMAKE_PREFIX_PATH ${_cmake_prefix_path_backup}) MARK_AS_ADVANCED( - atlas_LIBRARY - atlcblas_LIBRARY - atllapack_LIBRARY - blas_LIBRARY - eigen_blas_LIBRARY - f77blas_LIBRARY - gslcblas_LIBRARY - lapack_LIBRARY - m_LIBRARY - ptf77blas_LIBRARY - ptlapack_LIBRARY - refblas_LIBRARY + atlas_LIBRARY atlcblas_LIBRARY atllapack_LIBRARY blas_LIBRARY + eigen_blas_LIBRARY f77blas_LIBRARY gslcblas_LIBRARY lapack_LIBRARY + m_LIBRARY ptf77blas_LIBRARY ptlapack_LIBRARY refblas_LIBRARY reflapack_LIBRARY ) diff --git a/deal.II/cmake/modules/FindUMFPACK.cmake b/deal.II/cmake/modules/FindUMFPACK.cmake index 7594366b1e..f3f5ac5657 100644 --- a/deal.II/cmake/modules/FindUMFPACK.cmake +++ b/deal.II/cmake/modules/FindUMFPACK.cmake @@ -105,6 +105,21 @@ FIND_UMFPACK_LIBRARY(CCOLAMD ccolamd) FIND_UMFPACK_LIBRARY(CAMD camd) FIND_UMFPACK_LIBRARY(SuiteSparse_config suitesparseconfig) +# +# Test whether libsuitesparseconfig.xxx can be used for shared library +# linkage. If not, exclude it from the command line. +# +LIST(APPEND CMAKE_REQUIRED_LIBRARIES + "-shared" + ${SuiteSparse_config_LIBRARY} + ) +SET(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS}) +CHECK_CXX_SOURCE_COMPILES("extern int SuiteSparse_version (int[3]); + void foo(int bar[3]) { SuiteSparse_version(bar);}" + LAPACK_SUITESPARSECONFIG_WITH_PIC + ) +RESET_CMAKE_REQUIRED() + IF(EXISTS ${UMFPACK_INCLUDE_DIR}/umfpack.h) FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MAJOR_STRING REGEX "#define.*UMFPACK_MAIN_VERSION") @@ -161,8 +176,10 @@ IF(UMFPACK_FOUND) ${COLAMD_LIBRARY} ${CAMD_LIBRARY} ${AMD_LIBRARY} - ${SuiteSparse_config_LIBRARY} ) + IF(LAPACK_SUITESPARSECONFIG_WITH_PIC OR NOT BUILD_SHARED_LIBS) + LIST(APPEND UMFPACK_LIBRARIES ${SuiteSparse_config_LIBRARY}) + ENDIF() # # For good measure: diff --git a/deal.II/cmake/setup_finalize.cmake b/deal.II/cmake/setup_finalize.cmake index 1bf76c12e8..22e0d65c08 100644 --- a/deal.II/cmake/setup_finalize.cmake +++ b/deal.II/cmake/setup_finalize.cmake @@ -38,7 +38,7 @@ ENDFOREACH() # # Sanity check: The variables defined in DEAL_II_REMOVED_FLAGS must not be -# used during the comfiguration stage: +# used during the configuration stage: # FOREACH(_flag ${DEAL_II_REMOVED_FLAGS}) IF(NOT "${_flag}" STREQUAL "") @@ -112,7 +112,6 @@ ENDFOREACH() # # Cleanup deal.IITargets.cmake in the build directory: # -FILE(WRITE +FILE(REMOVE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake - "" ) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 6aba67d558..c99951908f 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -124,6 +124,12 @@ inconvenience this causes.

Specific improvements

    +
  1. Fixed: A configuration error on Debian Testing where accidentally a + non-pic libSuiteSparse_config.a was picked up when building a shared + library up resulting in a link error. +
    + (Matthias Maier, 2014/02/04) +
  2. Changed: GridTools::transform() can now deal with meshes with hanging nodes.
    (Timo Heister, 2014/02/04) -- 2.39.5