From: Matthias Maier Date: Thu, 11 Jul 2013 14:21:04 +0000 (+0000) Subject: CMake: Fix link interface for static blas/lapack X-Git-Tag: v8.0.0~154 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45312f8328aec4661a369081e9a600814564b7ea;p=dealii.git CMake: Fix link interface for static blas/lapack git-svn-id: https://svn.dealii.org/trunk@29966 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/configure/configure_1_lapack.cmake b/deal.II/cmake/configure/configure_1_lapack.cmake index 6445f6b1f1..00f92171e7 100644 --- a/deal.II/cmake/configure/configure_1_lapack.cmake +++ b/deal.II/cmake/configure/configure_1_lapack.cmake @@ -19,6 +19,20 @@ MACRO(FEATURE_LAPACK_FIND_EXTERNAL var) FIND_PACKAGE(LAPACK) + # + # Well, in case of static archives we have to manually pick up the + # complete link interface. *sigh* + # + # Do this unconditionally for the most common case: + # TODO: Non-GNU setups... + # + IF(NOT m_lib MATCHES "-NOTFOUND") + LIST(APPEND LAPACK_LIBRARIES ${m_lib}) + ENDIF() + + ENABLE_IF_LINKS(LAPACK_LINKER_FLAGS "-lgfortran") + ENABLE_IF_LINKS(LAPACK_LINKER_FLAGS "-lquadmath") + IF(LAPACK_FOUND) MARK_AS_ADVANCED( atlas_LIBRARY @@ -52,15 +66,6 @@ SET(DEAL_II_LAPACK_FUNCTIONS MACRO(CHECK_FOR_LAPACK_FUNCTIONS) SET(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES}) - # - # For some static lapack versions it is necessary to link with -lm. - # So link with it as well if -lm is already present in our link - # interface: - # - IF(NOT m_lib MATCHES "-NOTFOUND") - LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${m_lib}) - ENDIF() - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}") FOREACH(_func ${DEAL_II_LAPACK_FUNCTIONS})