在OSX Yosemite上使用英特尔composer编译的R上安装Rcpp
尽管使用英特尔编译器套件Vr.2015.0.077成功编译了在OSX Yosemite上使用英特尔composer编译的R上安装Rcpp,r,clang,openmp,rcpp,intel-composer,R,Clang,Openmp,Rcpp,Intel Composer,尽管使用英特尔编译器套件Vr.2015.0.077成功编译了R-3.1.2,包括2014年末运行Yosemite(概述)的MacBook Pro上的MKL,我无法安装优秀的Rcpp软件包,到目前为止,我一直在通过针对Mavericks的预打包二进制R享受这个软件包。现在,我想加快一点速度,特别是使用OpenMP,它似乎与默认的clang不兼容。我知道OpenMP/clang项目,但似乎在约塞米蒂岛上的安装仍然不可靠 除了在make-j8过程中多次提到strtime中的警告外,make-insta
R-3.1.2
,包括2014年末运行Yosemite(概述)的MacBook Pro上的MKL
,我无法安装优秀的Rcpp
软件包,到目前为止,我一直在通过针对Mavericks的预打包二进制R
享受这个软件包。现在,我想加快一点速度,特别是使用OpenMP
,它似乎与默认的clang
不兼容。我知道OpenMP/clang项目,但似乎在约塞米蒂岛上的安装仍然不可靠
除了在make-j8
过程中多次提到strtime中的警告外,make-install
成功完成,我能够在新编译的R
上安装大多数软件包。但是,Rcpp
程序包出现以下故障:
> 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’
>安装程序包(“Rcpp”)
strtime中的警告(xx,f这是我对正在发生的事情的最佳猜测。在Rcpp
中,我们为std::swap()
提供了专门化,并复制了相关位以简化说明:
namespace std {
#undef RCPP_GENERATE_SWAP
#define RCPP_GENERATE_SWAP(TYPE,RTYPE) \
template<> inline void swap< Rcpp::internal::TYPE<RTYPE> >( \
Rcpp::internal::TYPE<RTYPE>& a , \
Rcpp::internal::TYPE<RTYPE>& b) { \
a.swap(b) ; \
}
RCPP_GENERATE_SWAP(generic_proxy,VECSXP)
RCPP_GENERATE_SWAP(generic_proxy,EXPRSXP)
RCPP_GENERATE_SWAP(string_proxy,STRSXP)
#undef RCPP_GENERATE_SWAP
}
名称空间std{
#未定义RCPP\u生成\u交换
#定义RCPP_生成_交换(类型,RTYPE)\
模板内联无效交换(\
Rcpp::内部::类型&a\
Rcpp::internal::TYPE&b){\
a、 掉期(b)\
}
RCPP_生成_交换(通用_代理,VECSXP)
RCPP_生成_交换(通用_代理,EXPRSXP)
RCPP_生成_交换(字符串_代理,STRSXP)
#未定义RCPP\u生成\u交换
}
它看起来像是编译器遇到此头的时刻,即std::swap()的适当模板定义
还没有被看到,因此它会呕吐。这对我来说似乎很奇怪,因为我们确实明确提供了一个#include倡导者,在定义类型的命名空间中提供这些专门化,而不是std
,以允许ADL
您可以尝试在本地修改Rcpp源,以查看是否可以提供支持std::swap()
(如cppreference
所建议的)的替代方法,然后建议对Rcpp
进行上游修改,如果一切正常的话。这可能是r-sig-mac邮件列表的一个问题…明白了!再次感谢这么一个可爱的包。是的。这些swap
可能属于Rcpp::
谢谢!我实际上尝试过在linux集群上使用英特尔编译器安装RcppRcpp(以及RcppArmadillo)安装时毫无怨言。因此,我怀疑这是Mac OSX特有的功能,可能与英特尔编译器结合使用。我将按照建议进行操作,并报告。