ENDMACRO()
+#
+# We do a fine grained check for availability of every single LAPACK
+# function we use. We have to ensure that this check is repeated every time
+# the lapack library or DEAL_II_WITH_LAPACK changes.
+#
+# TODO: Known bug: At the moment we don't cover the case if the lapack
+# library changes.
+#
+
+SET(DEAL_II_LAPACK_FUNCTIONS
+ daxpy_ dgeev_ dgeevx_ dgelsd_ dgemm_ dgemv_ dgeqrf_ dgesdd_ dgesvd_ dgetrf_
+ dgetri_ dgetrs_ dorgqr_ dormqr_ dstev_ dsyevx_ dsygvx_ saxpy_ sgeev_ sgeevx_
+ sgelsd_ sgemm_ sgemv_ sgeqrf_ sgesdd_ sgesvd_ sgetrf_ sgetri_ sgetrs_ sorgqr_
+ sormqr_ sstev_ ssyevx_ ssygvx_ strtrs_
+ )
+
+MACRO(CHECK_FOR_LAPACK_FUNCTIONS)
+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}")
+ ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
+
+ FOREACH(func ${DEAL_II_LAPACK_FUNCTIONS})
+ STRING(TOUPPER ${func} func_uppercase)
+ CHECK_FUNCTION_EXISTS(${func} HAVE_${func_uppercase})
+ ENDFOREACH()
+
+ LIST(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}")
+ STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
+ENDMACRO()
+
+
+MACRO(RESET_LAPACK_FUNCTIONS_CACHE)
+ FOREACH(func ${DEAL_II_LAPACK_FUNCTIONS})
+ STRING(TOUPPER ${func} func_uppercase)
+ UNSET(HAVE_${func_uppercase} CACHE)
+ ENDFOREACH()
+ENDMACRO()
+
MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL var)
ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
${LAPACK_LIBRARIES}
)
- LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}")
- ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
- CHECK_FUNCTION_EXISTS(daxpy_ HAVE_DAXPY_)
- CHECK_FUNCTION_EXISTS(dgeevx_ HAVE_DGEEVX_)
- CHECK_FUNCTION_EXISTS(dgeev_ HAVE_DGEEV_)
- CHECK_FUNCTION_EXISTS(dgelsd_ HAVE_DGELSD_)
- CHECK_FUNCTION_EXISTS(dgemm_ HAVE_DGEMM_)
- CHECK_FUNCTION_EXISTS(dgemv_ HAVE_DGEMV_)
- CHECK_FUNCTION_EXISTS(dgeqrf_ HAVE_DGEQRF_)
- CHECK_FUNCTION_EXISTS(dgesdd_ HAVE_DGESDD_)
- CHECK_FUNCTION_EXISTS(dgesvd_ HAVE_DGESVD_)
- CHECK_FUNCTION_EXISTS(dgetrf_ HAVE_DGETRF_)
- CHECK_FUNCTION_EXISTS(dgetri_ HAVE_DGETRI_)
- CHECK_FUNCTION_EXISTS(dgetrs_ HAVE_DGETRS_)
- CHECK_FUNCTION_EXISTS(dorgqr_ HAVE_DORGQR_)
- CHECK_FUNCTION_EXISTS(dormqr_ HAVE_DORMQR_)
- CHECK_FUNCTION_EXISTS(dstev_ HAVE_DSTEV_)
- CHECK_FUNCTION_EXISTS(dsyevx_ HAVE_DSYEVX_)
- CHECK_FUNCTION_EXISTS(dsygvx_ HAVE_DSYGVX_)
- CHECK_FUNCTION_EXISTS(saxpy_ HAVE_SAXPY_)
- CHECK_FUNCTION_EXISTS(sgeevx_ HAVE_SGEEVX_)
- CHECK_FUNCTION_EXISTS(sgeev_ HAVE_SGEEV_)
- CHECK_FUNCTION_EXISTS(sgelsd_ HAVE_SGELSD_)
- CHECK_FUNCTION_EXISTS(sgemm_ HAVE_SGEMM_)
- CHECK_FUNCTION_EXISTS(sgemv_ HAVE_SGEMV_)
- CHECK_FUNCTION_EXISTS(sgeqrf_ HAVE_SGEQRF_)
- CHECK_FUNCTION_EXISTS(sgesdd_ HAVE_SGESDD_)
- CHECK_FUNCTION_EXISTS(sgesvd_ HAVE_SGESVD_)
- CHECK_FUNCTION_EXISTS(sgetrf_ HAVE_SGETRF_)
- CHECK_FUNCTION_EXISTS(sgetri_ HAVE_SGETRI_)
- CHECK_FUNCTION_EXISTS(sgetrs_ HAVE_SGETRS_)
- CHECK_FUNCTION_EXISTS(sorgqr_ HAVE_SORGQR_)
- CHECK_FUNCTION_EXISTS(sormqr_ HAVE_SORMQR_)
- CHECK_FUNCTION_EXISTS(sstev_ HAVE_SSTEV_)
- CHECK_FUNCTION_EXISTS(ssyevx_ HAVE_SSYEVX_)
- CHECK_FUNCTION_EXISTS(ssygvx_ HAVE_SSYGVX_)
- CHECK_FUNCTION_EXISTS(strtrs_ HAVE_STRTRS_)
-
- LIST(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}")
- STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
+ CHECK_FOR_LAPACK_FUNCTIONS()
SET(HAVE_LIBLAPACK TRUE)
CONFIGURE_FEATURE(LAPACK)
+#
+# Call RESET_LAPACK_FUNCTIONS_CHECK if DEAL_II_WITH_LAPACK is unset to
+# clean the configuration
+#
+IF(NOT DEAL_II_WITH_LAPACK)
+ RESET_LAPACK_FUNCTIONS_CACHE()
+ENDIF()
+