<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 19/11/12 18:58, Thell Fowler wrote:<br>
</div>
<blockquote
cite="mid:CAAJPTXgBvZ1y-i1RPgABM5_w7i8Qus_z7f+-RKppQhr7VxvbOg@mail.gmail.com"
type="cite">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 moz-do-not-send="true"
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/include/Rcpp/sugar/sets.h:28: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>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a moz-do-not-send="true"
href="mailto:Rcpp-devel@lists.r-forge.r-project.org"
target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a moz-do-not-send="true"
href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel"
target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/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>
</div>
</blockquote>
<br>
This is also fixed in svn (having just checked it out).<br>
<br>
You can locally fix it by changing line 36 from:<br>
<br>
conversion_to_bool_is_forbidden<x>{<br>
<br>
to:<br>
<br>
forbidden_conversion<x>{<br>
<br>
<br>
<blockquote
cite="mid:CAAJPTXgBvZ1y-i1RPgABM5_w7i8Qus_z7f+-RKppQhr7VxvbOg@mail.gmail.com"
type="cite">
<div class="gmail_extra">
<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>
</blockquote>
<br>
I would guess this is caused by clang 3.0's c++11 support not being
very good. I certainly would be tempted not to try to fix it, unless
there is a good reason for it. clang 3.2 should be out very shortly,
with very good support.<br>
<br>
Chris<br>
</body>
</html>