- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试在 CentOS 上安装 RcppArmadillo。以下是一些环境详细信息:
OS: CentOS release 6.5 (Final)
R version: R-3.1.2-1.el6.x86_64
uname -sr: Linux 2.6.32-431.29.2.el6.x86_64
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
我在下面列出了从 R 中运行 install.packages("RcppArmadillo")
时收到的错误消息。非常感谢任何帮助。干杯。
* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
* checking LAPACK_LIBS: divide-and-conquer complex SVD available via R-supplied LAPACK
** libs
g++ -m64 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/rexec/R/library/Rcpp/include" -I../inst/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RcppArmadillo.cpp -o RcppArmadillo.o
In file included from ../inst/include/armadillo:97,
from ../inst/include/RcppArmadilloForward.h:46,
from ../inst/include/RcppArmadillo.h:30,
from RcppArmadillo.cpp:22:
../inst/include/armadillo_bits/traits.hpp: In instantiation of ‘const bool arma::is_arma_type<std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum> >::value’:
../inst/include/armadillo_bits/op_expmat_meat.hpp:51: instantiated from here
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview_elem2’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview_elem1’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview_col’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview_row’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_diagview’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_mtGlue’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_mtOp’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_eGlue’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_eOp’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_Glue’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_Op’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_Gen’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<unsigned int>, std::__is_floating<unsigned int> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_Mat’
../inst/include/armadillo_bits/traits.hpp: In instantiation of ‘const bool arma::is_arma_type<std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum> >::value’:
../inst/include/armadillo_bits/op_expmat_meat.hpp:51: instantiated from here
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview_elem2’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview_elem1’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview_col’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview_row’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_subview’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_diagview’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_mtGlue’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_mtOp’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_eGlue’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_eOp’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_Glue’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_Op’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_Gen’
../inst/include/armadillo_bits/traits.hpp:614: error: ‘std::__traitor<std::__is_integer<double>, std::__is_floating<double> >::<anonymous enum>’ is/uses anonymous type
../inst/include/armadillo_bits/traits.hpp:614: error: trying to instantiate ‘template<class T> struct arma::is_Mat’
make: *** [RcppArmadillo.o] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/home/rexec/R/library/RcppArmadillo’
The downloaded source packages are in
‘/tmp/Rtmp2hNzB9/downloaded_packages’
Warning message:
In install.packages("RcppArmadillo") :
installation of package ‘RcppArmadillo’ had non-zero exit status
最佳答案
这是 CentOS 6 附带的古老 gcc/g++ 4.4 中的一个错误。升级到具有较新 g++ 的 CentOS 7,或询问 RcppArmadillo maintainers更新到最新版本的 Armadillo (4.550.2),它具有针对 g++ 中错误的解决方法。
您还可以从该站点手动安装旧版本的 RcppArmadillo:http://cran.r-project.org/src/contrib/Archive/RcppArmadillo/
版本 4.500 适用于 CentOS 6
关于Rcpp Armadillo : failing to install on CentOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27296522/
在许多网站上,他们谈论 Armadillo +其他东西。它们是什么意思? 我以以下形式使用 Armadillo 库 #include 在 Linux 环境中。 在这个网站上 http://nghia
尽管成功捕获了异常,但是运行以下代码仍然会生成一条错误消息,该消息将发送到stdout(不是stderr): Mat matrix_quantiles(const vector & quantiles
我需要将 Armadillo (当前版本为 5.100.1)作为 $HOME 中的本地库(集群应用程序,不能安装在每个计算节点上,但 $HOME 是共享文件夹)。我正在使用 cmake 来管理应用程序
如何在 Armadillo C++ 中获取非零位置(索引)数组和稀疏矩阵的值? 到目前为止,我可以轻松地构造一个具有一组位置(作为 umat 对象)和值(作为 vec 对象)的稀疏矩阵: // bat
NLopt 目标函数如下所示: double myfunc(const std::vector &x, std::vector &grad, void *my_func_data) x 是被优化的数据
我想将一个 numpy 数组发送到 Armadillo (C++) 并从 C++ 程序输出一个 numpy 数组。我没有在网上找到任何教程。有人可以指点我如何做到这一点吗? 最佳答案 您可以依靠 cy
我正在尝试使用 OpenMP 并行化一个 for 循环,它对 Armadillo 矩阵求和。我有以下代码: #include #include int main() { arma:
尽管已成功捕获异常,但运行以下代码仍会产生一条错误消息,该消息会转到 stdout(而非 stderr): Mat matrix_quantiles(const vector & quantiles,
我喜欢使用 Armadillo Linear Algebra Library .当将 Octave .m 文件移植到 C++ 时,它变得非常好,尤其是当您必须使用特征方法时。 然而,当我不得不从我的原
如何实现一个简单的合并函数来合并两个矩阵,每个矩阵都有两列和一个公共(public)列 x使用 Armadillo ?换句话说,我想要一个函数 my_merge_cpp(mat1, mat2)这将使用
我正在尝试使用 Armadillo 将由整数(即 arma::Mat )组成的矩阵分解为特征值和特征向量 但是,无论我将什么作为输入矩阵和输出 vector/矩阵类型,它总是会给我编译错误 当我将输入
我有一种方法可以在使用 Armadillo 的原子中使用脚本编译c++文件?我找不到任何与此相关的信息。 我已经安装了 Armadillo ,并尝试使用原子脚本编写一些基本代码: #include
我在 cygwin64(或 minGW)下使用 Armadillo 包(v.7.300.1)生成一个随机矩阵: #include int main(){ arma::mat(3,3, arma::
我目前正在 Visual Studio 环境中使用 Armadillo 在 BeagleBone Black 上进行交叉编译,以将 MATLAB 代码转换为 C++。 这是一个信号处理项目,所以我需要
我是 Armadillo 的新手。我有以下代码,我认为它效率低下。有什么建议可以提高内存效率和/或速度吗?关注armadillo docs和 Rcpp gallery ,我无法获得 .colptr的,
如何提高 Armadillo 复杂矩阵乘法结果的精度。它近似于小数点后 4 位 [这是结果的一个示例 (35.9682,-150.246) ] 但我想要至少 8 位小数的精度。谢谢 最佳答案 因为你似
假设我有一个稀疏矩阵。我将其定义为以下 CSV 格式: 行、列、值 1,1,5 1,2,10 在这种情况下,点 (1,1) 等于 5,点 (1,2) 等于 10。 从这种格式(假设有数千或数十万行)创
我在一个项目中使用 Armadillo ,总的来说它运行良好。该项目是基于 Xcode 的,到目前为止,我设法让它工作的唯一方法是(添加/usr/include/的 header 搜索路径似乎不起作用
在 C++ 中对 vector 或矩阵执行模运算符的最佳方法是什么 Armadillo ? vector 和矩阵类重载 % 运算符以执行逐元素乘法。尝试使用它会产生 invalid operands
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Precision of multiplication by 1.0 and int float conv
我是一名优秀的程序员,十分优秀!