Login  Register

Re: SWIG R with c++11

Posted by Dirk Eddelbuettel on Oct 26, 2013; 8:42pm
URL: http://quantlib.414.s1.nabble.com/SWIG-R-with-c-11-tp14618p14619.html


Hi Peter,

On 26 October 2013 at 21:34, Peter Caspers wrote:
|    is it possible to build the SWIG R package with -std=c++11 ? As far
| as I can see during the execution of R CMD check R one step
|
| * checking whether package ‘QuantLib’ can be installed ... ERROR
|
| fails because some hard coded (?) configuration (not related to the one
| produced with the usual ./configure ... call) is used here, in the log
| R.Rcheck/00install.out I get
|
| make[3]: Entering directory `/home/peter/quantlibpc/QuantLib-SWIG/R/src'
| g++ -I/usr/share/R/include -DNDEBUG `quantlib-config --cflags`      -fpic  -O3 -pipe  -g  -c QuantLib.cpp -o QuantLib.o
|
| which fails because of some c++11 elements in my client quantlib code.

Interesting question. The whole 'R and C++11' nexus is a little toxic (as the
CRAN gatekeepers exists on the older standard; some of us are working behind
the scenes to change that).  By and large, using -std=c++11 should not bite.
We use it for a things with Rcpp,  but because we cannot (yet!!) upload to
CRAN with it, there isn't as much testing for C++11.  

R itself is in C and does not care. Boost may care (and Boost 2.0 will be
guaranteed to work this way). No idea about Swig. I haven't built the QL-Swig
bindings in a while.

Now, your post doesn't actually show the error. What happens when you simply
set appropriate CXXFLAGS as in

    CXXFLAGS= -g -O3 -Wall -pipe -Wno-unused -pedantic -std=c++11

(I usually do that in ~/.R/Makevars; you can also set it per package in
src/Makevars).

Can you try and report back?

Dirk

--
Dirk Eddelbuettel | [hidden email] | http://dirk.eddelbuettel.com

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev