<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Small update on this question. The issue appears when exporting the Rcpp function and the error messages are caused by RcppExports.cpp<br>which is generated when running Rcpp::compileAttributes()<br><br>#include <Rcpp.h><br>using namespace Rcpp;<br><br>// [[Rcpp::plugins(cpp11)]]<br>// [[Rcpp::export]]<br>CharacterVector na_locf(CharacterVector x) {<br>  return x;<br>}<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">This is the output from Rcpp::compileAttributes()</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br>#include <Rcpp.h><br><br>using namespace Rcpp;<br><br>// na_locf<br>CharacterVector na_locf(CharacterVector x);<br>RcppExport SEXP _ttt_na_locf(SEXP xSEXP) {<br>  BEGIN_RCPP<br>  Rcpp::RObject rcpp_result_gen;<br>  Rcpp::RNGScope rcpp_rngScope_gen;<br>  Rcpp::traits::input_parameter< CharacterVector >::type x(xSEXP);<br>  rcpp_result_gen = Rcpp::wrap(na_locf(x));<br>  return rcpp_result_gen;<br>  END_RCPP<br>}<br><br>static const R_CallMethodDef CallEntries[] = {<br>  {"_ttt_na_locf", (DL_FUNC) &_ttt_na_locf, 1},<br>  {NULL, NULL, 0}<br>};<br><br>RcppExport void R_init_ttt(DllInfo *dll) {<br>  R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);<br>  R_useDynamicSymbols(dll, FALSE);<br>}</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">My excuses for this update.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Jan<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br><span style="font-family:trebuchet ms,sans-serif"></span><span style="font-family:trebuchet ms,sans-serif"><font face="trebuchet ms,sans-serif">Jan Wijffels<br>Statistician<br><a href="http://www.bnosac.be" target="_blank">www.bnosac.be</a>  | +32 486 611708</font><br></span></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 6 September 2017 at 15:03, Jan Wijffels <span dir="ltr"><<a href="mailto:jwijffels@bnosac.be" target="_blank">jwijffels@bnosac.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hello,</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I'm trying to fix the installation issue I have with the package udpipe: <a href="https://github.com/bnosac/udpipe" target="_blank">https://github.com/bnosac/<wbr>udpipe</a> but I'm getting issues on Solaris giving messages like this:</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><pre>/opt/csw/bin/g++ -std=gnu++11 -I/opt/R/R-3.4.1-patched-gcc/<wbr>lib/R/include -DNDEBUG  -I"/export/home/XyG0aYI/R/<wbr>Rcpp/include" -I/opt/csw/include -I/usr/local/include   -fPIC  -O2 -c RcppExports.cpp -o RcppExports.o
In file included from /opt/csw/include/c++/5.2.0/<wbr>cmath:44:0,
                 from /export/home/XyG0aYI/R/Rcpp/<wbr>include/Rcpp/platform/<wbr>compiler.h:100,
                 from /export/home/XyG0aYI/R/Rcpp/<wbr>include/Rcpp/r/headers.h:48,
                 from /export/home/XyG0aYI/R/Rcpp/<wbr>include/RcppCommon.h:29,
                 from /export/home/XyG0aYI/R/Rcpp/<wbr>include/Rcpp.h:27,
                 from RcppExports.cpp:4:
/usr/include/math.h:45:12: error: ‘std::float_t’ has not been declared
 using std::float_t;
            ^
/usr/include/math.h:46:12: error: ‘std::double_t’ has not been declared
 using std::double_t;<br></pre><pre></pre></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">This type of error seems to be something that has been mentioned in <a href="https://journal.r-project.org/archive/2011-2/RJournal_2011-2_Plummer.pdf" target="_blank">https://journal.r-project.org/<wbr>archive/2011-2/RJournal_2011-<wbr>2_Plummer.pdf</a> but still can't seem to find the solution. <br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">To make this problem as tiny as possible, I've made a reproducible example. Let's say I have an R package with the following inside the src folder <br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">#include <Rcpp.h><br>using namespace Rcpp;<br><br>// [[Rcpp::plugins(cpp11)]]<br>CharacterVector na_locf(CharacterVector x) {<br>  return x;<br>}</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">If the DESCRIPTION file mentions the following:<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Imports: Rcpp (>= 0.12.12)<br>LinkingTo: Rcpp<br>SystemRequirements: C++11</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Or if there is CXX_STD=CXX11 in the Makevars file, I get the errors like this when building on Solaris (see log on <a href="https://builder.r-hub.io/status/original/ttt_0.1.0.tar.gz-26c279a1b07047fea8ded89b4e07c6ad" target="_blank">https://builder.r-hub.io/<wbr>status/original/ttt_0.1.0.tar.<wbr>gz-<wbr>26c279a1b07047fea8ded89b4e07c6<wbr>ad</a>), using rhub::check(platform  = "solaris-x86-patched"), while on Ubuntu this is working fine.<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><pre>/opt/csw/bin/g++ -std=gnu++11 -I/opt/R/R-3.4.1-patched-gcc/<wbr>lib/R/include -DNDEBUG  -I"/export/home/XyG0aYI/R/<wbr>Rcpp/include" -I/opt/csw/include -I/usr/local/include   -fPIC  -O2 -c RcppExports.cpp -o RcppExports.o
In file included from /opt/csw/include/c++/5.2.0/<wbr>cmath:44:0,
                 from /export/home/XyG0aYI/R/Rcpp/<wbr>include/Rcpp/platform/<wbr>compiler.h:100,
                 from /export/home/XyG0aYI/R/Rcpp/<wbr>include/Rcpp/r/headers.h:48,
                 from /export/home/XyG0aYI/R/Rcpp/<wbr>include/RcppCommon.h:29,
                 from /export/home/XyG0aYI/R/Rcpp/<wbr>include/Rcpp.h:27,
                 from RcppExports.cpp:4:
/usr/include/math.h:45:12: error: ‘std::float_t’ has not been declared
 using std::float_t;</pre></div>I<div style="font-family:trebuchet ms,sans-serif;display:inline" class="gmail_default">​f I do not add ​SystemRequirements: C++11 and remove the Makevars file, this works fine on Solaris. I need however C++11 as I need it in the udpipe R package for building udpipe.cpp but can't add </div><div style="font-family:trebuchet ms,sans-serif;display:inline" class="gmail_default">to that udpipe.cpp file the following types of statements due to conflicts on the use of the Free macro.<br></div><div style="font-family:trebuchet ms,sans-serif;display:inline" class="gmail_default">#include <Rcpp.h><br>using namespace Rcpp;<br>// [[Rcpp::plugins(cpp11)]]</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Is there anyone having similar problems that can give an indication on how to solve this Solaris build issue?</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">many thanks,</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Jan<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><br><div><div class="m_92108953303561009gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br><span style="font-family:trebuchet ms,sans-serif"></span><span style="font-family:trebuchet ms,sans-serif"><font face="trebuchet ms,sans-serif">Jan Wijffels<br>Statistician<br><a href="http://www.bnosac.be" target="_blank">www.bnosac.be</a>  | +32 486 611708</font><br></span></div></div></div></div></div></div></div>
</font></span></div>
</blockquote></div><br></div>