Files
impala/cmake_modules/FindBoostMultiPrecision.cmake
Nong Li d816e0fc51 Add the multi precision int library from boost.
This library provides the exact API and functionality we need for decimals.
I've included a simple example of how the API is used. Still looking into
the perf but I don't think we can build something much faster as easily.

I've taken the latest version from boost 1.55 but I don't think we can
upgrade that in all of our supported platforms easily. Instead I've taken
this part of the library and put it in thirdparty.

Change-Id: Icf9879d546aa6a8bde046940fb91eb5060fb2f47
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1691
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1723
2014-03-02 20:57:49 -08:00

32 lines
940 B
CMake

# - Find Boost Multi Precision library (cpp_int.h)
# This is a header only library so we just need to set the include dir
set(BOOST_MULTI_PRECISION_SEARCH_HEADER_PATH
${CMAKE_SOURCE_DIR}/thirdparty/boost_multiprecision
)
find_file(BOOST_MULTI_PRECISION_HEADER NAMES cpp_int.hpp
PATHS ${BOOST_MULTI_PRECISION_SEARCH_HEADER_PATH}
NO_DEFAULT_PATH
DOC "Boost Multi Precision Library"
)
if (BOOST_MULTI_PRECISION_HEADER)
set(BOOST_MULTI_PRECISION_FOUND TRUE)
set(BOOST_MULTI_PRECISION_INCLUDE_DIR ${BOOST_MULTI_PRECISION_SEARCH_HEADER_PATH})
else ()
set(BOOST_MULTI_PRECISION_FOUND FALSE)
endif ()
if (BOOST_MULTI_PRECISION_FOUND)
message(STATUS "Boost Multi Precision found in ${BOOST_MULTI_PRECISION_INCLUDE_DIR}")
else ()
message(STATUS "Boost Multip Precision NOT found. "
"Header should be in ${BOOST_MULTI_PRECISION_SEARCH_HEADER_PATH}")
endif ()
mark_as_advanced(
BOOST_MULTI_PRECISION_INCLUDE_DIR
)