[Rcpp-devel] Rcpp_0.9.0.tar.gz does not build on FreeBSD

Dirk Eddelbuettel edd at debian.org
Tue Jan 4 19:26:33 CET 2011


On 4 January 2011 at 18:58, Romain Francois wrote:
| Le 04/01/11 18:51, Rainer Hurling a écrit :
| > libexecinfo is not an internal libc function within FreeBSD. It has to
| > build as external so called port. On my system it is installed in
| > version 1.1.
| >
| > The ports info says:
| >
| > -------------------------------------------
| > I. About
| > This is a quick-n-dirty BSD licensed clone of backtrace facility found
| > in the GNU libc, mainly intended for porting linuxish code to BSD
| > platforms, however it can be used at any platform which has a gcc
| > compiler.
| >
| > More information about API can be found here:
| > http://www.gnu.org/software/libc/manual/html_node/Backtraces.html
| >
| > II. Known limitations
| > - Depth of stack trace is limited to 128 levels, which should be enough
| > in most cases, the limit can be increased by editing gen.py and
| > regenerating stacktraverse.c. The reason for that limitation steams
| > from the fact that __builtin_return_address() function takes only
| > constant as an argument, while gcc(1) has problems compiling giant
| > switch() tables. For example to compile one with 1024 entries gcc(1)
| > needs more than 1GB of memory (sic!);
| > - executable have to be linked using `-Wl,--export-dynamic' option,
| > in order for function names to be displayed properly.
| >
| > III. Author
| > Author of this junk is Maxim Sobolev <sobomax at FreeBSD.org>. Any
| > feedback, patches or suggestions are greatly appreciated.
| > -------------------------------------------
| >
| >
| > The library is located under /usr/local/lib/libexecinfo.[so|a]
| >
| >
| > The header file is located under /usr/local/include/execinfo.h
| >
| > It defines 'backtrace_symbols' like this:
| >
| > #ifndef _EXECINFO_H_
| > #define _EXECINFO_H_
| >
| > #ifdef __cplusplus
| > extern "C" {
| > #endif
| >
| > int backtrace(void **, int);
| > char ** backtrace_symbols(void *const *, int);
| > void backtrace_symbols_fd(void *const *, int, int);
| >
| > #ifdef __cplusplus
| > }
| > #endif
| >
| > #endif /* _EXECINFO_H_ */
| >
| >
| >> Can you please modify src/Makevars at your end by adding this line right
| >> after the line containing PKG_CPPFLAGS:
| >>
| >> PKG_LIB += -lexecinfo
| >
| > Unfortunately this seems to be not enough. The same error occurs.
| >
| > I think as a workaround we should disable the debugging function under
| > FreeBSD. A suitable preprocessor define should be '__FreeBSD__'.

Yes.  Do you know what OpenBSD and NetBSD do here?  Will they behave like
Linux, or should we exclude it for them too?

| > What do you think?
| 
| That's fair enough. The use of backtrace_symbols is somewhat of an 
| underused black magic I once put in.
| 
| We might drop this altogether as it is not used all that much.

I will leave that to you, but will fix the build so that Rainer and other
will get Rcpp to compile out of the tarball, albeit without the backtraces
(but that is barely used).

Dirk


-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list