<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 9 October 2014 16:23, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><br>
On 9 October 2014 at 15:55, Michele Salvadore wrote:<br>
| On 9 October 2014 13:26, Dirk Eddelbuettel <<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>> wrote:<br>
</span><span>|     Now it turns out that the suggested change breaks the Travis auto-builder.<br>
|     That is something to avoid as we set up continuous integration to catch<br>
|     these<br>
|     things. The error happens right at the top of R CMD check:<br>
|<br>
|       * checking whether package ‘RQuantLib’ can be installed ... ERROR<br>
|       Installation failed.<br>
|       See ‘/home/travis/build/eddelbuettel/rquantlib/RQuantLib.Rcheck/<br>
|     00install.out’ for details.<br>
|<br>
|     But I don;t have access to the log...<br>
|<br>
|     I also note that you switched to using auto -- RQuantLib is not (yet?) a<br>
|     C++11 project, and it may good to not force that just yet.<br>
|<br>
|  <br>
| I thought C++11 had to be switched on already in order to support for long long<br>
| type, see your comment here:<br>
| <a href="http://lists.r-forge.r-project.org/pipermail/rquantlib-devel/2014-September/" target="_blank">http://lists.r-forge.r-project.org/pipermail/rquantlib-devel/2014-September/</a><br>
| 000015.html<br>
<br>
</span>It was a guess of mine, the code may also fail to build for other reasons.<br>
<br>
But I think it would be preferable for you to keep the repo buildable ;-)<br>
So let's fix this now before adding further pull requests, or expanding the<br>
current one.<br></blockquote><div> </div><div>totally agree, it was indeed my intention to push only buildable commits :/</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><br>
| Sorry about that, will revert to use explicit types.<br>
| In regards to the build I apologize, unfortunately I am stuck on a windows box<br>
| for this project and I am struggling a bit with the platform. Any chance you<br>
| recall how the win-builder get around the issue with the long long type<br>
| discussed in the thread above without -std=c++0x?<br>
<br>
</span>win-builder has not changed in a while, and RQuantLib passed all tests when<br>
uploaded.  CRAN also continues to build and test once released --- the best<br>
of why knowledge would be encoded on src/Makevars.win.  And as you can see<br>
there are no particular switches.<br>
<br>
Can you remind me what the issue is, then?   Boost usage from R tends to<br>
issue copious __warnings__ about long long but still builds.  I may have been<br>
refering to suppressing the warning by turning on C++11, but I am not doing<br>
that yet for RQuantLib.<br></blockquote><div><br></div><div> Sure: in order to get my build rolling and the windows box I had to add the following switches on src/Makevars.win:</div><div><br></div><div><div>PKG_CXXFLAGS=-I$(QUANTLIB_ROOT) -I../inst/include -I. -I$(BOOSTLIB) $(SHLIB_OPENMP_CFLAGS) -std=c++0x</div><div>PKG_LIBS=-L$(QUANTLIB_ROOT)/lib${R_ARCH} -lQuantLib $(SHLIB_OPENMP_CFLAGS) -Wl,--allow-multiple-definition</div></div><div><br></div><div>(the $(SHLIB_OPENMP_CFLAGS) and $(SHLIB_OPENMP_CFLAGS) get the openMP pragma warnings out of the way)</div><div><br></div><div>without the -Wl,--allow-multiple-definition the linker is not happy, as it produces a huge amount of multiple definition errors like the following one:</div><div><br></div><div><div>asian.o:asian.cpp:(.text+0x2f20): multiple definition of `SEXPREC* Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'</div><div>RcppExports.o:RcppExports.cpp:(.text+0x4250): first defined here</div></div><div><br></div><div>If I also switch off -stdC++0x, the compilation fails because of "invalid conversion from 'SEXP' to 'long long unsigned int":</div><div><br></div><div><div>g++ -m64 -I"C:/PROGRA~1/R/R-31~1.1/include"       -I"C:/Program Files/R/R-3.1.1/library/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -I"C:/workspace/lib/QuantLib/Quantlib14" -I../inst/include -I. -I"C:/workspace/lib/boost/boost_1_56_0" -fopenmp   -O3 -Wall  -mtune=core2   -c RcppExports.cpp -o RcppExports.o</div><div>In file included from C:/Program Files/R/R-3.1.1/library/Rcpp/include/Rcpp/as.h:25:0,</div><div>                 from C:/Program Files/R/R-3.1.1/library/Rcpp/include/RcppCommon.h:169,</div><div>                 from ../inst/include/rquantlib_internal.h:30,</div><div>                 from ../inst/include/RQuantLib.h:23,</div><div>                 from RcppExports.cpp:4:</div><div>C:/Program Files/R/R-3.1.1/library/Rcpp/include/Rcpp/internal/Exporter.h: In constructor 'Rcpp::traits::Exporter<T>::Exporter(SEXP) [with T = long long unsigned int, SEXP = SEXPREC*]':</div><div>C:/Program Files/R/R-3.1.1/library/Rcpp/include/Rcpp/as.h:79:51:   instantiated from 'T Rcpp::internal::as(SEXP, Rcpp::traits::r_type_generic_tag) [with T = long long unsigned int, SEXP = SEXPREC*]'</div><div>C:/Program Files/R/R-3.1.1/library/Rcpp/include/Rcpp/as.h:144:84:   instantiated from 'T Rcpp::as(SEXP) [with T = long long unsigned int, SEXP = SEXPREC*]'</div><div>C:/Program Files/R/R-3.1.1/library/Rcpp/include/Rcpp/InputParameter.h:34:45:   instantiated from 'Rcpp::InputParameter<T>::operator T() [with T = long long unsigned int]'</div><div>RcppExports.cpp:29:161:   instantiated from here</div><div>C:/Program Files/R/R-3.1.1/library/Rcpp/include/Rcpp/internal/Exporter.h:31:31: error: invalid conversion from 'SEXP' to 'long long unsigned int' [-fpermissive]</div></div><div><br></div><div>The latter can be turned into a warning with the flag -fpermissive, is that the way to go? I am not sure as in the Makevars.win there is neither.</div><div><br></div><div>I am going to branch out my commits in my github and try to get the CI on travis working before merging back, but it would be really useful to access that log file...</div><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Hope this clarifies things and helps,  Dirk<br>
<div><div><br>
<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</div></div></blockquote></div><br></div></div>