Hi Martin, Vadim,

<snip>

really C, not C++ ? [or did you compile by a C++ compiler instead of C ?] I ask because for C++ that's really a FAQ

It's really a C function.

Toralf> wy.result <- wy.grps(data1=X1, grpdata=groups, nres=10000, Toralf> alpha1=0.05, alpha2=0.05)
Toralf> Error in .C("wy_grps_R", as.double(X), as.integer(n1), as.integer(n2), :
Toralf> C function name not in load table
Toralf> Execution halted


this really means that there's no exported C function named 'wy_grps_R'
from the dyn.loaded C code.
Do
        nm -g  izbi.so
inside izbi/src/ in the shell to check.


I checked the exported function as you mentioned above and I can see the function named 'wy_grps_R' in the list (as you can see below)
...
00004d80 T uvarWYdist
00004790 T wy_clust_R
000045a0 T wy_grps_R <---
00004450 T wy_uvar_R
...
The T in the second column means it is available in the code segment, right.



Toralf> My .First.lib.R is as follows: Toralf> .First.lib <- function(libname, pkgname) { Toralf> library.dynam("izbi", package = pkgname, lib.loc = libname) Toralf> data(COLS, package=pkgname) Toralf> data(ROWS, package=pkgname)

    Toralf> if (exists(".Dyn.libs")) remove(".Dyn.libs")

not sure if the above is a good idea.
What do you want it for?

What do you think what is not a good practice?
The COLS and ROWS are R objects which we use in R programs to replace the 1 and 0 used as col and row parameter.
Do you think we should use the command
dyn.load("<compiled_code.so>")
for each C file instead of
library.dynam(...)?


I also tried to specify the package name in this manner
result <- .C("wy_grps_R",
             as.double(X),
             as.integer(n1),
             as.integer(n2),
             as.integer(p),
             as.integer(unlist(grpidx)),
             as.integer(grplen),
             as.integer(grpnum),
             as.character(WYFUN),
             as.double(alpha2),
             as.character(MINMAXFUN),
             WYdist=double(nres),
             as.integer(nres),
             test.value=double(grpnum),
             p.value=double(grpnum),
             PACKAGE="izbi")
Unfortunately it didn't solve the problem.

Many Thanks for your help,
Toralf

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-devel

Reply via email to