# Feature configuration:
#
+INCLUDE(macro_message_not_found)
+
IF(DEAL_II_WITH_FUNCTIONPARSER)
INCLUDE(configure_functionparser)
ENDIF()
IF(NOT DEAL_II_FORCE_CONTRIB_BOOST)
- IF(DEAL_II_ALLOW_CONTRIB)
- FIND_PACKAGE (Boost COMPONENTS serialization thread)
+
+ FIND_PACKAGE (Boost COMPONENTS serialization thread)
+
+ IF(NOT DEAL_II_ALLOW_CONTRIB)
+ IF(NOT Boost_THREAD_FOUND OR NOT Boost_Serialization_FOUND)
+ macro_message_not_found("boost" "Boost")
+ ENDIF()
ELSE()
- FIND_PACKAGE (Boost COMPONENTS serialization thread REQUIRED)
+ # Get rid of this annoying unimportant variable:
+ MARK_AS_ADVANCED(Boost_DIR)
ENDIF()
- # Get rid of this annoying unimportant variable:
- MARK_AS_ADVANCED(Boost_DIR)
ENDIF()
IF(NOT DEAL_II_FORCE_CONTRIB_FUNCTIONPARSER)
- IF(DEAL_II_ALLOW_CONTRIB)
- # TODO: Write a module to search for functionparser
- ELSE()
+
+ IF(NOT DEAL_II_ALLOW_CONTRIB)
MESSAGE(FATAL_ERROR "FindFunctionparser.cmake not written, yet. :-[")
ENDIF()
+
ENDIF()
IF(DEAL_II_FORCE_CONTRIB_FUNCTIONPARSER OR NOT Functionparser_FOUND)
FIND_PACKAGE(MPI REQUIRED CXX)
+# TODO: A deal.II specific error message if mpi is not found
+
INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH})
LIST(APPEND deal_ii_required_linker_flags ${MPI_CXX_LINK_FLAGS})
-FIND_PACKAGE(Netcdf)
+FIND_PACKAGE(NETCDF)
- IF(NOT DEAL_II_ALLOW_CONTRIB AND NOT TBB_FOUND)
- macro_warning_not_found("TBB")
- ENDIF()
+IF(NOT NETCDF_FOUND)
+ macro_message_not_found("netcdf" "NETCDF")
+ENDIF()
-INCLUDE_DIRECTORIES(${Netcdf_INCLUDE_DIR})
+INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIR})
-LIST(APPEND deal_ii_external_libraries ${Netcdf_LIBRARY})
+LIST(APPEND deal_ii_external_libraries ${NETCDF_LIBRARY})
SET(HAVE_LIBNETCDF TRUE)
IF(NOT DEAL_II_FORCE_CONTRIB_TBB)
- IF(DEAL_II_ALLOW_CONTRIB)
- FIND_PACKAGE(TBB)
- ELSE()
- FIND_PACKAGE(TBB REQUIRED)
+
+ FIND_PACKAGE(TBB)
+
+ IF(NOT DEAL_II_ALLOW_CONTRIB AND NOT TBB_FOUND)
+ macro_message_not_found("tbb" "TBB")
ENDIF()
# In case we don't have a debug library:
FIND_PACKAGE(LAPACK REQUIRED)
FIND_PACKAGE(BLAS REQUIRED)
+# TODO: A deal.II specific error message if blas or lapack is not found
+
IF(NOT DEAL_II_FORCE_CONTRIB_UMFPACK)
- IF(DEAL_II_ALLOW_CONTRIB)
- FIND_PACKAGE(Umfpack)
- FIND_PACKAGE(AMD)
- ELSE()
- FIND_PACKAGE(Umfpack REQUIRED)
- FIND_PACKAGE(AMD REQUIRED)
- ENDIF()
- IF(UMFPACK_FOUND AND AMD_FOUND)
- SET(UmfpackAMD_FOUND TRUE)
- ELSE()
- SET(UmfpackAMD_FOUND FALSE)
+ FIND_PACKAGE(UMFPACK)
+ FIND_PACKAGE(AMD)
+
+ IF(NOT DEAL_II_ALLOW_CONTRIB)
+ IF(NOT UMFPACK_FOUND)
+ macro_message_not_found("umfpack" "UMFPACK")
+ ENDIF()
+ IF(NOT AMD_FOUND)
+ macro_message_not_found("amd" "AMD")
+ ENDIF()
ENDIF()
+
+ENDIF()
+
+IF(UMFPACK_FOUND AND AMD_FOUND) # TODO
+ SET(UMFPACKAMD_FOUND TRUE)
+ELSE()
+ SET(UMFPACKAMD_FOUND FALSE)
ENDIF()
-IF(DEAL_II_FORCE_CONTRIB_UMFPACK OR NOT UmfpackAMD_FOUND)
+IF(DEAL_II_FORCE_CONTRIB_UMFPACK OR NOT UMFPACKAMD_FOUND)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/contrib/umfpack/UMFPACK/Include
ELSE()
- INCLUDE_DIRECTORIES(${Umfpack_INCLUDE_DIR} ${AMD_INCLUDE_DIR})
+ INCLUDE_DIRECTORIES(${UMFPACK_INCLUDE_DIR} ${AMD_INCLUDE_DIR})
LIST(APPEND deal_ii_required_linker_flags
${BLAS_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}
)
LIST(APPEND deal_ii_external_libraries
- ${Umfpack_LIBRARY} ${AMD_LIBRARY} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
+ ${UMFPACK_LIBRARY} ${AMD_LIBRARY} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
)
ENDIF()
--- /dev/null
+MACRO(macro_message_not_found library)
+ # TODO: Check for each Find<...> module how to hint for a library
+ # location...
+
+ STRING(TOUPPER "${library}" library_uppercase)
+
+ MESSAGE(SEND_ERROR "
+Could not find the ${library} library!
+
+Please ensure that the ${library} library is installed on your computer.
+If the library is not at a default location, either provide some hints
+via environment variables:
+${library_uppercase}_LIBRARY_DIR ${library_uppercase}_INCLUDE_DIR
+Or set the relevant variables by hand in ccmake.
+
+")
+
+ENDMACRO()
--- /dev/null
+# Try to find NETCDF
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_PATH(NETCDF_INCLUDE_DIR netcdf.hh
+ HINTS
+ $ENV{NETCDF_INCLUDE_DIR}
+ ${NETCDF_INCLUDE_DIR}
+)
+
+FIND_LIBRARY(NETCDF_LIBRARY
+ NAMES libnetcdf_c++.so libnetcdf_cpp.so
+ PATHS
+ $ENV{NETCDF_LIBRARY_DIR}
+ ${NETCDF_LIBRARY_DIR}
+ PATH_SUFFIXES lib64 lib
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETCDF DEFAULT_MSG NETCDF_LIBRARY NETCDF_INCLUDE_DIR)
+
+IF(NETCDF_FOUND)
+ MARK_AS_ADVANCED(
+ NETCDF_LIBRARY
+ NETCDF_INCLUDE_DIR
+ )
+ENDIF()
+++ /dev/null
-# Try to find Netcdf
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-FIND_PATH(Netcdf_INCLUDE_DIR netcdf.hh
- HINTS
- $ENV{NETCDF_INCLUDE_DIR}
- ${NETCDF_INCLUDE_DIR}
-)
-
-FIND_LIBRARY(Netcdf_LIBRARY
- NAMES libnetcdf_c++.so libnetcdf_cpp.so
- PATHS
- $ENV{NETCDF_LIBRARY_DIR}
- PATH_SUFFIXES lib64 lib
-)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Netcdf DEFAULT_MSG Netcdf_LIBRARY Netcdf_INCLUDE_DIR)
-
-IF(Netcdf_FOUND)
- MARK_AS_ADVANCED(
- Netcdf_LIBRARY
- Netcdf_INCLUDE_DIR
- )
-ENDIF()
--- /dev/null
+# Try to find UMFPACK
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_PATH(UMFPACK_INCLUDE_DIR umfpack.h
+ HINTS
+ $ENV{UMFPACK_INCLUDE_DIR}
+ ${UMFPACK_INCLUDE_DIR}
+)
+
+FIND_LIBRARY(UMFPACK_LIBRARY
+ NAMES libumfpack.so
+ PATHS
+ $ENV{UMFPACK_LIBRARY_DIR}
+ ${UMFPACK_LIBRARY_DIR}
+ PATH_SUFFIXES lib64 lib
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG UMFPACK_LIBRARY UMFPACK_INCLUDE_DIR)
+
+IF(UMFPACK_FOUND)
+ MARK_AS_ADVANCED(
+ UMFPACK_LIBRARY
+ UMFPACK_INCLUDE_DIR
+ )
+ENDIF()
+++ /dev/null
-# Try to find Umfpack
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-FIND_PATH(Umfpack_INCLUDE_DIR umfpack.h
- HINTS
- $ENV{Umfpack_INCLUDE_DIR}
- ${Umfpack_INCLUDE_DIR}
-)
-
-FIND_LIBRARY(Umfpack_LIBRARY
- NAMES libumfpack.so
- PATHS
- $ENV{Umfpack_LIBRARY_DIR}
- ${Umfpack_LIBRARY_DIR}
- PATH_SUFFIXES lib64 lib
-)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Umfpack DEFAULT_MSG Umfpack_LIBRARY Umfpack_INCLUDE_DIR)
-
-IF(Umfpack_FOUND)
- MARK_AS_ADVANCED(
- Umfpack_LIBRARY
- Umfpack_INCLUDE_DIR
- )
-ENDIF()