2016-11-06 1 views
0

Я хотел посмотреть, может ли использование инструкций SIMD ускорить некоторые из кода, который у меня есть. Я загрузил пакет RcppNT2, и они рекомендуют использовать функцию precompileRcppNT2() для ускорения процесса компиляции. Делая это, я получаю следующие ошибки и было интересно, там было что-то мне не хватает пытается использовать пакет:Я получаю ошибки при попытке использовать функцию «precompileRcppNT2» в пакете RcppNT2

R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 
Copyright (C) 2016 The R Foundation for Statistical Computing 
Platform: x86_64-w64-mingw32/x64 (64-bit) 

R is free software and comes with ABSOLUTELY NO WARRANTY. 
You are welcome to redistribute it under certain conditions. 
Type 'license()' or 'licence()' for distribution details. 

    Natural language support but running in an English locale 

R is a collaborative project with many contributors. 
Type 'contributors()' for more information and 
'citation()' on how to cite R or R packages in publications. 

Type 'demo()' for some demos, 'help()' for on-line help, or 
'help.start()' for an HTML browser interface to help. 
Type 'q()' to quit R. 

The following object is masked from package:base: 

    setwd 

libraries: c:/R/r_libs-3.3.2 C:/R/R-3.3.2/library 
library & Java environment set from C:\Users\jh52822\Documents\.RProfile 
> library(devtools) 
> library(Rcpp) 
> library(RcppNT2) 
> sessionInfo() 
R version 3.3.2 (2016-10-31) 
Platform: x86_64-w64-mingw32/x64 (64-bit) 
Running under: Windows 7 x64 (build 7601) Service Pack 1 

locale: 
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C       
[5] LC_TIME=English_United States.1252  

attached base packages: 
[1] stats  graphics grDevices utils  datasets methods base  

other attached packages: 
[1] RcppNT2_0.1.0 Rcpp_0.12.7  devtools_1.12.0 

loaded via a namespace (and not attached): 
[1] withr_1.0.2 memoise_1.0.0 digest_0.6.10 
> precompileRcppNT2() 
Pre-compiling 'RcppNT2.h'... 
In file included from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/include/functions/j0.hpp:5:0, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions.hpp:5, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/bessel.hpp:5, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/RcppNT2.h:15: 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/j0.hpp: In member function 'nt2::ext::impl_j0_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >), boost::dispatch::tag::cpu_>::result_type nt2::ext::impl_j0_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >), boost::dispatch::tag::cpu_>::operator()(const A0&) const': 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/j0.hpp:60:14: error: '::_j0' has not been declared 
     return ::_j0(a0); 
      ^
In file included from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/include/functions/j1.hpp:5:0, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions.hpp:6, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/bessel.hpp:5, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/RcppNT2.h:15: 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/j1.hpp: In member function 'nt2::ext::impl_j1_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >), boost::dispatch::tag::cpu_>::result_type nt2::ext::impl_j1_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >), boost::dispatch::tag::cpu_>::operator()(const A0&) const': 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/j1.hpp:74:14: error: '::_j1' has not been declared 
     return ::_j1(a0); 
      ^
In file included from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/include/functions/jni.hpp:5:0, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions.hpp:7, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/bessel.hpp:5, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/RcppNT2.h:15: 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/jni.hpp: In member function 'nt2::ext::impl_jni_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::integer_<T> >, boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<A1> >), boost::dispatch::tag::cpu_>::result_type nt2::ext::impl_jni_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::integer_<T> >, boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<A1> >), boost::dispatch::tag::cpu_>::operator()(const A0&, const A1&) const': 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/jni.hpp:63:14: error: '::_jn' has not been declared 
     return ::_jn(a0, a1); 
      ^
In file included from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/include/functions/y0.hpp:5:0, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions.hpp:8, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/bessel.hpp:5, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/RcppNT2.h:15: 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/y0.hpp: In member function 'nt2::ext::impl_y0_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >), boost::dispatch::tag::cpu_>::result_type nt2::ext::impl_y0_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >), boost::dispatch::tag::cpu_>::operator()(const A0&) const': 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/y0.hpp:69:14: error: '::_y0' has not been declared 
     return ::_y0(a0); 
      ^
In file included from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/include/functions/yni.hpp:5:0, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions.hpp:10, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/bessel.hpp:5, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/RcppNT2.h:15: 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/yni.hpp: In member function 'nt2::ext::impl_yni_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::integer_<T> >, boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<A1> >), boost::dispatch::tag::cpu_>::result_type nt2::ext::impl_yni_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::integer_<T> >, boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<A1> >), boost::dispatch::tag::cpu_>::operator()(const A0&, const A1&) const': 
c:/R/r_libs-3.3.2/RcppNT2/include/nt2/bessel/functions/scalar/yni.hpp:69:14: error: '::_yn' has not been declared 
     return ::_yn(a0, a1); 
      ^
In file included from c:/R/r_libs-3.3.2/RcppNT2/include/boost/simd/ieee/include/functions/scalar/nextafter.hpp:5:0, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/boost/simd/include/functions/scalar/nextafter.hpp:4, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/boost/simd/ieee/functions/scalar/next.hpp:15, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/boost/simd/ieee/include/functions/next.hpp:5, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/ieee/functions/next.hpp:12, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/ieee/include/functions/next.hpp:4, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/ieee/functions.hpp:27, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/nt2/ieee/ieee.hpp:5, 
       from c:/R/r_libs-3.3.2/RcppNT2/include/RcppNT2.h:26: 
c:/R/r_libs-3.3.2/RcppNT2/include/boost/simd/ieee/functions/scalar/nextafter.hpp: In member function 'boost::simd::ext::impl_nextafter_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >, boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >), boost::dispatch::tag::cpu_>::result_type boost::simd::ext::impl_nextafter_<void(boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >, boost::dispatch::meta::scalar_<boost::dispatch::meta::double_<Origin> >), boost::dispatch::tag::cpu_>::operator()(const A0&, const A0&) const': 
c:/R/r_libs-3.3.2/RcppNT2/include/boost/simd/ieee/functions/scalar/nextafter.hpp:73:14: error: '::_nextafter' has not been declared 
     return ::_nextafter(a0, a1); 
      ^
Error: Failed to compile 'RcppNT2.h' 
In addition: Warning message: 
running command 'c:/Rtools/mingw_64/bin/g++ -x c++-header c:/R/r_libs-3.3.2/RcppNT2/include/RcppNT2.h -Ic:/R/r_libs-3.3.2/RcppNT2/include -I c:/R/r_libs-3.3.2/BH/include -IC:/R/R-3.3.2/include -std=c++11 -O2 -Wall -mtune=core2' had status 1 

Любая помощь или предложения будут оценены.

ответ

3

Выглядит, что ваша версия MinGW не поддерживает функцию raw bessel и nextafter, или версия NT2, используемая RCpp, не упаковывает заголовок math config, который должен позаботиться об этом.

Не знаете, как RCpp предварительно скомпилирован, но это должно быть сделано так, чтобы на MinGW BOOST_SIMD_HAS_YN был defiend и BOOST_SIMD_HAS__YN не определен.

Смежные вопросы