Compilation error on `develop` branch.

Issue #1 resolved
Masahiro Fujita created an issue

I have tried to compile develop branch but got the following compilation error related to Eigen.

OS: Ubuntu 16.04 Compiler: clang 4.0 and gcc 5.4.

In file included from /home/syoyo/work/hdrview/src/hdrimageio.cpp:4:
In file included from /home/syoyo/work/hdrview/src/hdrimage.h:8:
In file included from /home/syoyo/work/hdrview/ext/nanogui/ext/eigen/Eigen/Core:310:
/home/syoyo/work/hdrview/ext/nanogui/ext/eigen/Eigen/src/Core/DiagonalMatrix.h:261:57: error: no viable conversion from returned
      value of type 'const Eigen::Matrix<float, 3, 1, 0, 3, 1>' to function return type 'const DiagonalVectorType' (aka 'const
      Eigen::CoeffBasedProduct<Eigen::Matrix<float, 3, 3, 0, 3, 3>, const Eigen::Matrix<float, 3, 1, 0, 3, 1> &, 6>')
    const DiagonalVectorType& diagonal() const { return m_diagonal; }
                                                        ^~~~~~~~~~
/home/syoyo/work/hdrview/ext/nanogui/ext/eigen/Eigen/src/Core/DiagonalMatrix.h:53:74: note: in instantiation of member function
      'Eigen::DiagonalWrapper<const Eigen::CoeffBasedProduct<Eigen::Matrix<float, 3, 3, 0, 3, 3>, const Eigen::Matrix<float, 3, 1,
      0, 3, 1> &, 6> >::diagonal' requested here
    inline const DiagonalVectorType& diagonal() const { return derived().diagonal(); }
                                                                         ^
/home/syoyo/work/hdrview/ext/nanogui/ext/eigen/Eigen/src/Core/DiagonalMatrix.h:71:14: note: in instantiation of member function
      'Eigen::DiagonalBase<Eigen::DiagonalWrapper<const Eigen::CoeffBasedProduct<Eigen::Matrix<float, 3, 3, 0, 3, 3>, const
      Eigen::Matrix<float, 3, 1, 0, 3, 1> &, 6> > >::diagonal' requested here
      return diagonal().cwiseInverse();
             ^
/home/syoyo/work/hdrview/src/hdrimageio.cpp:540:44: note: in instantiation of member function
      'Eigen::DiagonalBase<Eigen::DiagonalWrapper<const Eigen::CoeffBasedProduct<Eigen::Matrix<float, 3, 3, 0, 3, 3>, const
      Eigen::Matrix<float, 3, 1, 0, 3, 1> &, 6> > >::inverse' requested here
                auto D = (ReferenceNeutral.asDiagonal()).inverse();
                                                         ^
/home/syoyo/work/hdrview/ext/nanogui/ext/eigen/Eigen/src/Core/products/CoeffBasedProduct.h:144:12: note: candidate constructor not
      viable: no known conversion from 'const Eigen::Matrix<float, 3, 1, 0, 3, 1>' to 'const
      Eigen::CoeffBasedProduct<Eigen::Matrix<float, 3, 3, 0, 3, 3>, const Eigen::Matrix<float, 3, 1, 0, 3, 1> &, 6> &' for 1st
      argument
    inline CoeffBasedProduct(const CoeffBasedProduct& other)
           ^
1 error generated.

Guess we may need to rewrite

                auto ReferenceNeutral = (AB * CC).inverse() * CameraNeutral;
                auto D = (ReferenceNeutral.asDiagonal()).inverse();

to

    auto ReferenceNeutral = (AB * CC).inverse() * CameraNeutral.asDiagonal();
    auto D = ReferenceNeutral.inverse();

Comments (3)

  1. Wojciech Jarosz repo owner

    I just made a slightly different change. I'm guessing that it's an instance of the compiler not quite knowing what the return type should be, so I changed ReferenceNeutral explicitly to a Vector3f. Can you check if this works now?

  2. Log in to comment