This forum has been archived. All content is frozen. Please use KDE Discuss instead.

compile error Eigen/Core/Diagonal.h with Intel Compiler 15.

Tags: None
(comma "," separated)
chrisrock
Registered Member
Posts
4
Karma
0
Hi everyone,
I try to compile the code of my small Raytracing project (which uses Eigen library) using the Intel Compiler 15.0. Unfortunately I'm facing some issues during the compilation process. Wondering if anybody has any experience with this and can help me. Thanks :)

VS2010(x64)
1> MessageBuildingWithCompiler:
1> Building with Intel(R) C++ Compiler XE 15.0
1>ClCompile:
1> ***** ClCompile (x64 - Intel C++)
1> circle.cpp
1> cylinder.cpp
1>D:\libraries\eigen_3_2_2\Eigen/src/Core/Diagonal.h(194): error : no instance of overloaded function "Eigen::MatrixBase<Derived>::diagonal" matches the specified type
1> MatrixBase<Derived>::diagonal(Index index)
1> ^
1>
1>D:\libraries\eigen_3_2_2\Eigen/src/Core/Diagonal.h(202): error : no instance of overloaded function "Eigen::MatrixBase<Derived>::diagonal" matches the specified type
1> MatrixBase<Derived>::diagonal(Index index) const
1> ^
1>
1>D:\libraries\eigen_3_2_2\Eigen/src/Core/Replicate.h(154): error : no instance of overloaded function "Eigen::DenseBase<Derived>::replicate" matches the specified type
1> DenseBase<Derived>::replicate(Index rowFactor,Index colFactor) const
1> ^
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
What about replacing line 229 of Eigen/src/Core/MatrixBase.h to:

#if (defined _MSC_VER) && (_MSC_VER >= 1500) && !defined(__INTEL_COMPILER) // 2008 or later

??
chrisrock
Registered Member
Posts
4
Karma
0
No :( Same error as before.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
leung
Registered Member
Posts
3
Karma
0
Hi, have you solved this problem? I met the same problem as yours.
leung
Registered Member
Posts
3
Karma
0
ggael wrote:ok, please update to the latest 3.2 branch (https://bitbucket.org/eigen/eigen/get/3.2.tar.gz) or devel branch. I don't see how it could still fail now.

https://bitbucket.org/eigen/eigen/commits/e8aee247f42a/
https://bitbucket.org/eigen/eigen/commits/cb242c9d9761/


Hi, I met the following errors, do you know how to solve it? Thanks in advance!

I have tried the steps you mentioned and errors reduced to one after I updated to the latest 3.2 branch as you recommended. The last one is as below:

1> Building with Intel(R) C++ Compiler XE 15.0
1>ClCompile:
1> ***** ClCompile (x64 - Intel C++)
1>C:\demo\.\third_party/Eigen/src/Core/Replicate.h(154): error : no instance of overloaded function "Eigen::DenseBase<Derived>::replicate" matches the specified type
1> DenseBase<Derived>::replicate(Index rowFactor,Index colFactor) const
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Very strange, as there is really nothing tricky here. Nevertheless, what about the following patch (I don't have ICC 15 to test it, only ICC 14 which does not trigger the issue).
Code: Select all
diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h
--- a/Eigen/src/Core/DenseBase.h
+++ b/Eigen/src/Core/DenseBase.h
@@ -458,17 +458,18 @@ template<typename Derived> class DenseBa
     template<typename ElseDerived>
     inline const Select<Derived, typename ElseDerived::ConstantReturnType, ElseDerived >
     select(const typename ElseDerived::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
 
     template<int p> RealScalar lpNorm() const;
 
     template<int RowFactor, int ColFactor>
     const Replicate<Derived,RowFactor,ColFactor> replicate() const;
-    const Replicate<Derived,Dynamic,Dynamic> replicate(Index rowFacor,Index colFactor) const;
+    typedef Replicate<Derived,Dynamic,Dynamic> ReplicateReturnType;
+    const ReplicateReturnType replicate(Index rowFacor,Index colFactor) const;
 
     typedef Reverse<Derived, BothDirections> ReverseReturnType;
     typedef const Reverse<const Derived, BothDirections> ConstReverseReturnType;
     ReverseReturnType reverse();
     ConstReverseReturnType reverse() const;
     void reverseInPlace();
 
 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
diff --git a/Eigen/src/Core/Replicate.h b/Eigen/src/Core/Replicate.h
--- a/Eigen/src/Core/Replicate.h
+++ b/Eigen/src/Core/Replicate.h
@@ -145,17 +145,17 @@ DenseBase<Derived>::replicate() const
   * \return an expression of the replication of \c *this
   *
   * Example: \include MatrixBase_replicate_int_int.cpp
   * Output: \verbinclude MatrixBase_replicate_int_int.out
   *
   * \sa VectorwiseOp::replicate(), DenseBase::replicate<int,int>(), class Replicate
   */
 template<typename Derived>
-inline const Replicate<Derived,Dynamic,Dynamic>
+inline const typename DenseBase<Derived>::ReplicateReturnType
 DenseBase<Derived>::replicate(Index rowFactor,Index colFactor) const
 {
   return Replicate<Derived,Dynamic,Dynamic>(derived(),rowFactor,colFactor);
 }
 
 /**
   * \return an expression of the replication of each column (or row) of \c *this
   *
leung
Registered Member
Posts
3
Karma
0
ggael wrote:Very strange, as there is really nothing tricky here. Nevertheless, what about the following patch (I don't have ICC 15 to test it, only ICC 14 which does not trigger the issue).
Code: Select all
diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h
--- a/Eigen/src/Core/DenseBase.h
+++ b/Eigen/src/Core/DenseBase.h
@@ -458,17 +458,18 @@ template<typename Derived> class DenseBa
     template<typename ElseDerived>
     inline const Select<Derived, typename ElseDerived::ConstantReturnType, ElseDerived >
     select(const typename ElseDerived::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
 
     template<int p> RealScalar lpNorm() const;
 
     template<int RowFactor, int ColFactor>
     const Replicate<Derived,RowFactor,ColFactor> replicate() const;
-    const Replicate<Derived,Dynamic,Dynamic> replicate(Index rowFacor,Index colFactor) const;
+    typedef Replicate<Derived,Dynamic,Dynamic> ReplicateReturnType;
+    const ReplicateReturnType replicate(Index rowFacor,Index colFactor) const;
 
     typedef Reverse<Derived, BothDirections> ReverseReturnType;
     typedef const Reverse<const Derived, BothDirections> ConstReverseReturnType;
     ReverseReturnType reverse();
     ConstReverseReturnType reverse() const;
     void reverseInPlace();
 
 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
diff --git a/Eigen/src/Core/Replicate.h b/Eigen/src/Core/Replicate.h
--- a/Eigen/src/Core/Replicate.h
+++ b/Eigen/src/Core/Replicate.h
@@ -145,17 +145,17 @@ DenseBase<Derived>::replicate() const
   * \return an expression of the replication of \c *this
   *
   * Example: \include MatrixBase_replicate_int_int.cpp
   * Output: \verbinclude MatrixBase_replicate_int_int.out
   *
   * \sa VectorwiseOp::replicate(), DenseBase::replicate<int,int>(), class Replicate
   */
 template<typename Derived>
-inline const Replicate<Derived,Dynamic,Dynamic>
+inline const typename DenseBase<Derived>::ReplicateReturnType
 DenseBase<Derived>::replicate(Index rowFactor,Index colFactor) const
 {
   return Replicate<Derived,Dynamic,Dynamic>(derived(),rowFactor,colFactor);
 }
 
 /**
   * \return an expression of the replication of each column (or row) of \c *this
   *


The problem still exists. I have put a demo project file with the below link, I would appreciate it if you can take a look at it and see wha's going on. Thanks!

I used ICC15 on 64-bit Windows system.

Click the project in the Solution Explorer. Select the menu Project -> Property -> Configuration Properties -> C/C++ -> Language [Intel C++]
Set OpenMP Support to "Generate Parallel Code (/Qopenmp)" and Build solution you will see the errors right there.

Sample project
https://www.dropbox.com/s/pmpj7twq1avsg ... al.7z?dl=0
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
I cannot test your MSVC solution as I don't have windows machine. Nevertheless, I tried Eigen's unit tests with ICC 15.0.1 20141022, and I cannot reproduce the issue.
adowsey
Registered Member
Posts
1
Karma
0
I was getting similar errors to these using Intel Compiler 15.0 on Visual Studio 2012, which were solved by moving to Eigen 3.2.3.

However, my program still doesn't compile because there is one error remaining:

Code: Select all
2>C:\r\seamass-windeps\src\eigen-3.2.3\Eigen/src/SparseCore/SparseBlock.h(358): error : no instance of overloaded function "Eigen::SparseMatrixBase<Derived>::innerVectors" matches the specified type
2>    Block<Derived,Dynamic,Dynamic,true> SparseMatrixBase<Derived>::innerVectors(Index outerStart, Index outerSize)
2>                                                                   ^
2> 
2>C:\r\seamass-windeps\src\eigen-3.2.3\Eigen/src/SparseCore/SparseBlock.h(370): error : no instance of overloaded function "Eigen::SparseMatrixBase<Derived>::innerVectors" matches the specified type
2>    const Block<const Derived,Dynamic,Dynamic,true> SparseMatrixBase<Derived>::innerVectors(Index outerStart, Index outerSize) const
2>                                                                               ^


I would be very grateful if anyone knew how to solve this?

Kind regards,
Andy
klainer
Registered Member
Posts
1
Karma
0
I think I found out how to fix this.
Replace the declaration and the definition of the two innerVectors function like the following:

In SparseMatrixBase.h line 407
Code: Select all
typedef Block<Derived,Dynamic,Dynamic,true>       InnerVectorsReturnType;
typedef Block<const Derived,Dynamic,Dynamic,true> ConstInnerVectorsReturnType;
InnerVectorsReturnType innerVectors(Index outerStart,Index outerSize);
const ConstInnerVectorsReturnType innerVectors(Index outerStart,Index outerSize) const;


In SparseBlock.h line 357
Code: Select all
 template<typename Derived>
typename SparseMatrixBase<Derived>::InnerVectorsReturnType SparseMatrixBase<Derived>::innerVectors(Index outerStart, Index outerSize)
{
  return Block<Derived,Dynamic,Dynamic,true>(derived(),
                                             IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
                                             IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
 
}

template<typename Derived>
const typename SparseMatrixBase<Derived>::ConstInnerVectorsReturnType SparseMatrixBase<Derived>::innerVectors(Index outerStart, Index outerSize) const
{
  return Block<const Derived,Dynamic,Dynamic,true>(derived(),
                                                  IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
                                                  IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
 
}

Hope this helps!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Such a change has been applied a few hours before your post! (http://eigen.tuxfamily.org/bz/show_bug.cgi?id=957)

I'm glad to see it does the job.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]