Chris,<div><br></div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 19, 2012 at 12:40 PM, Chris Jefferson <span dir="ltr"><<a href="mailto:chris@bubblescope.net" target="_blank">chris@bubblescope.net</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"><div class="im">On 19/11/12 17:33, Thell Fowler 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">
<br>
/home/thell/R/library/Rcpp/<u></u>include/Rcpp/sugar/sets.h:28:<u></u>2: error:<br>
invalid preprocessing directive<br>
#elseif defined(HAS_TR1_UNORDERED_SET)<br>
</blockquote>
<br></div>
Without looking any deeper at this (sorry), clang doesn't not accept elseif, it requires elif.<br>
<br>
gcc actually doesn't do what you expect with elseif. It just ignores it if the #if isn't added, and causes a compile-time error if you end up actually reaching that line. So in:<br>
<br>
#if defined(X)<br>
<br>
#elseif defined(Y)<br>
<br>
#endif<br>
<br>
If X is not defined, nothing is included even if Y is defined. If X is defined, a compile-time error always occurs.<br>
<br>
in you want someone with gcc, clang and c++0x experience have a dig through these headers, I am happy to download them and have a look.<br>
<br>
Chris<br>
<br>
______________________________<u></u>_________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-<u></u>project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-<u></u>project.org/cgi-bin/mailman/<u></u>listinfo/rcpp-devel</a><br>
</blockquote></div><br><div>Sure enough.  Good eye!  I edited the sets.h and that error is gone.</div><div><br></div><div><div>After reducing the example code to::</div><div><br></div><div><div>suppressMessages( require( inline) )</div>
<div>suppressMessages( require( Rcpp ) )</div><div><br></div><div>test <- cxxfunction( sig=signature(),</div><div>               body='</div><div>                      using namespace Rcpp;</div><div>                      return R_NilValue;</div>
<div>                    ',</div><div>               plugin="Rcpp",</div><div>               verbose=FALSE)</div></div><div><br></div><div class="gmail_extra">-- <br></div></div><div><br></div><div>The circular reference is still there (clang 3.3)::</div>
<div><br></div><div><div>Error in compileCode(f, code, language = language, verbose = verbose) : </div><div>  Compilation ERROR, function(s)/method(s) not created! In file included from file34e22dd4a557.cpp:6:</div><div>In file included from /home/thell/R/library/Rcpp/include/Rcpp.h:27:</div>
<div>In file included from /home/thell/R/library/Rcpp/include/RcppCommon.h:349:</div><div>In file included from /home/thell/R/library/Rcpp/include/Rcpp/sugar/sugar_forward.h:29:</div><div>In file included from /home/thell/R/library/Rcpp/include/Rcpp/sugar/logical/logical.h:27:</div>
<div>/home/thell/R/library/Rcpp/include/Rcpp/sugar/logical/SingleLogicalResult.h:36:2: error: circular inheritance between 'conversion_to_bool_is_forbidden<x>' and 'conversion_to_bool_is_forbidden<x>'</div>
<div>        conversion_to_bool_is_forbidden<x>{</div><div>        ^</div><div>In file included from file34e22dd4a557.cpp:6:</div><div>In file included from /home/thell/R/library/Rcpp/include/Rcpp.h:68:</div><div>In file included from /home/thell/R/library/Rcpp/include/Rcpp/sugar/sugar.h:29:</div>
<div>In file included from /home/thell/R/library/Rcpp/include/Rcpp/sugar/functions/functions.h:62:</div><div>/home/thell/R/library/Rcpp/incl</div></div><div><br></div><div>And using clang 3.0::</div><div><br></div><div><div>
Error in compileCode(f, code, language = language, verbose = verbose) : </div><div>  Compilation ERROR, function(s)/method(s) not created! In file included from file34e290f2bc0.cpp:4:</div><div>In file included from /home/thell/R/library/Rcpp/include/Rcpp.h:68:</div>
<div>In file included from /home/thell/R/library/Rcpp/include/Rcpp/sugar/sugar.h:29:</div><div>In file included from /home/thell/R/library/Rcpp/include/Rcpp/sugar/functions/functions.h:62:</div><div>/home/thell/R/library/Rcpp/include/Rcpp/sugar/functions/unique.h:46:5: error: no type named 'unordered_set' in namespace 'std'</div>
<div>    RCPP_UNIQUE_SET<STORAGE> set ;</div><div>    ^~~~~~~~~~~~~~~</div><div>/home/thell/R/library/Rcpp/include/Rcpp/sugar/sets.h:26:34: note: expanded from:</div><div>    #define RCPP_UNIQUE_SET std::unordered_set</div>
<div>                            ~~~~~^</div><div>In file included from file34e290f2bc0.cpp:4:</div><div>In file included from /home/thell/R/library/Rcpp/include/Rcpp.h:68:</div><div>In file included from /home/thell/R/library/Rcpp/include/Rcpp/sugar/sugar.h:29:</div>
<div>In file included from /home/thell/R/library/Rcpp/include/Rcpp/sugar/functions/functions.h:62:</div><div>/home/thell/R/lib</div><div>In addition: Warning message:</div><div>running command '/usr/lib/R/bin/R CMD SHLIB file34e290f2bc0.cpp 2> file34e290f2bc0.cpp.err.txt' had status 1</div>
</div><div><br></div><div><br></div><div>Sincerely,<br></div>Thell<br>
</div>