Looks like the recent update to R 4.3 broke Rcpp::sourceCpp.

Here is a simple example...

library(Rcpp)
Rcpp::sourceCpp(code='
  #include <Rcpp.h>
  using namespace Rcpp;
  // [[Rcpp::export()]]
  SEXP cpptest(NumericVector v) {
    return v;
  }'
)
cpptest(1:5)

This works without problems under R 4.2.3, but under R 4.3 I get...

using C++ compiler: 'G__~1.EXE (GCC) 12.2.0'
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
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: please report this
bug
collect2.exe: error: ld returned 1 exit status
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
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
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  }") :
  Error occurred building shared library.

Thanks,
Dominick
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to