[R] Using win-builder with static libraries

Uwe Ligges ligges at statistik.tu-dortmund.de
Sat Jan 30 17:38:03 CET 2010


I may be able to help if you upload to winbuilder again and let me know 
when you did (don't have your source package any more).

I guess there are roughly 1-5 errors:

error 1: Where is the static library from? If copied from numerical 
recipes: Please do look if you have the right licenses.

error 2: Better ship sources rather than compiled code: it allows to 
build on more platforms. The static library will only work on the 
particular system (such as 32-bit Windows) it was compiled for.

error 3: Do you have the statistic library in pkg/lib or pkg/inst/lib ? 
You need the latter.

... more if you send the source package to allow us to look what you did 
(given you are allowed to distribite it).

Uwe Ligges




On 29.01.2010 17:41, Maxime Debon wrote:
> Dear All,
>
> I am intending to build a package (pksmooth) on Linux to work on
> Windows. Some c++ functions need c++ libraries (numerical recipes)
> from a static library "libNR.a".
> Building the package on Linux for Linux is allright. However, when
> sending the 'pksmooth_1.0.tar.gz' to the online Windows builder
> (win-builder.r-project.org),the compilation doesn't take into account
> the library "libNR.a". Yet, it is included in the tar.gz file in a
> 'libs' folder and called in a makefile located in the 'src' folder.
>
> Any comment will be appreciated,
>
> Maxime
>
>
> NB: Here is the compilation error:
> _____________________________________________________________________________(__
>
> * installing *source* package 'pksmooth' ...
> ** libs
>    making DLL ...
> g++ -I"d:/Rcompile/recent/R-2.10.1/include"        -O2 -Wall  -c
> ksmoothC.C -o ksmoothC.o
> ksmoothC.C: In function 'double fxRoot(double (*)(double), double, double)':
> ksmoothC.C:16: warning: 'root' may be used uninitialized in this function
> g++ -shared -s -o pksmooth.dll tmp.def ksmoothC.o
> -Ld:/Rcompile/recent/R-2.10.1/bin -lR
> ksmoothC.o:ksmoothC.C:(.text+0x1ab): undefined reference to
> `NR::zbrak(double (*)(double), double, double, int, NRVec<double>&,
> NRVec<double>&, int&)'
> ksmoothC.o:ksmoothC.C:(.text+0x1fc): undefined reference to
> `NR::rtbis(double (*)(double), double, double, double)'
> collect2: ld returned 1 exit status
>    ... done
> ** R
> ** preparing package for lazy loading
> ** help
> *** installing help indices
> ** building package indices ...
> ** MD5 sums
> packaged installation of 'pksmooth' as pksmooth_1.0.zip
> * DONE (pksmooth)
>
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list