Displaying 1 result from an estimated 1 matches for "a1648".
Did you mean:
1648
2006 May 09
1
Calling R from C
...p(SEXP nt) {
int x=INTEGER(nt)[0];
Rprintf("x: %d \n", x);
SEXP ans;
PROTECT(ans=allocVector(REALSXP,1));
REAL(ans)[0]=0;
Rprintf("init ans: %f \n",REAL(ans)[0]);
UNPROTECT(1);
return(ans);
}
Which compiles without problems into a shared library
a1648:~ ivisser$ R CMD SHLIB -l
/Users/ivisser/Documents/projectsCurrent/dmm4Project/rfromc/
/Users/ivisser/Documents/projectsCurrent/dmm4Project/rfromc.c
gcc-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/ppc
-I/usr/local/include...