[mlpack-git] master: Update for mlpack::backtrace (e9ee6bd)
gitdub at mlpack.org
gitdub at mlpack.org
Thu Feb 25 10:31:05 EST 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/fd84f3a2e53592d723a8e8a76dadb8aa76820913...1a9c41a86be1fa1dcc5c3b90dd959c2255c3bb8e
>---------------------------------------------------------------
commit e9ee6bd04f9d7c8216d37964d20221fff7143da5
Author: Grzegorz Krajewski <krajekg at gmail.com>
Date: Thu Feb 25 16:31:05 2016 +0100
Update for mlpack::backtrace
Add find_package LibBfd.cmake / LibDL.cmake and inc. dirs.
>---------------------------------------------------------------
e9ee6bd04f9d7c8216d37964d20221fff7143da5
CMakeLists.txt | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3912c7..c1e43fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,6 +66,17 @@ if(DEBUG)
add_definitions(-DDEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -ftemplate-backtrace-limit=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -g -O0")
+ # mlpack uses it's own mlpack::backtrace class based on Binary File Descriptor
+ # <bfd.h> and linux Dynamic Loader <libdl.h> and more portable version in future
+ find_package(Bfd)
+ find_package(LibDL)
+ if(LIBBFD_FOUND AND LIBDL_FOUND)
+ include_directories(${LIBBFD_INCLUDE_DIRS})
+ include_directories(${LIBDL_INCLUDE_DIRS})
+ add_definitions(-DHAS_BFD_DL)
+ else(LIBBFD_FOUND AND LIBDL_FOUND)
+ message(WARNING "No libBFD and/or libDL has been found!")
+ endif(LIBBFD_FOUND AND LIBDL_FOUND)
else()
add_definitions(-DARMA_NO_DEBUG)
add_definitions(-DNDEBUG)
@@ -80,16 +91,6 @@ if(CMAKE_COMPILER_IS_GNUCC AND PROFILE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
endif(CMAKE_COMPILER_IS_GNUCC AND PROFILE)
-# mlpack uses backtrace() facilities. On some systems (e.g., GNU/Linux), it
-# resides in libc itself and requires <execinfo.h>; on other (e.g., OpenBSD)
-# it's provided by a separate library.
-find_package(Backtrace)
-if(Backtrace_FOUND)
- include_directories(${Backtrace_INCLUDE_DIRS})
- add_definitions(-DBACKTRACE_FOUND)
- add_definitions(-DBACKTRACE_HEADER="${Backtrace_HEADER}")
-endif(Backtrace_FOUND)
-
# If the user asked for running test cases with verbose output, turn that on.
if(TEST_VERBOSE)
add_definitions(-DTEST_VERBOSE)
More information about the mlpack-git
mailing list