search for: gsl_runif

Displaying 1 result from an estimated 1 matches for "gsl_runif".

2006 Dec 14
1
Detecting compilation under R
...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 and R CMD BUILD that I can test against? Of course I can stick PKG_CFLAGS=-DYES_THIS_IS_...