[R-SIG-Mac] installing Rcpp on R compiled with intel composer on OSX Yosemite

Simon Urbanek simon.urbanek at r-project.org
Mon Feb 23 21:58:58 CET 2015


On Feb 20, 2015, at 1:57 PM, Rohit Narula <narula at zedat.fu-berlin.de> wrote:

> Inspite of succeeding with the compilation of R-3.1.2 using the intel suite of compilers ver.2015.0.077 including MKL on my late 2014 MacBook Pro running Yosemite (outlined here <http://feng.li/r-with-icc-mkl/>), I am unable to install the excellent Rcpp package that I have been thoroughly enjoying thus far via the prepackaged binary R for Mavericks. Now, I would like to speed things up a bit, in particular use OpenMP that is seemingly incompatible with the default clang. I am aware of the OpenMP/clang project but it seems that installation on Yosemite is still dodgy.
> 
> Apart from several mentions of Warning in strptime during make -j8, make installcompletes successfully and I am able to install most packages on the freshly compiled R. The Rcpp package nevertheless fails with:
> 
>> install.packages("Rcpp")
> 
> Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
>  unknown timezone 'Asia/Kolkata'
> Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
>  unknown timezone 'GMT'
> Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
>  unknown timezone 'America/New_York'
> * installing *source* package ‘Rcpp’ ...
> ** package ‘Rcpp’ successfully unpacked and MD5 sums checked
> Warning in as.POSIXlt.POSIXct(x, tz) : unknown timezone 'GMT'
> Warning in as.POSIXlt.POSIXct(x, tz) :
>  unknown timezone 'America/New_York'
> ** libs
> icpc -I/Users/username/R-3.1.2/include -DNDEBUG -I../inst/include/ -I/sw/include -I/usr/local/include    -fPIC  -g -O3   -c Date.cpp -o Date.o
> In file included from ../inst/include/Rcpp/Vector.h(69),
>                 from ../inst/include/Rcpp.h(38),
>                 from Date.cpp(31):
> ../inst/include/Rcpp/vector/swap.h(35): error: "swap" is not a class or function template name in the current scope
>  RCPP_GENERATE_SWAP(generic_proxy,VECSXP)
>  ^
> 
> In file included from ../inst/include/Rcpp/Vector.h(69),
>                 from ../inst/include/Rcpp.h(38),
>                 from Date.cpp(31):
> ../inst/include/Rcpp/vector/swap.h(36): error: "swap" is not a class or function template name in the current scope
>  RCPP_GENERATE_SWAP(generic_proxy,EXPRSXP)
>  ^
> 
> In file included from ../inst/include/Rcpp/Vector.h(69),
>                 from ../inst/include/Rcpp.h(38),
>                 from Date.cpp(31):
> ../inst/include/Rcpp/vector/swap.h(37): error: "swap" is not a class or function template name in the current scope
>  RCPP_GENERATE_SWAP(string_proxy,STRSXP)
>  ^
> 
> Date.cpp(562): warning #437: reference to local variable of enclosing function is not allowed
>              2 * sizeof *sp + 4 * TZ_MAX_TIMES];
>                          ^
> 
> compilation aborted for Date.cpp (code 2)
> make: *** [Date.o] Error 2
> ERROR: compilation failed for package ‘Rcpp’
> Is there a way to fix this? Alternatively, how can I switch compilers to be able to invoke 'OpenMP' via Rcpp on my MacBook?
> 

I'm currently traveling abroad so can't check on the icc issue until next week, but using iomp on Yosemite is relatively easy - last time I checked both iomp and clang with omp support compiled out of the box on Yosemite according to the instructions on the corresponding sites (you can safely use Apple's clang to compile both iomp and the compiler - then just rename or symlink iomp in place of gomp and use the omp-enabled clang compiler). What's nice is that iomp doesn't suffer from the performance issues on OS X that gomp did. 

Cheers,
Simon



> PS: crossposted from http://stackoverflow.com/questions/28633979/installing-rcpp-on-r-compiled-with-intel-composer-on-osx-yosemite?noredirect=1#comment45570611_28633979 <http://stackoverflow.com/questions/28633979/installing-rcpp-on-r-compiled-with-intel-composer-on-osx-yosemite?noredirect=1#comment45570611_28633979> at Dirk’s suggestion.
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list