Ubuntu 18.04 上的 RcppNumerical 和 RcppEigen 警告
Warning in RcppNumerical and RcppEigen on Ubuntu 18.04
每次使用 RcppEigen 或 RcppNumerical 时,我都会在控制台中收到一条很长的警告消息。
/home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/src/Core/util/XprHelper.h:170:83: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type {aka __vector(2) double}’ [-Wignored-attributes]
/home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/src/Core/util/XprHelper.h:170:83: warning: ignoring attributes on template argument ‘Eigen::internal::unpacket_traits<__vector(2) double>::half {aka __vector(2) double}’ [-Wignored-attributes]
/home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/src/Core/util/XprHelper.h:188:88: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type {aka __vector(2) double}’ [-Wignored-attributes]
typedef typename find_best_packet_helper<Size,typename packet_traits<T>::type>::type type;
^~~~
In file included from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/Core:430:0,
from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/Dense:1,
from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/RcppEigenForward.h:30,
from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/RcppEigen.h:25,
from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppNumerical/include/RcppNumerical.h:10,
from PeerCount.cpp:3:
但是,代码运行良好。我为任何代码获取此代码。加载
后会出现警告
#include <RcppEigen.h>
或
#include <RcppNumerical.h>
我所有的包都是最新的
正如德克在评论中所说,您可以将 -Wno-ignored-attributes
添加到编译器标志中。您可以通过创建文件 ~/.R/Makevars
并添加
来实现
CXXFLAGS+=-Wno-ignored-attributes
CXX11FLAGS+=-Wno-ignored-attributes
CXX14FLAGS+=-Wno-ignored-attributes
每次使用 RcppEigen 或 RcppNumerical 时,我都会在控制台中收到一条很长的警告消息。
/home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/src/Core/util/XprHelper.h:170:83: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type {aka __vector(2) double}’ [-Wignored-attributes]
/home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/src/Core/util/XprHelper.h:170:83: warning: ignoring attributes on template argument ‘Eigen::internal::unpacket_traits<__vector(2) double>::half {aka __vector(2) double}’ [-Wignored-attributes]
/home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/src/Core/util/XprHelper.h:188:88: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type {aka __vector(2) double}’ [-Wignored-attributes]
typedef typename find_best_packet_helper<Size,typename packet_traits<T>::type>::type type;
^~~~
In file included from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/Core:430:0,
from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/Eigen/Dense:1,
from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/RcppEigenForward.h:30,
from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include/RcppEigen.h:25,
from /home/Haache/R/x86_64-pc-linux-gnu-library/3.4/RcppNumerical/include/RcppNumerical.h:10,
from PeerCount.cpp:3:
但是,代码运行良好。我为任何代码获取此代码。加载
后会出现警告#include <RcppEigen.h>
或
#include <RcppNumerical.h>
我所有的包都是最新的
正如德克在评论中所说,您可以将 -Wno-ignored-attributes
添加到编译器标志中。您可以通过创建文件 ~/.R/Makevars
并添加
CXXFLAGS+=-Wno-ignored-attributes
CXX11FLAGS+=-Wno-ignored-attributes
CXX14FLAGS+=-Wno-ignored-attributes