无法使用R 4.0.3和RedHat Linux 6.10安装RcppArmadillo

问题描述

我刚在计算群集的本地目录中安装了R 4.0.3。

我正在使用gcc 5.1.0,并且已设置Sys.setenv(“ PKG_CXXFLAGS” =“-std = c ++ 11”)

Rcpp安装良好。

但是使用RcppArmadillo,我会收到数百行这样的错误消息

../inst/include/armadillo_bits/gmm_full_meat.hpp:169:3: error: ‘rw’ is not a member of ‘arma::access’
   access::rw(hefts) = in_hefts;
   ^
../inst/include/armadillo_bits/gmm_full_meat.hpp: In member function ‘void arma::gmm_priv::gmm_full<eT>::set_means(const arma::Base<eT,T1>&)’:
../inst/include/armadillo_bits/gmm_full_meat.hpp:191:3: error: ‘rw’ is not a member of ‘arma::access’
   access::rw(means) = in_means;
   ^
../inst/include/armadillo_bits/gmm_full_meat.hpp: In member function ‘void arma::gmm_priv::gmm_full<eT>::set_fcovs(const arma::BaseCube<eT,T1>&)’:
../inst/include/armadillo_bits/gmm_full_meat.hpp:216:3: error: ‘rw’ is not a member of ‘arma::access’
   access::rw(fcovs) = in_fcovs;
   ^
../inst/include/armadillo_bits/gmm_full_meat.hpp: In member function ‘void arma::gmm_priv::gmm_full<eT>::set_hefts(const arma::Base<eT,T1>&)’:
../inst/include/armadillo_bits/gmm_full_meat.hpp:246:28: error: ‘rw’ is not a member of ‘arma::access’
         eT*    hefts_mem = access::rw(hefts).memptr();
                            ^
../inst/include/armadillo_bits/gmm_full_meat.hpp:253:3: error: ‘rw’ is not a member of ‘arma::access’
   access::rw(hefts) /= accu(hefts);
   ^
../inst/include/armadillo_bits/gmm_full_meat.hpp: In member function ‘bool arma::gmm_priv::gmm_full<eT>::load(std::__cxx11::string)’:
../inst/include/armadillo_bits/gmm_full_meat.hpp:289:36: error: ‘arma_binary’ was not declared in this scope
   bool status = storage.load(name,arma_binary);
                                    ^
../inst/include/armadillo_bits/gmm_full_meat.hpp:315:3: error: ‘rw’ is not a member of ‘arma::access’
   access::rw(means) = storage_means;
   ^
../inst/include/armadillo_bits/gmm_full_meat.hpp:316:3: error: ‘rw’ is not a member of ‘arma::access’
   access::rw(hefts) = storage_hefts;
   ^
../inst/include/armadillo_bits/gmm_full_meat.hpp:329:5: error: ‘rw’ is not a member of ‘arma::access’
     access::rw(fcovs).slice(g) = storage_fcov;
     ^
../inst/include/armadillo_bits/gmm_full_meat.hpp: In member function ‘bool arma::gmm_priv::gmm_full<eT>::save(std::__cxx11::string) const’:

我完全迷路了。请帮忙!

解决方法

我在RedHat 7.5的R 4.0.3上遇到了相同的问题 这对我有用:

install.packages("RcppArmadillo",repos="https://rcppcore.github.io/drat")

(来自https://www.gitmemory.com/RcppCore