From: maier Date: Sun, 16 Sep 2012 18:39:56 +0000 (+0000) Subject: Add support for metis X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8feab06efe5571720b3892d61764d6b5b65fcfca;p=dealii-svn.git Add support for metis git-svn-id: https://svn.dealii.org/branches/branch_cmake@26415 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 8a7952e4fd..9a6228be65 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -113,7 +113,7 @@ OPTION(DEAL_II_WITH_LAPACK OPTION(DEAL_II_WITH_METIS "Build deal.II with support for Metis." - OFF) + ON) 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." - OFF) + ON) OPTION(DEAL_II_WITH_TBB "Build deal.II with support for tbb. This will enable thread support in deal.II." @@ -132,7 +132,7 @@ OPTION(DEAL_II_FORCE_CONTRIB_TBB OPTION(DEAL_II_WITH_UMFPACK "Build deal.II with support for UMFPACK." - ON) + OFF) OPTION(DEAL_II_FORCE_CONTRIB_UMFPACK "Always use the bundled umfpack library instead of an external one." OFF) @@ -143,7 +143,7 @@ OPTION(DEAL_II_WITH_ZLIB OPTION(DEAL_II_FORCE_CONTRIB_BOOST "Always use the bundled boost library instead of an external one." - ON) + OFF) # @@ -259,6 +259,8 @@ INCLUDE(configure_umfpack) INCLUDE(configure_functionparser) +INCLUDE(configure_metis) + INCLUDE(configure_mpi) INCLUDE(configure_netcdf) diff --git a/deal.II/contrib/cmake/configure/configure_metis.cmake b/deal.II/contrib/cmake/configure/configure_metis.cmake new file mode 100644 index 0000000000..f749799032 --- /dev/null +++ b/deal.II/contrib/cmake/configure/configure_metis.cmake @@ -0,0 +1,43 @@ +# +# Configuration for the netcdf library: +# + +MACRO(FIND_FEATURE_METIS_EXTERNAL var) + + FIND_PACKAGE(METIS) + + IF(METIS_FOUND) + SET(${var} TRUE) + ENDIF() + +ENDMACRO() + + +MACRO(CONFIGURE_FEATURE_METIS_EXTERNAL var) + + INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIR}) + LIST(APPEND deal_ii_external_libraries ${METIS_LIBRARY}) + + SET(DEAL_II_USE_METIS TRUE) + + SET(${var} TRUE) +ENDMACRO() + + +MACRO(CONFIGURE_FEATURE_METIS_ERROR_MESSAGE) + + MESSAGE(SEND_ERROR " +Could not find the metis library! + +Please ensure that the metis library is installed on your computer. +If the library is not at a default location, either provide some hints +via environment variables: +METIS_LIBRARY_DIR METIS_INCLUDE_DIR +Or set the relevant variables by hand in ccmake. + +") + +ENDMACRO() + + +CONFIGURE_FEATURE(METIS) diff --git a/deal.II/contrib/cmake/configure/configure_netcdf.cmake b/deal.II/contrib/cmake/configure/configure_netcdf.cmake index 6afb37a9e7..102d19400d 100644 --- a/deal.II/contrib/cmake/configure/configure_netcdf.cmake +++ b/deal.II/contrib/cmake/configure/configure_netcdf.cmake @@ -30,7 +30,9 @@ Could not find the netcdf library! Please ensure that the netcdf library is installed on your computer. If the library is not at a default location, either provide some hints -for the autodetection, or set the relevant variables by hand in ccmake. +via environment variables: +NETCDF_LIBRARY_DIR NETCDF_INCLUDE_DIR +Or set the relevant variables by hand in ccmake. ") diff --git a/deal.II/contrib/cmake/modules/FindAMD.cmake b/deal.II/contrib/cmake/modules/FindAMD.cmake index d8e96d8c40..b595db9829 100644 --- a/deal.II/contrib/cmake/modules/FindAMD.cmake +++ b/deal.II/contrib/cmake/modules/FindAMD.cmake @@ -9,7 +9,7 @@ FIND_PATH(AMD_INCLUDE_DIR amd.h ) FIND_LIBRARY(AMD_LIBRARY - NAMES libumfpack.so + NAMES amd PATHS $ENV{AMD_LIBRARY_DIR} ${AMD_LIBRARY_DIR} diff --git a/deal.II/contrib/cmake/modules/FindMETIS.cmake b/deal.II/contrib/cmake/modules/FindMETIS.cmake new file mode 100644 index 0000000000..881d6cb068 --- /dev/null +++ b/deal.II/contrib/cmake/modules/FindMETIS.cmake @@ -0,0 +1,26 @@ +# Try to find METIS + +INCLUDE(FindPackageHandleStandardArgs) + +FIND_PATH(METIS_INCLUDE_DIR metis/metis.h + HINTS + $ENV{NETCDF_INCLUDE_DIR} + ${NETCDF_INCLUDE_DIR} +) + +FIND_LIBRARY(METIS_LIBRARY + NAMES metis + PATHS + $ENV{NETCDF_LIBRARY_DIR} + ${NETCDF_LIBRARY_DIR} + PATH_SUFFIXES lib64 lib +) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG METIS_LIBRARY METIS_INCLUDE_DIR) + +IF(METIS_FOUND) + MARK_AS_ADVANCED( + METIS_LIBRARY + METIS_INCLUDE_DIR + ) +ENDIF() diff --git a/deal.II/contrib/cmake/modules/FindNETCDF.cmake b/deal.II/contrib/cmake/modules/FindNETCDF.cmake index 600ecf3a1b..b68b318cdc 100644 --- a/deal.II/contrib/cmake/modules/FindNETCDF.cmake +++ b/deal.II/contrib/cmake/modules/FindNETCDF.cmake @@ -9,7 +9,7 @@ FIND_PATH(NETCDF_INCLUDE_DIR netcdf.hh ) FIND_LIBRARY(NETCDF_LIBRARY - NAMES libnetcdf_c++.so libnetcdf_cpp.so + NAMES netcdf_c++ netcdf_cpp PATHS $ENV{NETCDF_LIBRARY_DIR} ${NETCDF_LIBRARY_DIR} diff --git a/deal.II/contrib/cmake/modules/FindTBB.cmake b/deal.II/contrib/cmake/modules/FindTBB.cmake index 86535929e0..66dfc7ac44 100644 --- a/deal.II/contrib/cmake/modules/FindTBB.cmake +++ b/deal.II/contrib/cmake/modules/FindTBB.cmake @@ -9,7 +9,7 @@ FIND_PATH(TBB_INCLUDE_DIR tbb/parallel_reduce.h ) FIND_LIBRARY(TBB_LIBRARY - NAMES libtbb.so + NAMES tbb PATHS $ENV{TBB_LIBRARY_DIR} ${TBB_LIBRARY_DIR} @@ -17,7 +17,7 @@ FIND_LIBRARY(TBB_LIBRARY ) FIND_LIBRARY(TBB_DEBUG_LIBRARY - NAMES libtbb_debug.so + NAMES tbb_debug PATHS $ENV{TBB_DEBUG_LIBRARY_DIR} ${TBB_DEBUG_LIBRARY_DIR} diff --git a/deal.II/contrib/cmake/modules/FindUMFPACK.cmake b/deal.II/contrib/cmake/modules/FindUMFPACK.cmake index 9e7471330d..be0c325eed 100644 --- a/deal.II/contrib/cmake/modules/FindUMFPACK.cmake +++ b/deal.II/contrib/cmake/modules/FindUMFPACK.cmake @@ -9,7 +9,7 @@ FIND_PATH(UMFPACK_INCLUDE_DIR umfpack.h ) FIND_LIBRARY(UMFPACK_LIBRARY - NAMES libumfpack.so + NAMES umfpack PATHS $ENV{UMFPACK_LIBRARY_DIR} ${UMFPACK_LIBRARY_DIR} diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index 09df9bcc65..459ada2fff 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -123,6 +123,13 @@ /* Defined if you have the `functionparser' library */ #cmakedefine HAVE_FUNCTIONPARSER +/**************************************** + * Configured in configure_metis.cmake: * + ****************************************/ + +/* Defined if a Metis installation was found and is going to be used */ +#cmakedefine DEAL_II_USE_METIS + /************************************** * Configured in configure_mpi.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 1d08801e38..fd7b04580e 100644 --- a/deal.II/include/deal.II/base/config.h.in.old +++ b/deal.II/include/deal.II/base/config.h.in.old @@ -150,9 +150,6 @@ /* Defined if an ARPACK installation was found and is going to be used */ #cmakedefine DEAL_II_USE_ARPACK -/* Defined if a Metis installation was found and is going to be used */ -#cmakedefine DEAL_II_USE_METIS - /* Defined if a MUMPS installation was found and is going to be used */ #cmakedefine DEAL_II_USE_MUMPS