Skip to content
Back to formatted view

Raw Message

Message-ID: <43679EA9.1060003@statistik.uni-dortmund.de>
Date: 2005-11-01T16:58:17Z
From: Uwe Ligges
Subject: Build R package with shared library
In-Reply-To: <a55593730510311332k53e881e7n93861f3ed228bd34@mail.gmail.com>

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