modal-inria / MixtComp

Model-based clustering package for mixed data
Other
12 stars 4 forks source link

Issue with new Eigen version #19

Closed Quentin62 closed 2 years ago

Quentin62 commented 2 years ago

Eigen 3.4.0 was released earlier in the year, and I have been asked to update RcppEigen to it. As documented in this issue [1] at its GitHub repo, there are about nine packages that built at CRAN under the previous release, but not with the Eigen 3.4.0 changes in the release candidate package -- which can be installed via

install.packages("RcppEigen", repo="https://RcppCore.github.io/drat")

For RMixtCompIO, I could not work out a minimal change. Something in the multinomial sampler setup makes Eigen 3.4.0 (via the prerelease of RcppEigen in the repo above) unhappy.

It would be terrific if you and the MixtComp team could take a look at this and possibly update the package to work with Eigen 3.4.0 which brings a few new features other R users would like to deploy.

Let me know if you have any question, and please do not hesitate to ask.

Best regards, Dirk

[1] https://github.com/RcppCore/RcppEigen/issues/103

Quentin62 commented 2 years ago
lib/Mixture/Simple/Multinomial/MultinomialSampler.cpp:80:50:   required from here
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:56:30: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type’ {aka ‘__vector(2) double’} [-Wignored-attributes]
In file included from /home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/Core:277,
                 from /home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/Dense:1,
                 from lib/LinAlg/LinAlg.h:28,
                 from lib/Mixture/IMixture.h:27,
                 from lib/Mixture/Simple/Multinomial/MultinomialSampler.cpp:23:
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/CoreEvaluators.h: In instantiation of ‘struct Eigen::internal::evaluator<Eigen::Block<const Eigen::Matrix<double, -1, 1>, -1, -1, false> >’:
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/MapBase.h:115:7:   required from ‘const Scalar& Eigen::MapBase<Derived, 0>::coeff(Eigen::Index) const [with Derived = Eigen::Block<const Eigen::Matrix<double, -1, 1>, -1, -1, false>; Eigen::MapBase<Derived, 0>::Scalar = double; Eigen::Index = long int]’
lib/Mixture/Simple/Multinomial/../../../Data/../Statistic/MultinomialStatistic.h:58:12:   required from ‘int mixt::MultinomialStatistic::sample(const T&) [with T = Eigen::Block<const Eigen::Matrix<double, -1, 1>, -1, -1, false>]’
lib/Mixture/Simple/Multinomial/MultinomialSampler.cpp:60:70:   required from here
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/CoreEvaluators.h:1042:8: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type’ {aka ‘__vector(2) double’} [-Wignored-attributes]
 1042 |   enum {
      |        ^
In file included from /home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/Core:164,
                 from /home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/Dense:1,
                 from lib/LinAlg/LinAlg.h:28,
                 from lib/Mixture/IMixture.h:27,
                 from lib/Mixture/Simple/Multinomial/MultinomialSampler.cpp:23:
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/MapBase.h: In instantiation of ‘const Scalar& Eigen::MapBase<Derived, 0>::coeff(Eigen::Index) const [with Derived = Eigen::Block<const Eigen::Matrix<double, -1, 1>, -1, -1, false>; Eigen::MapBase<Derived, 0>::Scalar = double; Eigen::Index = long int]’:
lib/Mixture/Simple/Multinomial/../../../Data/../Statistic/MultinomialStatistic.h:58:12:   required from ‘int mixt::MultinomialStatistic::sample(const T&) [with T = Eigen::Block<const Eigen::Matrix<double, -1, 1>, -1, -1, false>]’
lib/Mixture/Simple/Multinomial/MultinomialSampler.cpp:60:70:   required from here
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/MapBase.h:15:88: error: static assertion failed: YOU_ARE_TRYING_TO_USE_AN_INDEX_BASED_ACCESSOR_ON_AN_EXPRESSION_THAT_DOES_NOT_SUPPORT_THAT
   15 |       EIGEN_STATIC_ASSERT((int(internal::evaluator<Derived>::Flags) & LinearAccessBit) || Derived::IsVectorAtCompileTime, \
      |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/util/StaticAssert.h:33:54: note: in definition of macro ‘EIGEN_STATIC_ASSERT’
   33 |     #define EIGEN_STATIC_ASSERT(X,MSG) static_assert(X,#MSG);
      |                                                      ^
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/MapBase.h:115:7: note: in expansion of macro ‘EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS’
  115 |       EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/Core:271,
                 from /home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/Dense:1,
                 from lib/LinAlg/LinAlg.h:28,
                 from lib/Mixture/IMixture.h:27,
                 from lib/Mixture/Simple/Multinomial/MultinomialSampler.cpp:23:
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h: In instantiation of ‘Eigen::Index Eigen::internal::first_default_aligned(const Eigen::DenseBase<Derived>&) [with Derived = Eigen::Matrix<double, -1, 1>; Eigen::Index = long int]’:
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/Redux.h:243:63:   required from ‘static Eigen::internal::redux_impl<Func, Evaluator, 3, 0>::Scalar Eigen::internal::redux_impl<Func, Evaluator, 3, 0>::run(const Evaluator&, const Func&, const XprType&) [with XprType = Eigen::Matrix<double, -1, 1>; Func = Eigen::internal::scalar_sum_op<double, double>; Evaluator = Eigen::internal::redux_evaluator<Eigen::Matrix<double, -1, 1> >; Eigen::internal::redux_impl<Func, Evaluator, 3, 0>::Scalar = double]’
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/Redux.h:418:56:   required from ‘typename Eigen::internal::traits<T>::Scalar Eigen::DenseBase<Derived>::redux(const Func&) const [with BinaryOp = Eigen::internal::scalar_sum_op<double, double>; Derived = Eigen::Matrix<double, -1, 1>; typename Eigen::internal::traits<T>::Scalar = double]’
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/Redux.h:463:73:   required from ‘typename Eigen::internal::traits<T>::Scalar Eigen::DenseBase<Derived>::sum() const [with Derived = Eigen::Matrix<double, -1, 1>; typename Eigen::internal::traits<T>::Scalar = double]’
lib/Mixture/Simple/Multinomial/MultinomialSampler.cpp:80:50:   required from here
/home/quentin/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:654:34: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type’ {aka ‘__vector(2) double’} [-Wignored-attributes]
  654 |   return internal::first_aligned<int(unpacket_traits<DefaultPacketType>::alignment),Derived>(m);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [/usr/lib/R/etc/Makeconf:177 : lib/Mixture/Simple/Multinomial/MultinomialSampler.o] Erreur 1