[Rcpp-devel] Packaging - and even more packaging
bates at stat.wisc.edu
Sun Feb 3 21:51:37 CET 2013
On Sun, Feb 3, 2013 at 2:41 PM, Simon Zehnder <szehnder at uni-bonn.de> wrote:
> Dear Rcpp-Devels,
> maybe you have an answer for me as packaging is a little new for me:
> I took the NLopt library (http://ab-initio.mit.edu/wiki/index.php/NLopt)
> and installed it into a subfolder /nlopt-2.3 in my package-/src folder. The
> library depends on a header nlopt.hpp and a static library libnlopt.a.
> My Makervars in the /src-folder looks like this (using RcppArmadillo):
> PKG_CPPFLAGS = -Inlopt-2.3/include -g -O1
> PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(LAPACK_LIBS)
> $(BLAS_LIBS) $(FLIBS) -Lnlopt-2.3/lib/libnlopt.a
> When I call R CMD INSTALL /MCpkgArmadillo I get
> Error in dyn.load(file, DLLpath = DLLpath, ...) :
> unable to load shared object
> undefined symbol: nlopt_set_munge
> So, it seems, that the linking to the static library has to be
> extended/modified in some way. How should I change it? I looked at
> Subsection 18.104.22.168 Compiling in subdirectories on
> http://cran.r-project.org/doc/manuals/R-exts.html but this shows an
> example, where there is code in subdirectories, that has to be archived
> into a static library.
> Is it even possible to put already a static library into the package and
> then compile? Or do I have to put in all source files of the NLopt library
> and create during compiling the package the static library of the NLopt
It is possible and we do so in the Matrix package where we have the .a
files from the various SuiteSparse C libraries but we modify the makefiles
in those libraries so that the .a file ends up in the src directory, not a
subdirectory of src.
It seems to work.
> How is it intended to be done?
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel