Hello!
I have a program in Fortran and would like to build a matrix with random
numbers, I have a function in C.
However, I have problems with the use of function in R.
Code to compile: R CMD SHLIB mat.f myrbeta.c -o func.so
Code in C.
#include <R.h>
#include <Rmath.h>
void F77_SUB(fseedi)(void){
GetRNGstate();
}
void F77_SUB(fseedo)(void){
PutRNGstate();
}
void F77_SUB(myrbeta)(double *px, double *pa, double *pb){
*px = rbeta(*pa,*pb);
}
Code in Fortran
subroutine mat(x,l,c)
integer l,c
double precision x(l,c)
integer i,j
do j = 1, c
do i = 1, l
call fseedi()
x(i,j) = call myrbeta(1,4,5) ! It's correct?
call fseedo()
enddo
enddo
end
The code of the error in R is:
dyn.load("func.so")
Error in dyn.load("func.so") :
unable to load shared library
'/home/julio/Orientados/Fabio/Fortran/mat-fortran/func.so':
/home/julio/Orientados/Fabio/Fortran/mat-fortran/func.so: undefined symbol:
callmyrbeta_
Thanks very much!
Fábio Mathias Corrêa UFLA
____________________________________________________________________________________
[[elided Yahoo spam]]
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel