PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
)
-SET(ARPACK_LIBRARIES
- ${ARPACK_LIBRARY}
- ${LAPACK_LIBRARIES}
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ARPACK DEFAULT_MSG
+ ARPACK_LIBRARY
+ LAPACK_FOUND
)
-SET(ARPACK_LINKER_FLAGS
- ${LAPACK_LINKER_FLAGS}
- )
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ARPACK DEFAULT_MSG ARPACK_LIBRARIES)
-
IF(ARPACK_FOUND)
+ SET(ARPACK_LIBRARIES
+ ${ARPACK_LIBRARY} ${LAPACK_LIBRARIES}
+ )
+ SET(ARPACK_LINKER_FLAGS
+ ${LAPACK_LINKER_FLAGS}
+ )
+
MARK_AS_ADVANCED(
lapack_LIBRARY
atlas_LIBRARY
lib${LIB_SUFFIX} lib64 lib
)
-SET(HDF5_INCLUDE_DIRS
- ${HDF5_INCLUDE_DIR}
+SET(_output ${HDF5_LIBRARY} ${HDF5_HL_LIBRARY})
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDF5 DEFAULT_MSG
+ _output # Cosmetic: Gives nice output
+ HDF5_LIBRARY
+ HDF5_HL_LIBRARY
+ HDF5_INCLUDE_DIR
)
-SET(HDF5_LIBRARIES
- ${HDF5_LIBRARY}
- ${HDF5_HL_LIBRARY}
- )
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDF5 DEFAULT_MSG HDF5_LIBRARIES HDF5_INCLUDE_DIRS)
-
IF(HDF5_FOUND)
+ SET(HDF5_INCLUDE_DIRS
+ ${HDF5_INCLUDE_DIR}
+ )
+ SET(HDF5_LIBRARIES
+ ${HDF5_LIBRARY}
+ ${HDF5_HL_LIBRARY}
+ )
+
#
# Is hdf5 compiled with support for mpi?
#
build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libmetis
)
-SET(METIS_LIBRARIES ${METIS_LIBRARY})
-SET(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR})
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG METIS_LIBRARIES METIS_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG
+ METIS_LIBRARY
+ METIS_INCLUDE_DIR
+ )
IF(METIS_FOUND)
+ SET(METIS_LIBRARIES ${METIS_LIBRARY})
+ SET(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR})
+
#
# Extract the version number out of metis.h
#
# now. :-]
#
-FIND_PATH(MUMPS_INCLUDE_DIRS dmumps_c.h
+FIND_PATH(MUMPS_INCLUDE_DIR dmumps_c.h
HINTS
${MUMPS_DIR}
PATH_SUFFIXES
PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
)
-SET(MUMPS_LIBRARIES
- ${DMUMPS_LIBRARY}
- ${MUMPS_COMMON_LIBRARY}
- ${SCALAPACK_LIBRARIES}
- )
-
#
# If we can find libport.so (or similiar), link it in as well:
#
PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
)
MARK_AS_ADVANCED(PORD_LIBRARY)
-
-IF(NOT PORD_LIBRARY MATCHES "-NOTFOUND")
- LIST(APPEND MUMPS_LIBRARIES
- ${PORD_LIBRARY}
- )
+IF(PORD_LIBRARY MATCHES "-NOTFOUND")
+ SET(PORD_LIBRARY "")
+ UNSET(PORD_LIBRARY CACHE)
ENDIF()
-SET(MUMPS_LINKER_FLAGS
- ${SCALAPACK_LINKER_FLAGS}
+SET(_output ${DMUMPS_LIBRARY} ${MUMPS_COMMON_LIBRARY} ${PORD_LIBRARY})
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(MUMPS DEFAULT_MSG
+ _output # Cosmetic: Gives nice output
+ DMUMPS_LIBRARY
+ MUMPS_COMMON_LIBRARY
+ MUMPS_INCLUDE_DIR
+ SCALAPACK_FOUND
)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(MUMPS DEFAULT_MSG MUMPS_LIBRARIES)
-
IF(MUMPS_FOUND)
+ SET(MUMPS_INCLUDE_DIRS
+ ${MUMPS_INCLUDE_DIR}
+ )
+ SET(MUMPS_LIBRARIES
+ ${DMUMPS_LIBRARY}
+ ${MUMPS_COMMON_LIBRARY}
+ ${SCALAPACK_LIBRARIES}
+ )
+ SET(MUMPS_LINKER_FLAGS
+ ${SCALAPACK_LINKER_FLAGS}
+ )
+
MARK_AS_ADVANCED(
DMUMPS_LIBRARY
MUMPS_COMMON_LIBRARY
SET_IF_EMPTY(NETCDF_DIR "$ENV{NETCDF_DIR}")
-FIND_PATH(NETCDF_INCLUDE_DIRS netcdf.hh
+FIND_PATH(NETCDF_INCLUDE_DIR netcdf.hh
HINTS
${NETCDF_DIR}
PATH_SUFFIXES
lib${LIB_SUFFIX} lib64 lib
)
-SET(NETCDF_LIBRARIES
- ${NETCDF_CPLUSPLUS_LIBRARY}
- ${NETCDF_C_LIBRARY}
- )
-
+SET(_output ${NETCDF_CPLUSPLUS_LIBRARY} ${NETCDF_C_LIBRARY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETCDF DEFAULT_MSG
- NETCDF_LIBRARIES
- NETCDF_INCLUDE_DIRS
+ _output # Cosmetic: Gives nice output
+ NETCDF_CPLUSPLUS_LIBRARY
+ NETCDF_C_LIBRARY
+ NETCDF_INCLUDE_DIR
)
IF(NETCDF_FOUND)
+ SET(NETCDF_INCLUDE_DIRS
+ ${NETCDF_INCLUDE_DIR}
+ )
+ SET(NETCDF_LIBRARIES
+ ${NETCDF_CPLUSPLUS_LIBRARY}
+ ${NETCDF_C_LIBRARY}
+ )
+
MARK_AS_ADVANCED(
NETCDF_CPLUSPLUS_LIBRARY
NETCDF_C_LIBRARY
INCLUDE(FindPackageHandleStandardArgs)
SET_IF_EMPTY(P4EST_DIR "$ENV{P4EST_DIR}")
+SET_IF_EMPTY(SC_DIR "$ENV{SC_DIR}")
#
# We used to recommend installing p4est with a custom script that
# Search for the sc library, usually bundled with p4est. If no SC_DIR was
# given, take what we chose for p4est.
#
-SET_IF_EMPTY(SC_DIR "$ENV{SC_DIR}")
-SET_IF_EMPTY(SC_DIR "${P4EST_DIR}")
-FIND_PACKAGE(SC)
FIND_PATH(P4EST_INCLUDE_DIR p4est.h
HINTS
p4est include/p4est include src
)
+FIND_PATH(SC_INCLUDE_DIR sc.h
+ HINTS
+ ${SC_DIR}
+ ${P4EST_DIR}
+ PATH_SUFFIXES
+ sc include/p4est include src sc/src
+ )
+
FIND_LIBRARY(P4EST_LIBRARY
NAMES p4est
HINTS
lib${LIB_SUFFIX} lib64 lib src
)
-SET(P4EST_LIBRARIES
- ${P4EST_LIBRARY}
- ${SC_LIBRARY}
- )
-
-SET(P4EST_INCLUDE_DIRS
- ${P4EST_INCLUDE_DIR}
- ${SC_INCLUDE_DIR}
+FIND_LIBRARY(SC_LIBRARY
+ NAMES sc
+ HINTS
+ ${SC_DIR}
+ ${P4EST_DIR}
+ PATH_SUFFIXES
+ lib${LIB_SUFFIX} lib64 lib src sc/src
)
+SET(_output ${P4EST_LIBRARY} ${SC_LIBRARY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG
- P4EST_LIBRARIES
- P4EST_INCLUDE_DIRS
+ P4EST_LIBRARY
+ SC_LIBRARY
+ P4EST_INCLUDE_DIR
+ SC_INCLUDE_DIR
)
IF(P4EST_FOUND)
+ SET(P4EST_LIBRARIES
+ ${P4EST_LIBRARY}
+ ${SC_LIBRARY}
+ )
+ SET(P4EST_INCLUDE_DIRS
+ ${P4EST_INCLUDE_DIR}
+ ${SC_INCLUDE_DIR}
+ )
+
#
# Determine mpi support of p4est:
#
# against someday to avoid underlinkage
#
-FIND_LIBRARY(PETSC_LIBRARIES
+FIND_LIBRARY(PETSC_LIBRARY
NAMES petsc
HINTS
# petsc is special. Account for that
# So, up to this point it was easy. Now, the tricky part:
#
-
#
# Search for the first part of the includes:
#
# ${PETSC_DIR}/${PETSC_ARCH}/include
# /usr/include/petsc ...
#
-# Either way, petscversion.h should lie around:
+# Either way, we must be able to find petscversion.h:
#
FIND_PATH(PETSC_INCLUDE_DIR_COMMON petscversion.h
HINTS
PATH_SUFFIXES petsc include include/petsc
)
-#
-# And finally set PETSC_INCLUDE_DIRS depending on the outcome of our crude
-# guess:
-#
-IF( PETSC_INCLUDE_DIR_ARCH MATCHES "-NOTFOUND" OR
- PETSC_INCLUDE_DIR_COMMON MATCHES "-NOTFOUND" )
- SET(PETSC_INCLUDE_DIRS "PETSC_INCLUDE_DIRS-NOTFOUND"
- CACHE STRING "Include paths for petsc"
- FORCE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PETSC DEFAULT_MSG
+ PETSC_LIBRARY
+ PETSC_INCLUDE_DIR_ARCH
+ PETSC_INCLUDE_DIR_COMMON
+ )
+
+IF(PETSC_FOUND)
+ SET(PETSC_LIBRARIES
+ ${PETSC_LIBRARY}
)
- UNSET(PETSC_INCLUDE_DIR_ARCH CACHE)
- UNSET(PETSC_INCLUDE_DIR_COMMON CACHE)
-ELSE()
- UNSET(PETSC_INCLUDE_DIRS CACHE)
SET(PETSC_INCLUDE_DIRS
${PETSC_INCLUDE_DIR_ARCH}
${PETSC_INCLUDE_DIR_COMMON}
)
-ENDIF()
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PETSC DEFAULT_MSG
- PETSC_LIBRARIES
- PETSC_INCLUDE_DIRS
- )
-IF(PETSC_FOUND)
SET(PETSC_PETSCCONF_H "${PETSC_INCLUDE_DIR_ARCH}/petscconf.h")
SET(PETSC_PETSCVERSION_H "${PETSC_INCLUDE_DIR_COMMON}/petscversion.h")
SET(PETSC_WITH_MPIUNI TRUE)
ENDIF()
- IF(PETSC_WITH_MPIUNI)
- #
- # TODO: Still needed? We have a way bigger problem with underlinkage so
- # far...
- #
- # If yes, add libmpiuni.so/a (if available)
- # We need to link with it on some systems where PETSc is built without
- # a real MPI and we need to handle trivial (one process) MPI
- # functionality.
- #
- FIND_LIBRARY(PETSC_LIBMPIUNI
- NAMES mpiuni
- HINTS
- ${PETSC_DIR}/${PETSC_ARCH}
- PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
- )
- IF(NOT PETSC_LIBMPIUNI MATCHES "-NOTFOUND")
- LIST(APPEND PETSC_LIBRARIES "${PETSC_LIBMPIUNI}")
- ELSE()
- SET(PETSC_LIBMPIUNI "")
- ENDIF()
- MARK_AS_ADVANCED(PETSC_LIBMPIUNI)
- ENDIF()
-
FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING
REGEX "#define.*PETSC_VERSION_MAJOR")
STRING(REGEX REPLACE "^.*PETSC_VERSION_MAJOR.*([0-9]+).*" "\\1"
+++ /dev/null
-#####
-##
-## Copyright (C) 2012 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
-##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
-
-#
-# Try to find SC
-#
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-SET_IF_EMPTY(P4EST_DIR "$ENV{P4EST_DIR}")
-SET_IF_EMPTY(SC_DIR "$ENV{SC_DIR}")
-
-FIND_PATH(SC_INCLUDE_DIR sc.h
- HINTS
- ${SC_DIR}
- ${P4EST_DIR}
- PATH_SUFFIXES
- sc include/p4est include src sc/src
- )
-
-
-FIND_LIBRARY(SC_LIBRARY
- NAMES sc
- HINTS
- ${SC_DIR}
- ${P4EST_DIR}
- PATH_SUFFIXES
- lib${LIB_SUFFIX} lib64 lib src sc/src
- )
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SC DEFAULT_MSG SC_LIBRARY SC_INCLUDE_DIR)
-
-IF(SC_FOUND)
- MARK_AS_ADVANCED(
- SC_LIBRARY
- SC_INCLUDE_DIR
- SC_DIR
- )
-ELSE()
- SET(SC_DIR "" CACHE STRING
- "An optional hint to an sc installation/directory"
- )
-ENDIF()
-
INCLUDE(FindPackageHandleStandardArgs)
-#
-# SCALAPACK needs LAPACK and BLAS as dependency, search for them with the help
-# of the LAPACK find module:
-#
-FIND_PACKAGE(LAPACK)
-
FIND_LIBRARY(SCALAPACK_LIBRARY NAMES scalapack
HINTS
${SCALAPACK_DIR}
lib${LIB_SUFFIX} lib64 lib
)
-SET(SCALAPACK_LIBRARIES
- ${SCALAPACK_LIBRARY}
- ${LAPACK_LIBRARIES}
- )
-
-SET(SCALAPACK_LINKER_FLAGS
- ${LAPACK_LINKER_FLAGS}
- )
+#
+# SCALAPACK needs LAPACK and BLAS as dependency, search for them with the help
+# of the LAPACK find module:
+#
+FIND_PACKAGE(LAPACK)
#
# Well, depending on the version of scalapack and the distribution it might
PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib LIB
)
IF(NOT ${_lib_upper}_LIBRARY MATCHES "-NOTFOUND")
- LIST(APPEND SCLAPACK_LIBRARIES
+ LIST(APPEND BLACS_LIBRARIES
${${_lib_upper}_LIBRARY}
)
ENDIF()
ENDFOREACH()
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCALAPACK DEFAULT_MSG SCALAPACK_LIBRARIES)
+SET(_output ${SCALAPACK_LIBRARY} ${BLACS_LIBRARIES})
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCALAPACK DEFAULT_MSG
+ _output # Cosmetic: Gives nice output
+ SCALAPACK_LIBRARY
+ LAPACK_FOUND
+ )
IF(SCALAPACK_FOUND)
+ SET(SCALAPACK_LIBRARIES
+ ${SCALAPACK_LIBRARY}
+ ${LAPACK_LIBRARIES}
+ ${BLACS_LIBRARIES}
+ )
+ SET(SCALAPACK_LINKER_FLAGS
+ ${LAPACK_LINKER_FLAGS}
+ )
+
MARK_AS_ADVANCED(
lapack_LIBRARY
atlas_LIBRARY
# mechanism.
#
-FIND_LIBRARY(SLEPC_LIBRARIES
+FIND_LIBRARY(SLEPC_LIBRARY
NAMES slepc
HINTS
# SLEPC is special. Account for that
PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
)
-
-#
-# So, up to this point it was easy. Now, the tricky part:
-#
-
-
-#
-# Search for the first part of the includes:
-#
FIND_PATH(SLEPC_INCLUDE_DIR_ARCH slepcconf.h
HINTS
# SLEPC is special. Account for that
PATH_SUFFIXES slepc include include/slepc
)
-#
-# Sometimes, this is not enough...
-# If SLEPc is not installed but in source tree layout, there will be
-# ${SLEPC_DIR}/${SLEPC_ARCH}/include - which we should have found by now.
-# ${SLEPC_DIR}/include - which we still have to find.
-#
-# Or it is installed in a non standard layout in the system (e.g. in
-# Gentoo), where there will be
-# ${SLEPC_DIR}/${SLEPC_ARCH}/include
-# /usr/include/slepc ...
-#
-# Either way, slepcversion.h should lie around:
-#
FIND_PATH(SLEPC_INCLUDE_DIR_COMMON slepcversion.h
HINTS
${SLEPC_DIR}
PATH_SUFFIXES slepc include include/slepc
)
-#
-# And finally set SLEPC_INCLUDE_DIRS depending on the outcome of our crude
-# guess:
-#
-IF( SLEPC_INCLUDE_DIR_ARCH MATCHES "-NOTFOUND" OR
- SLEPC_INCLUDE_DIR_COMMON MATCHES "-NOTFOUND" )
- SET(SLEPC_INCLUDE_DIRS "SLEPC_INCLUDE_DIRS-NOTFOUND"
- CACHE STRING "Include paths for SLEPC"
- FORCE
- )
- UNSET(SLEPC_INCLUDE_DIR_ARCH CACHE)
- UNSET(SLEPC_INCLUDE_DIR_COMMON CACHE)
-ELSE()
- UNSET(SLEPC_INCLUDE_DIRS CACHE)
- SET(SLEPC_INCLUDE_DIRS
- ${SLEPC_INCLUDE_DIR_ARCH}
- ${SLEPC_INCLUDE_DIR_COMMON}
- )
-ENDIF()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SLEPC DEFAULT_MSG
- SLEPC_LIBRARIES
- SLEPC_INCLUDE_DIRS
+ SLEPC_LIBRARY
+ SLEPC_INCLUDE_DIR_ARCH
+ SLEPC_INCLUDE_DIR_COMMON
+ PETSC_FOUND
)
IF(SLEPC_FOUND)
+ SET(SLEPC_INCLUDE_DIRS
+ ${SLEPC_INCLUDE_DIR_ARCH}
+ ${SLEPC_INCLUDE_DIR_COMMON}
+ )
+ SET(SLEPC_LIBRARIES
+ ${SLEPC_LIBRARY}
+ ${PETSC_LIBRARIES}
+ )
+
SET(SLEPC_SLEPCVERSION_H "${SLEPC_INCLUDE_DIR_COMMON}/slepcversion.h")
FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_MAJOR_STRING
ENDFOREACH()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TRILINOS DEFAULT_MSG
- TRILINOS_LIBRARIES
- TRILINOS_INCLUDE_DIRS
+ TRILINOS_LIBRARIES # cosmetic: Gives nice output
+ TRILINOS_FOUND
)
IF(TRILINOS_FOUND)
-
#
# Extract the major and minor version numbers:
#
IF(NOT "${ARGN}" STREQUAL "REQUIRED")
IF(${_comp}_LIBRARY MATCHES "-NOTFOUND")
SET(${_comp}_LIBRARY "")
+ UNSET(${_comp}_LIBRARY CACHE)
ENDIF()
ENDIF()
ENDMACRO()
#
# Search for include directories:
#
-
FIND_UMFPACK_PATH(UMFPACK umfpack.h)
FIND_UMFPACK_PATH(AMD amd.h)
REGEX "#include \"SuiteSparse_config.h\"")
IF(NOT "${UMFPACK_SUITESPARSE_STRING}" STREQUAL "")
FIND_UMFPACK_PATH(SuiteSparse_config SuiteSparse_config.h)
- LIST(APPEND required_variables SuiteSparse_config_INCLUDE_DIR)
+ LIST(APPEND _required SuiteSparse_config_INCLUDE_DIR)
ENDIF()
ENDIF()
-
#
# Link against everything we can find to avoid underlinkage:
#
FIND_UMFPACK_LIBRARY(SuiteSparse_config suitesparseconfig)
-SET(UMFPACK_LIBRARIES
- ${UMFPACK_LIBRARY}
- ${CHOLMOD_LIBRARY} # may be empty
- ${COLAMD_LIBRARY} # may be empty
- ${AMD_LIBRARY}
- ${SuiteSparse_config_LIBRARY} # may be empty
- ${LAPACK_LIBRARIES}
- )
-
-SET(UMFPACK_INCLUDE_DIRS
- ${UMFPACK_INCLUDE_DIR}
- ${AMD_INCLUDE_DIR}
- ${SuiteSparse_config_INCLUDE_DIR} # may be empty
- )
-
-SET(UMFPACK_LINKER_FLAGS
- ${LAPACK_LINKER_FLAGS}
+SET(_output ${UMFPACK_LIBRARY} ${CHOLMOD_LIBRARY} ${COLAMD_LIBRARY} ${AMD_LIBRARY} ${SuiteSparse_config_LIBRARY})
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG
+ _output # Cosmetic: Gives nice output
+ UMFPACK_LIBRARY
+ AMD_LIBRARY
+ UMFPACK_INCLUDE_DIR
+ AMD_INCLUDE_DIR
+ ${_required}
+ LAPACK_FOUND
)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG UMFPACK_LIBRARIES UMFPACK_INCLUDE_DIRS)
IF(UMFPACK_FOUND)
+ SET(UMFPACK_LIBRARIES
+ ${UMFPACK_LIBRARY}
+ ${CHOLMOD_LIBRARY}
+ ${COLAMD_LIBRARY}
+ ${AMD_LIBRARY}
+ ${SuiteSparse_config_LIBRARY}
+ ${LAPACK_LIBRARIES}
+ )
+ SET(UMFPACK_INCLUDE_DIRS
+ ${UMFPACK_INCLUDE_DIR}
+ ${AMD_INCLUDE_DIR}
+ ${SuiteSparse_config_INCLUDE_DIR}
+ )
+ SET(UMFPACK_LINKER_FLAGS
+ ${LAPACK_LINKER_FLAGS}
+ )
+
MARK_AS_ADVANCED(
atlas_LIBRARY
blas_LIBRARY