[R] Checking and building package
Petar Milin
pmilin at ff.uns.ac.rs
Fri Jun 3 22:56:54 CEST 2011
Hello Uwe,
No, "foo" is the name of C-file -- "foo.c". Package has different name.
I tried R CMD INSTALL myPackage. And, yes there is a myPackage.so in
src/ folder, but not "foo.so". I got an error message that says:
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
Error in library.dynam(lib, package, package.lib) :
shared object 'foo' not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/myPackage’
* restoring previous ‘/usr/local/lib/R/site-library/myPackage’
Thanks!
Petar
On 03/06/11 22:32, Uwe Ligges wrote:
>
>
> On 03.06.2011 21:46, Petar Milin wrote:
>> Hello!
>> I am truing to compile an R-package having c-code. I put foo.c in src/
>> folder and useDynLib("foo")
>
>
> Where "foo" is the name of your package, I hope.
> Does R CMD INSTALL yourpackage generate a packagename.so (or .dll)? If
> so, it is just the useSynLib() entry that fails. Or does R CMD INSTALL
> give any error message?
>
> Uwe Ligges
>
>
> > in NAMESPACE file. When trying R CMD check,
>> I got an error message that shared object 'foo' is not found. Then I did
>> R CMD SHLIB foo.c first. However, after that, I got warnings from R CMD
>> check that there is an object file in /src folder. Even worse is if I
>> run R CMD SHLIB for Windows and for Linux and put in /src both foo.so
>> and foo.dll.
>> What I am doing wrong? I thought that only *.c is needed in src/, then,
>> I read in someones advice that both the source and shared library must
>> be in src/. What should be done if one wants to prepare for CRAN?
>>
>> Thanks!
>>
>> Best,
>> Petar
>>
>
--
#####################################################################################
Petar Milin
Department of Psychology, University of Novi Sad, Serbia
&
Laboratory for Experimental Psychology, University of Belgrade, Serbia
Address: Dr Zorana Dindica 2, Novi Sad 21000, Serbia
E-mail: pmilin<AT> ff.uns.ac.rs
Tel.&Fax: +381 21 458 948
Official homepage (in Serbian):
http://www.ff.uns.ac.rs/fakultet/ljudi/fakultet_odseci_psihologija_petar_milin.html
Personal homepage:
http://sites.google.com/site/pmilin/
#####################################################################################
More information about the R-help
mailing list