[R] Build R package with shared library

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Nov 1 17:58:17 CET 2005


Marcelo Damasceno wrote:

> Hello to all,
> 
> I am try to build a package, I do the follow commands: "R CMD check pack",
> "R CMD pack build" and run OK, no errors. I put my shared library in package
> subdirectory R, src, but it is not put a shared library ".so" in directory
> "/usr/lib/R/library/pack/lib". Below is my code :


Hmmm. You have to INSTALL a package. Shared libraries will be build on 
the fly while installing. Hence I think you have not read the mnauals 
carefully enough.

You can put C and Fortran files in ./src, the shared library will be 
installed during
   R CMD INSTALL pack
into the ./lib directory.


> dyn.load("pack.so",PACKAGE="pack")
> argc<-2
> argv<-c("./test",file1)
> .C("main",as.integer(argc),as.vector(argv),PACKAGE="pack")

You really want to pass a directory and a filename to your shared 
library? So, why are you using R in between?

Uwe Ligges



> What am I doing wrong?
> 
> --
> Marcelo Damasceno de Melo
> Graduando em Ciência da Computação
> Departamento de Tecnologia da Informação - TCI
> Universidade Federal de Alagoas - UFAL
> Maceió - Alagoas - Brasil
> Projeto CoCADa - Construção do Conhecimento por Agrupamento de dados
> +55 82 8801-2119
> 
> 	[[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list