[R-SIG-Mac] Issue with exception handling in unofficial Clang 4.0.0 for R 3.4.1

Matt mmoores at gmail.com
Wed Sep 20 10:34:11 CEST 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170920/08b0eeca/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RcppException.cpp
Type: text/x-c++src
Size: 204 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170920/08b0eeca/attachment.bin>


More information about the R-SIG-Mac mailing list