@@ -1206,6 +1206,23 @@ helps within this environment as it installs the corresponding
1206
1206
systems is provided
1207
1207
[ at this page] ( https://conda.io/docs/user-guide/tasks/build-packages/compiler-tools.html ) .
1208
1208
1209
+ ## Can I speed up compilation?
1210
+
1211
+ Somewhat. One option is to cache as much as possible via
1212
+ [ ccache] ( https://ccache.dev/ ) by adding it to ` ~/.R/Makevars ` .
1213
+
1214
+ Depending on what parts of Rcpp are being used, compilation speed can be
1215
+ increased by turning use of Modules off. Starting with version 1.0.3, the
1216
+ ` RCPP_NO_MODULES ` define can be used. It can be set in ` src/Makevars ` as
1217
+ an argument to ` PKG_CXXFLAGS ` (or one of the other C++ dialect options) as
1218
+ ` -DRCPP_NO_MODULES ` . This has the advantage of affecting _ all_ files in the
1219
+ package, including the auto-generated ` RcppExports.cpp ` where it might be
1220
+ trickier to set it manually.
1221
+
1222
+ Beyond modules, RTTI support can also be turned off. this implies turning
1223
+ Modules support off as well so. To select this approach, use the
1224
+ ` RCPP_NO_RTTI ` define.
1225
+
1209
1226
# Support
1210
1227
1211
1228
## Is the API documented
@@ -1720,3 +1737,20 @@ elsewhere.
1720
1737
So if your autogenerated file fails, and a ` symbols not found ` error is reported
1721
1738
by the linker, consider running ` compileAttributes() ` twice. Deleting
1722
1739
` R/RcppExports.R ` and ` src/RcppExports.cpp ` may also work.
1740
+
1741
+ ## Can we use exceptions and stop() across shared libraries?
1742
+
1743
+ Within limits, yes. Code that is generated via Rcpp Attributes (see
1744
+ \citet{CRAN:Rcpp: Attributes } and Section~ \ref{using-attributes}) generally
1745
+ handles this correctly and gracefully via the ` try-catch ` layer it adds
1746
+ shielding the exception from propagating to another, separate dynamic
1747
+ library.
1748
+
1749
+ However, this mechanism relies on dynamic linking with the (system library)
1750
+ ` libgcc ` providing the C++ standard library (as well as on using the same C++
1751
+ standard library across all compiled components). But this library is linked
1752
+ statically on Windows putting a limitation on the use of ` stop() ` from within
1753
+ Rcpp Modules \citep{CRAN:Rcpp: Modules }. Some more background on the linking
1754
+ requirement is [ in this SO
1755
+ question] ( https://stackoverflow.com/questions/2424836/exceptions-are-not-caught-in-gcc-program ) .
1756
+
0 commit comments