Posted by
Dirk Eddelbuettel on
Oct 27, 2013; 2:54pm
URL: http://quantlib.414.s1.nabble.com/SWIG-R-with-c-11-tp14618p14625.html
Hi Peter,
On 27 October 2013 at 10:45, Peter Caspers wrote:
| thank you. With
|
| CXX=clang++
| CXXFLAGS=-g -O3 -Wall -pipe -Wno-unused -pedantic -std=c++11
|
| in ~/R/Makevars make runs smooth on my code. I get 12 warnings of type
|
| QuantLib.cpp:552:7: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
|
| which does not look critical, and 3 warnings
|
| * checking DESCRIPTION meta-information ... WARNING
| Non-standard license specification:
| QuantLib License
| Standardizable: FALSE
Normal.
R stocks a set of licenses (on Debian/Ubuntu in /usr/share/R/share/licenses/)
but does not know our one. Which does not matter as we'd never ever push this
as a package to CRAN (as we'd need R help page entry for each callable
function etc pp)
| * checking for missing documentation entries ... WARNING
| Undocumented code objects:
| ‘ARSCurrency’ ‘ATSCurrency’ ‘AUDCurrency’ ‘AUDLibor’
| ‘AUDLibor__SWIG_0’ ‘AUDLibor__SWIG_1’ ‘Actual360’ ‘Actual365Fixed’
| ‘Actual365NoLeap’ ‘ActualActual’ ‘ActualActual__SWIG_0’
| ...
Yep. As expected.
| * checking PDF version of manual ... WARNING
| LaTeX errors when creating PDF version.
| This typically indicates Rd problems.
|
| again not dangerous, are they.
|
| Also then running R CMD INSTALL . goes without problems. After that I
| have a QuantLib.so which I can load from R
|
| dyn.load('/usr/local/lib/R/site-library/QuantLib/libs/QuantLib.so')
|
| and after
|
| source('~/quantlibpc/QuantLib-SWIG/R/R/QuantLib.R')
Nooooooooooooo!!! That is wrong.
The changes I made a few months ago allow you to
a) create what looks like an R package to R
b) install it like an R package
c) use it like an R package.
In short: R -e 'library(QuantLib); callWhatEverYouWantHere()'
and of course also in a longer interactive sesssion. Here QuantLib is the
package we got out of QL's SWIG work.
Doing it this is
d) portable as R knows whether your library ends in .so, .dll or .dynlib
e) well understood and a standard in the eosystem you entered: R
f) hence _much_ easier on users
g) also deals with all the metadata (eg the RData)
h) makes R aware of the package too (eg library() sees it)
I apologize for having taken years to make the somewhat small changes to all
the excellent work Joe had to make it build under SWIG. Once you have a
package, it all works much, much better.
| I can succesfully run a few basic tests with QuantLib objects.
|
| However there does not seem to be the compiled wrapper QuantLib.RData
| generated. Was it renamed maybe or do I have to generate it by myself ?
You do that too as part of the package build and load. Automagically.
Please lets keep this thread going. Between you, Klaus, Joe, myself, we
shoukld get some mojo back into QuantLib and R. (And yes, I still plan to
renovate RQuantLib. Help welcome. Repo on R-Forge, would be happy to move to
GH if folks think it helped.)
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