From 4745e9ee99cf186132aa09ce79aec09ffae59ba6 Mon Sep 17 00:00:00 2001 From: maier Date: Sun, 16 Sep 2012 20:41:25 +0000 Subject: [PATCH] The rest of the blas and lapack configuration git-svn-id: https://svn.dealii.org/branches/branch_cmake@26424 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 10 +-- deal.II/cmake-TODO | 6 +- .../cmake/configure/configure_blas.cmake | 31 +++++++- .../cmake/configure/configure_lapack.cmake | 32 +++++++-- deal.II/include/deal.II/base/config.h.in | 70 +++++++++++++++++-- deal.II/include/deal.II/base/config.h.in.old | 58 --------------- 6 files changed, 126 insertions(+), 81 deletions(-) diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 9a6228be65..ce8128fd40 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -97,23 +97,23 @@ OPTION(DEAL_II_ALLOW_CONTRIB OPTION(DEAL_II_WITH_BLAS "Build deal.II with support for BLAS." - OFF) + ON) OPTION(DEAL_II_WITH_FUNCTIONPARSER "Build deal.II with support for functionparser." OFF) OPTION(DEAL_II_FORCE_CONTRIB_FUNCTIONPARSER "Always use the bundled functionparser library instead of an external one." - ON) + OFF) OPTION(DEAL_II_WITH_LAPACK "Build deal.II with support for LAPACK." - OFF) + ON) OPTION(DEAL_II_WITH_METIS "Build deal.II with support for Metis." - ON) + OFF) OPTION(DEAL_II_WITH_MPI "Build deal.II with support for mpi." @@ -121,7 +121,7 @@ OPTION(DEAL_II_WITH_MPI OPTION(DEAL_II_WITH_NETCDF "Build deal.II with support for netcdf." - ON) + OFF) OPTION(DEAL_II_WITH_TBB "Build deal.II with support for tbb. This will enable thread support in deal.II." diff --git a/deal.II/cmake-TODO b/deal.II/cmake-TODO index 403d508ae7..ea79ebcbed 100644 --- a/deal.II/cmake-TODO +++ b/deal.II/cmake-TODO @@ -1,10 +1,6 @@ Next steps: -* Add the CFLAGS and CXXFLAGS magic. (With an option to overwrite for distribution packaging.) - -* DEAL_II_DEPRECATED is not used at all... - -* Migrate the build of TBB to cmake. +* Add the compiler dependent CFLAGS and CXXFLAGS magic. * Add Bug tests diff --git a/deal.II/contrib/cmake/configure/configure_blas.cmake b/deal.II/contrib/cmake/configure/configure_blas.cmake index f204114988..8dca2da1b6 100644 --- a/deal.II/contrib/cmake/configure/configure_blas.cmake +++ b/deal.II/contrib/cmake/configure/configure_blas.cmake @@ -2,9 +2,7 @@ # Configuration for the blas library: # -# TODO: -# - include dir? -# - unit checks and definitions. +INCLUDE(CheckFunctionExists) MACRO(FIND_FEATURE_BLAS_EXTERNAL var) @@ -27,6 +25,33 @@ MACRO(CONFIGURE_FEATURE_BLAS_EXTERNAL var) ${BLAS_LIBRARIES} ) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${BLAS_LIBRARIES}") + LIST(APPEND CMAKE_REQUIRED_FLAGS "${BLAS_LINKER_FLAGS}") + + # + # TODO: Reduce to the really necessary parts. + # + CHECK_FUNCTION_EXISTS(daxpy_ HAVE_DAXPY_) + CHECK_FUNCTION_EXISTS(dgeevx_ HAVE_DGEEVX_) + CHECK_FUNCTION_EXISTS(dgeev_ AVE_DGEEV_) + CHECK_FUNCTION_EXISTS(dgelsd_ HAVE_DGELSD_) + CHECK_FUNCTION_EXISTS(dgemm_ AVE_DGEMM_) + CHECK_FUNCTION_EXISTS(dgemv_ AVE_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_ AVE_DSTEV_) + CHECK_FUNCTION_EXISTS(dsyevx_ HAVE_DSYEVX_) + CHECK_FUNCTION_EXISTS(dsygvx_ HAVE_DSYGVX_) + + LIST(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${BLAS_LIBRARIES}") + LIST(REMOVE_ITEM CMAKE_REQUIRED_FLAGS "${BLAS_LINKER_FLAGS}") + SET(HAVE_LIBBLAS TRUE) SET(${var} TRUE) diff --git a/deal.II/contrib/cmake/configure/configure_lapack.cmake b/deal.II/contrib/cmake/configure/configure_lapack.cmake index 7d022a8477..b7507df24d 100644 --- a/deal.II/contrib/cmake/configure/configure_lapack.cmake +++ b/deal.II/contrib/cmake/configure/configure_lapack.cmake @@ -2,10 +2,6 @@ # Configuration for the lapack library: # -# TODO: -# - include dir? -# - unit checks and definitions. - MACRO(FIND_FEATURE_LAPACK_EXTERNAL var) FIND_PACKAGE(LAPACK) @@ -27,6 +23,34 @@ MACRO(CONFIGURE_FEATURE_LAPACK_EXTERNAL var) ${LAPACK_LIBRARIES} ) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}") + LIST(APPEND CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}") + + # + # TODO: Reduce to the really necessary parts. + # + 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}") + LIST(REMOVE_ITEM CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}") + SET(HAVE_LIBLAPACK TRUE) SET(${var} TRUE) diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index 459ada2fff..7067af9d67 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -64,6 +64,9 @@ * Configured in configure_blas.cmake: * ***************************************/ +/* Defined if deal.II was configured with BLAS support */ +#cmakedefine HAVE_LIBBLAS + /* Define to 1 if you have the `daxpy_' function. */ #cmakedefine HAVE_DAXPY_ @@ -123,6 +126,67 @@ /* Defined if you have the `functionparser' library */ #cmakedefine HAVE_FUNCTIONPARSER + +/***************************************** + * Configured in configure_lapack.cmake: * + *****************************************/ + +/* Defined if deal.II was configured with LAPACK support */ +#cmakedefine HAVE_LIBLAPACK + +/* Define to 1 if you have the `sgeevx_' function. */ +#cmakedefine HAVE_SGEEVX_ + +/* Define to 1 if you have the `sgeev_' function. */ +#cmakedefine HAVE_SGEEV_ + +/* Define to 1 if you have the `sgelsd_' function. */ +#cmakedefine HAVE_SGELSD_ + +/* Define to 1 if you have the `sgemm_' function. */ +#cmakedefine HAVE_SGEMM_ + +/* Define to 1 if you have the `sgemv_' function. */ +#cmakedefine HAVE_SGEMV_ + +/* Define to 1 if you have the `sgeqrf_' function. */ +#cmakedefine HAVE_SGEQRF_ + +/* Define to 1 if you have the `sgesdd_' function. */ +#cmakedefine HAVE_SGESDD_ + +/* Define to 1 if you have the `sgesvd_' function. */ +#cmakedefine HAVE_SGESVD_ + +/* Define to 1 if you have the `sgetrf_' function. */ +#cmakedefine HAVE_SGETRF_ + +/* Define to 1 if you have the `sgetri_' function. */ +#cmakedefine HAVE_SGETRI_ + +/* Define to 1 if you have the `sgetrs_' function. */ +#cmakedefine HAVE_SGETRS_ + +/* Define to 1 if you have the `sorgqr_' function. */ +#cmakedefine HAVE_SORGQR_ + +/* Define to 1 if you have the `sormqr_' function. */ +#cmakedefine HAVE_SORMQR_ + +/* Define to 1 if you have the `sstev_' function. */ +#cmakedefine HAVE_SSTEV_ + +/* Define to 1 if you have the `ssyevx_' function. */ +#cmakedefine HAVE_SSYEVX_ + +/* Define to 1 if you have the `ssygvx_' function. */ +#cmakedefine HAVE_SSYGVX_ + +/* Defined if you have the `strtrs_' function. */ +#cmakedefine HAVE_STRTRS_ + + + /**************************************** * Configured in configure_metis.cmake: * ****************************************/ @@ -185,12 +249,6 @@ /* Defined if deal.II was configured with UMFPACK support */ #cmakedefine HAVE_LIBUMFPACK -/* Defined if deal.II was configured with BLAS support */ -#cmakedefine HAVE_LIBBLAS - -/* Defined if deal.II was configured with LAPACK support */ -#cmakedefine HAVE_LIBLAPACK - /*************************************** * Configured in configure_zlib.cmake: * 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 fd7b04580e..eb582e9c1d 100644 --- a/deal.II/include/deal.II/base/config.h.in.old +++ b/deal.II/include/deal.II/base/config.h.in.old @@ -250,60 +250,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SACADO_HPP -/* Define to 1 if you have the `saxpy_' function. */ -#cmakedefine HAVE_SAXPY_ - -/* Define to 1 if you have the `sgeevx_' function. */ -#cmakedefine HAVE_SGEEVX_ - -/* Define to 1 if you have the `sgeev_' function. */ -#cmakedefine HAVE_SGEEV_ - -/* Define to 1 if you have the `sgelsd_' function. */ -#cmakedefine HAVE_SGELSD_ - -/* Define to 1 if you have the `sgemm_' function. */ -#cmakedefine HAVE_SGEMM_ - -/* Define to 1 if you have the `sgemv_' function. */ -#cmakedefine HAVE_SGEMV_ - -/* Define to 1 if you have the `sgeqrf_' function. */ -#cmakedefine HAVE_SGEQRF_ - -/* Define to 1 if you have the `sgesdd_' function. */ -#cmakedefine HAVE_SGESDD_ - -/* Define to 1 if you have the `sgesvd_' function. */ -#cmakedefine HAVE_SGESVD_ - -/* Define to 1 if you have the `sgetrf_' function. */ -#cmakedefine HAVE_SGETRF_ - -/* Define to 1 if you have the `sgetri_' function. */ -#cmakedefine HAVE_SGETRI_ - -/* Define to 1 if you have the `sgetrs_' function. */ -#cmakedefine HAVE_SGETRS_ - -/* Define to 1 if you have the `sorgqr_' function. */ -#cmakedefine HAVE_SORGQR_ - -/* Define to 1 if you have the `sormqr_' function. */ -#cmakedefine HAVE_SORMQR_ - -/* Define to 1 if you have the `sstev_' function. */ -#cmakedefine HAVE_SSTEV_ - -/* Define to 1 if you have the `ssyevx_' function. */ -#cmakedefine HAVE_SSYEVX_ - -/* Define to 1 if you have the `ssygvx_' function. */ -#cmakedefine HAVE_SSYGVX_ - -/* Define to 1 if you have the `ssygv_' function. */ -#cmakedefine HAVE_SSYGV_ - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TEUCHOS_PARAMETERLIST_HPP @@ -432,7 +378,3 @@ # pragma warning( disable : 4789 ) // destination of memory copy is too small # pragma warning( disable : 4808 ) // case 'value' is not a valid value for switch condition of type 'bool #endif // DEAL_II_MSVC - - -/* Defined if you have the `strtrs_' function. */ -#cmakedefine HAVE_STRTRS_ /* TODO */ -- 2.39.5