[Rd] function not in load table

Martin Maechler maechler at stat.math.ethz.ch
Wed Jun 23 14:38:30 CEST 2004

>>>>> "Toralf" == Toralf Kirsten <tkirsten at izbi.uni-leipzig.de>
>>>>>     on Wed, 23 Jun 2004 11:36:23 +0200 writes:

    Toralf> Hi Martin, Vadim,
    Toralf> <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

    Toralf> 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.

    Toralf> I checked the exported function as you mentioned above and I can see the 
    Toralf> function named 'wy_grps_R' in the list (as you can see below)
    Toralf> ...
    Toralf> 00004d80 T uvarWYdist
    Toralf> 00004790 T wy_clust_R
    Toralf> 000045a0 T wy_grps_R   <---
    Toralf> 00004450 T wy_uvar_R
    Toralf> ...
    Toralf> 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?

    Toralf> What do you think what is not a good practice?

only the last line (before which I had added an empty line)
removing .Dyn.libs.

    Toralf> The COLS and ROWS are R objects which we use in R
    Toralf> programs to replace the 1 and 0 used as col and row
    Toralf> parameter.

(I don't understand but it's not relevant here anyway)

    Toralf> Do you think we should use the command
    Toralf> dyn.load("<compiled_code.so>")
    Toralf> for each C file instead of
    Toralf> library.dynam(...)?

No, no these were fine. Do not change them

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

    Toralf> Unfortunately it didn't solve the problem.

yes, as I said in my e-mail.

I'm almost at the end of my hints here.
One thing -- you probably have already tried is to use
as in the following example

  > is.loaded(symbol.C("pam"))
  [1] FALSE
  > library(cluster)
  > is.loaded(symbol.C("pam"))
  [1] TRUE

but I presume you will just find that
gives FALSE for you even after  

Is there nobody in Leipzig willing to delve into your package's


More information about the R-devel mailing list