OPTION(DEAL_II_WITH_THREADS
"Build deal.II with support for threads. This pulls in libtbb as a dependency."
- ON)
+ OFF)
OPTION(DEAL_II_WITH_UMFPACK
"Build deal.II with support for UMFPACK, BLAS and LAPACK."
IF(DEAL_II_COMPILER_HAS_AS_NEEDED)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-as-needed")
ENDIF()
+
+
+
+#
+# Check for minimal vector capacity
+#
+GET_CXX_SOURCE_RETURN_VALUE(
+ "
+ #include <vector>
+ int main () {
+ std::vector<int> v(1);
+ v.reserve (1);
+ v.resize (1);
+ return v.capacity();
+ }
+ "
+ DEAL_II_MIN_VECTOR_CAPACITY
+ DEAL_II_MIN_VECTOR_CAPACITY_RETURN_VALUE)
+
+IF(NOT DEAL_II_MIN_VECTOR_CAPACITY)
+ # We have a problem...
+ MESSAGE(WARNING
+ "Could not determine DEAL_II_MIN_VECTOR_CAPACITY, source might not compile..."
+ )
+ELSE()
+ SET(DEAL_II_MIN_VECTOR_CAPACITY ${DEAL_II_MIN_VECTOR_CAPACITY_RETURN_VALUE})
+ENDIF()
+
+
+
+#
+# Do same thing with std::vector<bool>
+#
+GET_CXX_SOURCE_RETURN_VALUE(
+ "
+ #include <vector>
+ int main () {
+ std::vector<bool> v(1);
+ v.reserve (1);
+ v.resize (1);
+ return v.capacity();
+ }
+ "
+ DEAL_II_MIN_BOOL_VECTOR_CAPACITY
+ DEAL_II_MIN_BOOL_VECTOR_CAPACITY_RETURN_VALUE)
+
+IF(NOT DEAL_II_MIN_BOOL_VECTOR_CAPACITY)
+ # We have a problem...
+ MESSAGE(WARNING
+ "Could not determine DEAL_II_MIN_VECTOR_CAPACITY, source might not compile..."
+ )
+ELSE()
+ SET(DEAL_II_MIN_BOOL_VECTOR_CAPACITY ${DEAL_II_MIN_BOOL_VECTOR_CAPACITY_RETURN_VALUE})
+ENDIF()
--- /dev/null
+MACRO(GET_CXX_SOURCE_RETURN_VALUE SOURCE VAR EXIT_CODE)
+
+ #
+ # TODO: This file is still very basic :-]
+ #
+
+ FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
+ "${SOURCE}\n")
+
+ MESSAGE(STATUS "Performing Test ${VAR}")
+
+ TRY_RUN(
+ ${VAR}_EXIT_CODE
+ ${VAR}_COMPILE_OK
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx)
+
+ IF(${VAR}_COMPILE_OK)
+ SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ SET(${EXIT_CODE} ${VAR_EXIT_CODE} CACHE INTERNAL "Test ${EXIT_CODE}")
+ MESSAGE(STATUS "Performing Test ${VAR} - Success")
+
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "${OUTPUT}\n"
+ "Return value: ${${VAR}}\n"
+ "Source file was:\n${SOURCE}\n")
+
+ ELSE()
+
+ SET(${VAR} 0 CACHE INTERNAL "Test ${VAR}")
+ MESSAGE(STATUS "Performing Test ${VAR} - Failed")
+
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
+ "${OUTPUT}\n"
+ "Return value: ${${VAR}_EXITCODE}\n"
+ "Source file was:\n${SOURCE}\n")
+ ENDIF()
+
+ENDMACRO()
/* Defined if you have the `functionparser' library */
#cmakedefine HAVE_FUNCTIONPARSER
-
-
-
/*
* Configured in configure_mpi.cmake:
*/
#cmakedefine DEAL_II_COMPILER_SUPPORTS_MPI
-
-
/*
* Configured in configure_netcdf.cmake:
*/
#cmakedefine HAVE_LIBNETCDF
-
-
/*
* Configured in configure_threads.cmake:
*/
#endif
-
-
/*
* Configured in configure_umfpack.cmake:
*/
#cmakedefine HAVE_LIBLAPACK
-
-
/*
* Configured in configure_umfpack.cmake:
*/
about the present function is available for this compiler. */
#cmakedefine __PRETTY_FUNCTION__ @__PRETTY_FUNCTION__@
+/* Set to the minimal number of elements a std::vector<T> can always hold,
+ i.e. its minimal capacity. */
+#define DEAL_II_MIN_VECTOR_CAPACITY @DEAL_II_MIN_VECTOR_CAPACITY@
+
+/* Set to the minimal number of elements a std::vector<bool> can always hold,
+ i.e. its minimal capacity. */
+#define DEAL_II_MIN_BOOL_VECTOR_CAPACITY @DEAL_II_MIN_BOOL_VECTOR_CAPACITY@
+
the top-level directory. */
#cmakedefine DEAL_II_MEMBER_VAR_SPECIALIZATION_BUG
-/* Set to the minimal number of elements a std::vector<bool> can always hold,
- i.e. its minimal capacity. */
-#cmakedefine DEAL_II_MIN_BOOL_VECTOR_CAPACITY
-
-/* Set to the minimal number of elements a std::vector<T> can always hold,
- i.e. its minimal capacity. */
-#cmakedefine DEAL_II_MIN_VECTOR_CAPACITY
-
/* enable multigrid compatibility mode */
#cmakedefine DEAL_II_MULTIGRID_COMPATIBILITY