The attached code throws an exception with a specific error message. However, this is what it looks like when I compile it on Sierra using the unofficial Clang 4.0.0 build from http://r.research.att.com/libs/
```{r} Rcpp::sourceCpp('Dropbox/blog/RcppException.cpp') throw_exception() ``` Error in throw_exception() : c++ exception (unknown reason) This is my ~/.R/Makevars CC = /usr/local/clang4/bin/clang CXX = /usr/local/clang4/bin/clang++ -arch x86_64 -ftemplate-depth-256 LDFLAGS=-L/usr/local/clang4/lib -fopenmp CXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -fopenmp Note that this works as expected if I instead use the official Clang 4.0.0 binary from http://releases.llvm.org/download.html#4.0.0 R version 3.4.1 (2017-06-30) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Sierra 10.12.6 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib locale: [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_3.4.1 tools_3.4.1 Rcpp_0.12.12
#include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] int throw_exception() { std::stringstream errmsg; errmsg << "this is an exception"; throw std::domain_error(errmsg.str()); return 0; }
_______________________________________________ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac