Displaying 1 result from an estimated 1 matches for "gsl_random".
Did you mean:
gcc_random
2006 Dec 14
1
Detecting compilation under R
...for other purposes, how can you detect this?
As an example, suppose I have some C that uses GSL to get a random
number if its a standalone program, or uses R's internals if its being
compiled to run in R. I want to do something like:
#ifdef USING_R
#include <R.h>
#else
#include <gsl_random.h>
#endif
and then:
#ifdef USING_R
x = rand_unif(0.0,1.0);
#else
x = gsl_runif(0.0,1.0);
#endif
(cant remember the exact names but hopefully you get the idea). This
fails because USING_R is only set when R.h is included.
Are there any preprocessor definitions set by R CMD SHLIB an...