<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I could potentially be sending you down the wrong rabbit hole, but I know with R 4.3 they
<a href="https://www.tidyverse.org/blog/2023/03/cran-checks-compiled-code/" title="https://www.tidyverse.org/blog/2023/03/cran-checks-compiled-code/" data-loopstyle="link" id="LPNoLPOWALinkPreview">
switched from C++11 to C++17 being the standard</a>. Have you tried updating to a newer version of Rcpp?</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kevin Ushey <kevinushey@gmail.com><br>
<b>Sent:</b> Tuesday, May 30, 2023 3:02 PM<br>
<b>To:</b> Alexander Ilich <ailich@usf.edu><br>
<b>Cc:</b> Dominick Samperi <djsamperi@gmail.com>; rcpp-devel <Rcpp-devel@r-forge.wu-wien.ac.at><br>
<b>Subject:</b> Re: [Rcpp-devel] Rcpp::sourceCpp Problem with R 4.3 update</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">I'm also not able to reproduce, but I see a different linker invocation:<br>
<div><br>
</div>
<div>g++ -shared -static-libgcc -o sourceCpp_3.dll tmp.def file43185fe94049.o -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/R/R-43~1.0/bin/x64 -lR<br>
</div>
<div><br>
</div>
<div>In particular, yours is passing both '-std=gnu++17' and '-s'. Have you modified your R Makevars file, or R installation's etc/Makeconf?</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, May 30, 2023 at 11:43 AM Alexander Ilich <<a href="mailto:ailich@usf.edu">ailich@usf.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg-753639471799347163">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
What version of Rcpp are you using? With R 4.3 and Rcpp 1.0.10 I have no issues.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div>library(Rcpp)</div>
<div><br>
</div>
<div><br>
</div>
<div>Rcpp::sourceCpp(code='</div>
<div> #include <Rcpp.h></div>
<div> using namespace Rcpp;</div>
<div> // [[Rcpp::export()]]</div>
<div> SEXP cpptest(NumericVector v) {</div>
<div> return v;</div>
<div> }'</div>
<div>)</div>
<div>cpptest(1:5)</div>
<div>#> [1] 1 2 3 4 5</div>
<div><br>
</div>
<div><br>
</div>
<div>R.version</div>
<div>#> _ </div>
<div>#> platform x86_64-w64-mingw32 </div>
<div>#> arch x86_64 </div>
<div>#> os mingw32 </div>
<div>#> crt ucrt </div>
<div>#> system x86_64, mingw32 </div>
<div>#> status </div>
<div>#> major 4 </div>
<div>#> minor 3.0 </div>
<div>#> year 2023 </div>
<div>#> month 04 </div>
<div>#> day 21 </div>
<div>#> svn rev 84292 </div>
<div>#> language R </div>
<div>#> version.string R version 4.3.0 (2023-04-21 ucrt)</div>
<div>#> nickname Already Tomorrow</div>
<div>packageVersion("Rcpp")</div>
<div>#> [1] '1.0.10'</div>
</div>
<div id="x_m_-753639471799347163appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_m_-753639471799347163divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Rcpp-devel <<a href="mailto:rcpp-devel-bounces@lists.r-forge.r-project.org" target="_blank">rcpp-devel-bounces@lists.r-forge.r-project.org</a>>
on behalf of Dominick Samperi <<a href="mailto:djsamperi@gmail.com" target="_blank">djsamperi@gmail.com</a>><br>
<b>Sent:</b> Tuesday, May 30, 2023 2:27 PM<br>
<b>To:</b> rcpp-devel <<a href="mailto:Rcpp-devel@r-forge.wu-wien.ac.at" target="_blank">Rcpp-devel@r-forge.wu-wien.ac.at</a>><br>
<b>Subject:</b> [Rcpp-devel] Rcpp::sourceCpp Problem with R 4.3 update</font>
<div> </div>
</div>
<div>
<div dir="ltr">Looks like the recent update to R 4.3 broke Rcpp::sourceCpp.
<div><br>
</div>
<div>Here is a simple example...</div>
<div><br>
</div>
<div>library(Rcpp)<br>
Rcpp::sourceCpp(code='<br>
#include <Rcpp.h><br>
using namespace Rcpp;<br>
// [[Rcpp::export()]]<br>
SEXP cpptest(NumericVector v) {<br>
return v;<br>
}'<br>
)<br>
cpptest(1:5)<br>
</div>
<div><br>
</div>
<div>This works without problems under R 4.2.3, but under R 4.3 I get...</div>
<div><br>
</div>
<div>using C++ compiler: 'G__~1.EXE (GCC) 12.2.0'<br>
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: internal error: aborting at ../../binutils-2.40/ld/ldlang.c:527 in compare_section<br>
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: please report this bug<br>
collect2.exe: error: ld returned 1 exit status<br>
g++ -std=gnu++17 -I"c:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -I"C:/PROGRA~1/R/R-43~1.0/library/Rcpp/include" -I"C:/Users/djsam/AppData/Local/Temp/RtmpKEsaiY/sourceCpp-x86_64-w64-mingw32-1.0.10" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"
-O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c filebb0108a7dbf.cpp -o filebb0108a7dbf.o<br>
g++ -std=gnu++17 -shared -s -static-libgcc -o sourceCpp_2.dll tmp.def filebb0108a7dbf.o -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -Lc:/PROGRA~1/R/R-43~1.0/bin/x64 -lR<br>
Error in Rcpp::sourceCpp(code = "\n #include <Rcpp.h>\n using namespace Rcpp;\n // [[Rcpp::export()]]\n SEXP cpptest(NumericVector v) {\n return v;\n }") :
<br>
Error occurred building shared library.<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Dominick</div>
<div><br>
</div>
</div>
<p style="border:1px solid rgb(255,202,202); background-color:rgb(255,202,202); padding:1em">
<span style="font-size:12pt; color:black"><b>[EXTERNAL EMAIL]</b></span> <span style="font-size:10pt; color:black">
DO NOT CLICK links or attachments unless you recognize the sender and know the content is safe.</span></p>
</div>
</div>
_______________________________________________<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-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" originalsrc="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" shash="tb2hnTf9KPgKLJqLGtyhiXs+n+yTCwCMDH2JQkYqPaOroiDsyWiQ4tzjgde4awSHxpEDetDcwism01G5VRcvPF4LktFjtXTrauEIc6w9OXRUxiflAWmxhKBO6ReLd2jVkGzzz3gUGfOKZp1i3jtJB/8pyumAEpSevM89fPTxbLs=" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</div>
</blockquote>
</div>
</div>
<p style="border:1px; border-style:solid; border-color:#FFCACA; background-color:#FFCACA; padding:1em">
<span style="font-size:12.0pt; color:black"><b>[EXTERNAL EMAIL]</span></b> <span style="font-size:10.0pt; color:black">
DO NOT CLICK links or attachments unless you recognize the sender and know the content is safe.</span></p>
</div>
</body>
</html>