[Rcpp-devel] RcppOctave on Windows: testing needed

Renaud Gaujoux renaud at mancala.cbio.uct.ac.za
Mon Oct 7 10:32:28 CEST 2013


Hi,

thanks for all these explanations!

I believe some clarifications from my side as well may be useful. I also
have possibly silly questions :)
Building RcppOctave involves 2 separate compilation/linking:

  * Octave modules that call R RNG functions, but -- currently -- do not
use Rcpp at all: these are built using mkoctfile, adding R flags  to the
compilation command (-L"path/to/R" and -lR). Modules are compiled using
Octave as a shared library. I think that, as long as the Octave dll issue
is solved, Octave knows how to load these modules, without having to change
the PATH. They load correctly on my Windows installation, but it is the
machine on which the package was built, so this might also hide path issues.
  * the RcppOctave's package library, which defines Rcpp wrap and as
templates to convert and pass data between R an Octave: it is built by R
compiler, adding Rcpp flags (as recommended and defined by
Rcpp.package.skeleton) and Octave flags (-L"patth/to/octave/libraries" and
-loctinterp -loctave -lcruft)

The path to all Octave stuff are determined at configure time just before
compiling.
So, I believe this is all fine when installing on Linux, since compilation
occurs at that time.
On Windows, however, both the modules and the package's library are
compiled when building the binary package.

If I understand static linking correctly, packages that link against Rcpp
using Rcpp:::LdFlags() will include in their library the definition of the
Rcpp functions they use, making them standalone, right? or will the
complete Rcpp dll be included?
In this case I don't see why Rcpp.dll is needed in the PATH at all.


I don't think I linking RcppOctave against Octave statically is ideal:
1. I only call a few Octave functions, meaning that all other functions
that a user may need will not be included in the library, and we get back
to the starting point of dll loading issue.
2. there is no point in including all Octave in RcppOctave
3. Most Windows users will only have Octave dll, and no static libraries
unless they compile them themselves. Am I right on this one: dll and static
libraries are different objects that can't be used on of another?

Possible solution:
I could manually load the RcppOctave library in .onLoad (instead of the
useDyn directive in NAEMASPACE), after adding the required directories to
the PATH. These can be discovered using octave-config, which ships with all
Octave installation.
I will try this, re-build and update the package in both github and myCRAN
repo, so that they can be tested.


Renaud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20131007/0a94da7f/attachment.html>


More information about the Rcpp-devel mailing list