Skip to content
Snippets Groups Projects
Commit ee2b94cc authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

Merge branch 'feature/valgrind-with-cmake' into 'master'

Feature/valgrind with cmake



See merge request !43
parents dca4896c fa770cb3
No related branches found
No related tags found
No related merge requests found
...@@ -5,3 +5,5 @@ include(DumuxTestMacros) ...@@ -5,3 +5,5 @@ include(DumuxTestMacros)
find_package(Gnuplot) find_package(Gnuplot)
set(HAVE_GNUPLOT ${GNUPLOT_FOUND}) set(HAVE_GNUPLOT ${GNUPLOT_FOUND})
find_package(Valgrind)
#
# Module that checks whether Valgrind's header memcheck.h is present
#
# Variables used by this module which you may want to set:
# VALGRIND_ROOT Path list to search for memcheck.h
#
# Sets the follwing variable:
#
# Valgrind_FOUND True if Valgrind was found
# VALGRIND_INCLUDE_DIR Path to Valgrind's include dirs.
# look for header files, only at positions given by the user
find_path(VALGRIND_INCLUDE_DIR
NAMES "valgrind/memcheck.h"
PATHS ${VALGRIND_ROOT}
PATH_SUFFIXES "include"
NO_DEFAULT_PATH
)
# look for header files, including default paths
find_path(VALGRIND_INCLUDE_DIR
NAMES "valgrind/memcheck.h"
PATH_SUFFIXES "include"
)
# handle package arguments
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
"Valgrind"
DEFAULT_MSG
VALGRIND_INCLUDE_DIR
)
# set HAVE_VALGRIND for config.h
set(HAVE_VALGRIND ${Valgrind_FOUND})
# register all Valgrind related flags
if(Valgrind_FOUND)
dune_register_package_flags(INCLUDE_DIRS "${VALGRIND_INCLUDE_DIR}")
endif()
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
/* end private */ /* end private */
/* Define to 1 if Valgrind was found */
#cmakedefine HAVE_VALGRIND 1
/* Define to 1 if gnuplot was found */ /* Define to 1 if gnuplot was found */
#cmakedefine HAVE_GNUPLOT 1 #cmakedefine HAVE_GNUPLOT 1
......
# This file contains local changes to the doxygen configuration # This file contains local changes to the doxygen configuration
# please us '+=' to add file/directories to the lists # please us '+=' to add file/directories to the lists
EXCLUDE_PATTERNS = */.svn/*
PREDEFINED += "NEW_PROP_TAG(name)=Property tag name" \ PREDEFINED += "NEW_PROP_TAG(name)=Property tag name" \
"NEW_TYPE_TAG(name)=Type tag name" "NEW_TYPE_TAG(name)=Type tag name" \
HAVE_VALGRIND:=1
INPUT += @srcdir@/mainpage.txt \ INPUT += @srcdir@/mainpage.txt \
@srcdir@/modules.txt \ @srcdir@/modules.txt \
...@@ -30,5 +29,5 @@ CITE_BIB_FILES = @top_srcdir@/doc/handbook/dumux-handbook.bib ...@@ -30,5 +29,5 @@ CITE_BIB_FILES = @top_srcdir@/doc/handbook/dumux-handbook.bib
# enable macro expansion only for specified macros # enable macro expansion only for specified macros
MACRO_EXPANSION = YES MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES EXPAND_ONLY_PREDEF = YES
PREDEFINED = "DUNE_DEPRECATED:=/** \deprecated */" \ PREDEFINED += "DUNE_DEPRECATED:=/** \deprecated */" \
"DUNE_DEPRECATED_MSG(A):=/** \deprecated A */" "DUNE_DEPRECATED_MSG(A):=/** \deprecated A */"
...@@ -23,26 +23,6 @@ ...@@ -23,26 +23,6 @@
#ifndef DUMUX_VALGRIND_HH #ifndef DUMUX_VALGRIND_HH
#define DUMUX_VALGRIND_HH #define DUMUX_VALGRIND_HH
#ifndef __clang__
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
// do not do static_asserts for gcc < 4.5 (semantics changed, so old
// GCCs will complain when using static_assert)
# define static_assert(a, b)
// do not do valgrind client requests for gcc < 4.5 (old GCCs do not
// support anonymous template arguments which results in errors for
// BoundaryTypes)
# ifdef HAVE_VALGRIND
# undef HAVE_VALGRIND
# endif
#endif // GCC < 4.5
#endif // __clang__
#ifndef HAVE_VALGRIND
// make sure that the HAVE_VALGRIND macro is always defined
# define HAVE_VALGRIND 0
#endif
#if ! HAVE_VALGRIND #if ! HAVE_VALGRIND
namespace Valgrind namespace Valgrind
{ {
...@@ -80,7 +60,7 @@ inline bool Running() ...@@ -80,7 +60,7 @@ inline bool Running()
* \brief Make valgrind complain if the object occupied by an object * \brief Make valgrind complain if the object occupied by an object
* is undefined. * is undefined.
* *
* Please note that this does not check whether the destinations of * \note This does not check whether the destinations of
* the object's pointers or references are defined. * the object's pointers or references are defined.
* *
* \tparam T The type of the object which ought to be checked * \tparam T The type of the object which ought to be checked
...@@ -181,8 +161,8 @@ inline void SetNoAccess(const T *value, int n) ...@@ -181,8 +161,8 @@ inline void SetNoAccess(const T *value, int n)
#endif #endif
} }
} } // end namespace Valgrind
#endif #endif // HAVE_VALGRIND
#endif #endif // DUMUX_VALGRIND_HH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment