[Rcpp-devel] Rcpp, Windows and CMake
tbfowler4 at gmail.com
Wed Jan 29 20:07:36 CET 2014
On Wed, Jan 29, 2014 at 9:39 AM, Jamie Olson <jamie.f.olson at gmail.com>wrote:
> Hi all,
> I'm a relative beginner in c/c++ and I'm trying to use c/c++ libraries
> in an R package. I need it to work in Windows, though, and I'm
> struggling to get things working.
> --- >8---
It might help to state what c/c++ libraries you're trying to get up and
running. There is some documentation in RTools (IIRC) on setting up an
RTOOLS_LOCAL encironment that was pretty straight forward. I had success
building the libraries for GMP, MPFR, and such using mingw-64 then placing
the resulting files in an RToolsLocal directory. If you go that route you
should be able to use cmake to build and then install into your LOCAL path.
Or, are you trying to have this cmake be part of a package that you are
The native CMake refuses to use the Rtools gcc with MinGW Makefiles
This doesn't surprise me at all, as the RTools toolchain requires that the
environment is setup, which it is when calling _from_ R. You'd have to
figure out how to do that manually if you want to use that g++ from else
where (say msys). It can be done, but as you mention...
> The documentation[
> Users developing packages with Rcpp need to ensure that they use a
> version built with exactly the same toolchain as their package: the
> recommendation is to build Rcpp from its sources yourself.
> Do I simply need to install Rcpp from source using my target compiler?
> Will that effect my ability to use the binary package on other
> systems(with CRAN Rcpp)?
You _can_ install Rcpp from source on windows using a recent msys
environment with a recent g++ ( I did last December ). But there be
dragons down that road! You have to make sure that you get all of the
settings correct and all of that jazz, which is a major pain; and then you
are still going to have problems unless you can figure out the proper
procedure for getting the unwinding info correct, and the cross boundary
communication between libraries correct or you will end up freezing R with
every error your code produces. I would've kept with a g++ 4.8.2 or clang
3.4 if it wasn't for the fact that I couldn't get any graceful exception
I know I make it sound bad. That is on purpose! You said you are a
relative beginner... I'm someone who likes to 'just dive in'; and I can
tell you that I dove in right where you are standing and you're gonna your
head if you do it that way.
> Thanks for any help you can offer,
> Jamie Olson
> 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