[Rcpp-devel] Setting armadillo preprocessor macros in R package

Scott Ritchie sritchie73 at gmail.com
Thu Jun 2 12:40:45 CEST 2016


Thanks JJ,

That worked perfectly.

On 2 June 2016 at 20:25, JJ Allaire <jj.allaire at gmail.com> wrote:

> If you create a file called pkgname_types.hpp and put it in your src
> directory it will be added to RcppExports.cpp ahead of RcppArmadillo.h.
> e.g. if your package is named foo then create:
>
> src/foo_types.hpp
>
> And put your #define macros there.
>
>
>
> On Thu, Jun 2, 2016 at 3:32 AM, Scott Ritchie <sritchie73 at gmail.com>
> wrote:
>
>> Hi all,
>>
>> I would like to set my own Armadillo #define macros (i.e. some of those
>> listed http://arma.sourceforge.net/docs.html#config_hpp) in an R package
>> I have developed.
>>
>> The instructions there are to put their definitions before the include
>> statement to armadillo.h (or in this case RcppArmadillo.h).
>>
>> However, the first file to compile is RcppExports.cpp, which has
>> `#include <RcppArmadillo.h>` at the top of the file, so my preprocessor
>> macros in my source files are ignored when compiling.
>>
>> Kind regards,
>>
>> Scott Ritchie
>>
>> _______________________________________________
>> Rcpp-devel mailing list
>> Rcpp-devel at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20160602/9a40e79c/attachment.html>


More information about the Rcpp-devel mailing list