[mlpack-git] [mlpack] Add mlpack::backtrace utility. (#535)

Ryan Curtin notifications at github.com
Thu Mar 3 14:48:23 EST 2016


> @@ -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)

I think you need to add `set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")` here; if I didn't do this, then if an assert or fatal error was thrown in any of the mlpack programs (like `mlpack_allknn`), it wouldn't give a backtrace but would tell me that I needed to compile with -rdynamic.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/535/files#r54936738
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160303/727ff2c8/attachment.html>


More information about the mlpack-git mailing list