[Rcpp-devel] Linking Rcpp and libcmaes within a package

Dirk Eddelbuettel edd at debian.org
Fri May 1 17:33:11 CEST 2015


On 1 May 2015 at 16:12, Marie-Pierre ETIENNE wrote:
| CXX_STD = CXX11
| PKG_CPPFLAGS=-I/usr/local/include/libcmaes -I../inst/include -I/usr/local/include/eigen3/

If you add   LinkingTo: RcppEigen   then you don't need the explicit include
for Eigen3, and are more portable.  Of course, you would need our RcppEigen package.

| PKG_LIBS = -L/usr/local/lib -l cmaes`$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`

A few issues here:

  1) The Rscript call has not been necessary for about 15 months now since
     Rcpp 0.11.0 came out.
 
  2) The space between -l and cmaes is an error 

  3) -L/usr/local/lib is not needed, that is a default directory

so try just

PKG_LIBS = -lcmaes

instead.  

And just to be clear: The cmaes library is now a SystemRequirements: -- only
people who have it will be able to use your package.  For that reason some
people "internalise" such librarie in their package.  You need to check if
you a) are allowed to do that and b) if you want to -- yet more work.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list