mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-02 04:26:55 -06:00
add and use CMake modules for valgrind client requests and quadruple precision math
This commit is contained in:
parent
6ff3b56b49
commit
694fc0c98a
19
cmake/Modules/FindQuadmath.cmake
Normal file
19
cmake/Modules/FindQuadmath.cmake
Normal file
@ -0,0 +1,19 @@
|
||||
# Module that checks whether the compiler supports the
|
||||
# quadruple precision floating point math
|
||||
#
|
||||
# Sets the following variable:
|
||||
# HAVE_QUAD
|
||||
#
|
||||
# perform tests
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(CMakePushCheckState)
|
||||
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "quadmath")
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <quadmath.h>
|
||||
|
||||
int main(void){
|
||||
__float128 foo = sqrtq(123.456);
|
||||
}" HAVE_QUAD)
|
||||
cmake_pop_check_state()
|
25
cmake/Modules/FindValgrind.cmake
Normal file
25
cmake/Modules/FindValgrind.cmake
Normal file
@ -0,0 +1,25 @@
|
||||
# Find Valgrind.
|
||||
#
|
||||
# This module defines:
|
||||
# VALGRIND_INCLUDE_DIR, where to find valgrind/memcheck.h, etc.
|
||||
# VALGRIND_PROGRAM, the valgrind executable.
|
||||
# VALGRIND_FOUND, If false, do not try to use valgrind.
|
||||
#
|
||||
# If you have valgrind installed in a non-standard place, you can define
|
||||
# VALGRIND_ROOT to tell cmake where it is.
|
||||
if (VALGRIND_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h
|
||||
/usr/include /usr/local/include ${VALGRIND_ROOT}/include)
|
||||
|
||||
# if VALGRIND_ROOT is empty, we explicitly add /bin to the search
|
||||
# path, but this does not hurt...
|
||||
find_program(VALGRIND_PROGRAM NAMES valgrind PATH ${VALGRIND_ROOT}/bin)
|
||||
|
||||
find_package_handle_standard_args(VALGRIND DEFAULT_MSG
|
||||
VALGRIND_INCLUDE_DIR
|
||||
VALGRIND_PROGRAM)
|
||||
|
||||
mark_as_advanced(VALGRIND_ROOT VALGRIND_INCLUDE_DIR VALGRIND_PROGRAM)
|
Loading…
Reference in New Issue
Block a user