In my latest version of R (2.11.1) on OSX, loading a dynamic library
twice, or unloading a loaded library causes R to get stuck.

Thus, if testR.c is:
---
#include <stdio.h>
#include <math.h>

#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>


void
R_init_testR(DllInfo *info)
{
  fprintf( stderr, "got to load\n") ;
}

void
R_unload_testR(DllInfo *info)
{
  fprintf( stderr, "got to unload\n") ;
}

void test() {
}
----
and I compile it with
R CMD SHLIB testR.c

and then inside R call:
> dyn.load("testR.so")
got to load
> dyn.load("testR.so")
got to unload
[this never terminates]

(The R_init_testR and R_unload_testR are not the culprit - I get the
same problem without them)
Did I do something wrong?

Thanks,
Michael

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to