Displaying 2 results from an estimated 2 matches for "gsl_sf_hyperg".
2006 Dec 12
1
include libraries for C code called from R
...m writing some C code that I want to access from R through the .C
function. As part of the C function, I want to include an external C library,
such as the GNU gsl library. So, if I want to compute the value of a Gaussian
hypergeometric function, my C code would be:
#include </usr/include/gsl/gsl_sf_hyperg.h>
void gslTestHG (double *a, double *b, double *c, double *x, double *val ) {
*val = gsl_sf_hyperg_2F1(*a,*b,*c,*x);
}
I then compile this file (successfully, on a Linux machine with gcc installed)
using R CMD SHLIB gslTest.c. The message from the complier is:
gcc -I/usr/lib64/R/include -I...
2006 Dec 12
1
Undefined symbol when trying to dyn.load a shared object
...I have constructed a simple example of the problem, since my "real" program is much more complex and would bog down discussion. Suppose I want to compute the value of a Gaussian hypergeometric function using the function in the GSL library. My C code is:
#include </usr/include/gsl/gsl_sf_hyperg.h>
void gslTestHG (double *a, double *b, double *c, double *x, double *val ) {
*val = gsl_sf_hyperg_2F1(*a,*b,*c,*x);
}
I compile this code (successfully) using R CMD SHLIB gslTest.c and get the following result
-bash-3.00$ R CMD SHLIB RgslTest.c
gcc -I/usr/lib64/R/include -I/usr/lib64...