[Rcpp-devel] Help needed for clang++ testing on OS X and Linux

Dirk Eddelbuettel edd at debian.org
Sun Oct 7 22:23:54 CEST 2012


On 7 October 2012 at 12:50, Davor Cubranic wrote:
| On 12-10-06 11:14 AM, Dirk Eddelbuettel wrote:
| > But we need to hear from OS X users with different clang++ versions, and
| > possibly clang++ users on other Linux setups --- particularly with clang++
| > 2.* and 3.1.
| >
| > The test is easy: just do 'R CMD INSTALL Rcpp_0.9.14.2.tar.gz' and it will
| > either build and exceptions.cpp finds its headers, or not.  I would
| > appreciate tests and reports back here greatly ... and I don't really want to
| > mess with five more uploads.
| 
| But isnt' it going to use whatever C++ R was configured to use? 

Yes. If no CC and CXX is set, you get what you had a R's compile time.

But if you set CC and CXX to other values as eg per (here still commented out)

  edd at max:~$ tail -4 .R/Makevars
  #CXX=clang++
  #CC=clang
  #CXXFLAGS=-Wall -O3 
  #CdFLAGS=-Wall -O3
  edd at max:~$ 

then those are used.  As clang/clang++ are in fact interoperable with
gcc/g++, this is a good option (eg for better error messages).

| Typically, that's the one it was built with, and for the "official" R 
| binary on OS X, that would be "CXX=gcc". Which, depending on the version 
| of the OS, will be either gcc or gcc-llvm. If so, wouldn't one need to R 
| from source with clang as the C++ compiler in order to test this?

No, sorry for not making that clearer.  If you have another compile (be it
icc or clang++) you can just drop it (on systems where drop-in compatibility
works such as Linux and AFAIK also OS X).

The issue with clang++ "simply" is that it doesn't (yet?) ship its headers,
and exceptions_defines.h can be in a subdirectory so we had #ifdef's for
this. Martin came up with a much better direct test for "is header present"
offered by clang.

So test away if you have clang++ around, and don't worry if you don't.

Dirk


-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list