0

I am having issues in compiling *.cpp files in R using Rcpp. As an example, I am using the first full example *.cpp file described in https://github.com/yixuan/RcppNumerical.

However, when I try to source it in R, I get the following list of warnings (which before were not appearing):

    In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/Eigen/Core:397,
                 from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/Eigen/Dense:1,
                 from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/RcppEigenForward.h:30,
                 from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/RcppEigen.h:25,
                 from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppNumerical/include/RcppNumerical.h:10,
                 from integrate_test.cpp:4:
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:60:39: warning: ignoring attributes on template argument ‘__m128’ [-Wignored-attributes]
   60 | template<> struct is_arithmetic<__m128>  { enum { value = true }; };
      |                                       ^
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:61:40: warning: ignoring attributes on template argument ‘__m128i’ [-Wignored-attributes]
   61 | template<> struct is_arithmetic<__m128i> { enum { value = true }; };
      |                                        ^
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:62:40: warning: ignoring attributes on template argument ‘__m128d’ [-Wignored-attributes]
   62 | template<> struct is_arithmetic<__m128d> { enum { value = true }; };
      |                                        ^
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:161:43: warning: ignoring attributes on template argument ‘Eigen::internal::Packet4f’ {aka ‘__m128’} [-Wignored-attributes]
  161 | template<> struct unpacket_traits<Packet4f> { typedef float  type; enum {size=4, alignment=Aligned16}; typedef Packet4f half; };
      |                                           ^
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:162:43: warning: ignoring attributes on template argument ‘Eigen::internal::Packet2d’ {aka ‘__m128d’} [-Wignored-attributes]
  162 | template<> struct unpacket_traits<Packet2d> { typedef double type; enum {size=2, alignment=Aligned16}; typedef Packet2d half; };
      |                                           ^
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:163:43: warning: ignoring attributes on template argument ‘Eigen::internal::Packet4i’ {aka ‘__m128i’} [-Wignored-attributes]
  163 | template<> struct unpacket_traits<Packet4i> { typedef int    type; enum {size=4, alignment=Aligned16}; typedef Packet4i half; };

The warning list is much longer but for readability I decided to include only the first 'few' lines. Any suggestion on how to troubleshoot this?

CafféSospeso
  • 1,101
  • 3
  • 11
  • 28
  • Please check existing questions on the site here. The long lists of warnings from (upstream) Eigen (via `RcppEigen`) and Boost (via `BH`) are known, documented, and something that CRAN Repository Policy _forces_ me to unable / prevents me from suppressing. You suppress them by creating / edting `~/.R/Makevars` and adding `-Wno-ignored-attributes` to the compiler flags. That, too, has been discussed before. – Dirk Eddelbuettel Jun 23 '22 at 18:45
  • Yes, @DirkEddelbuettel sorry for the redundant question. I had not found those existing questions. Sorry again. I solved my problem following https://stackoverflow.com/questions/50544379/warning-in-rcppnumerical-and-rcppeigen-on-ubuntu-18-04 – CafféSospeso Jun 23 '22 at 19:47

0 Answers0