New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 923 - Compilation failure due to missing assign_impl when building with MKL
Summary: Compilation failure due to missing assign_impl when building with MKL
Alias: None
Product: Eigen
Classification: Unclassified
Component: Interoperability (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Compilation Problem
Assignee: Nobody
: 1015 (view as bug list)
Depends on:
Blocks: 3.3
  Show dependency treegraph
Reported: 2014-12-22 18:59 UTC by Kevin locke
Modified: 2015-07-22 12:40 UTC (History)
5 users (show)


Description Kevin locke 2014-12-22 18:59:05 UTC
When using the current development version of Eigen from the default branch on Bitbucket (83b91d08), compiling the following program:

#include <Eigen/Core>

int main(void)
    return 0;

With `g++ -I$EIGEN -I$MKLROOT/include -c eigenbug.cpp` results in several errors, the first of which are:

eigen/Eigen/src/Core/Assign_MKL.h:79:16: error: expected template-name before ‘<’ token
   : assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>,Traversal,Unrolling,BuiltIn>
eigen/Eigen/src/Core/Assign_MKL.h:79:16: error: expected ‘{’ before ‘<’ token
eigen/Eigen/src/Core/Assign_MKL.h:79:16: error: expected unqualified-id before ‘<’ token
eigen/Eigen/src/Core/Assign_MKL.h:118:10: error: ‘assign_impl’ is not a class template
   struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
eigen/Eigen/src/Core/Assign_MKL.h:124:1: note: in expansion of macro ‘EIGEN_MKL_VML_SPECIALIZE_ASSIGN’
eigen/Eigen/src/Core/Assign_MKL.h:118:105: error: wrong number of template arguments (5, should be 3)
   struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
eigen/Eigen/src/Core/Assign_MKL.h:125:1: note: in expansion of macro ‘EIGEN_MKL_VML_SPECIALIZE_ASSIGN’

The issue first appeared in changeset e4505314, although that change obviously exposed the issue rather than introducing it.  From the other instances of assign_impl being removed in changeset 0a4228bd, it appears that this may be mostly (all?) dead code.  Removing the content from Assign_MKL.h appears to fix compilation, but I am unsure if it introduces a performance issue by removing the calls to MKL and if these calls may need to be moved elsewhere.

Any advice about either short and long term fixes would be appreciated.

Comment 1 Christoph Hertzberg 2014-12-23 04:15:14 UTC
Unfortunately, MKL is barely tested. Very likely it was never fully ported to the new evaluator design.

To find the problem, first you could add this to beginning of your test program:


and bisect which is the first failing version. Perhaps from that you can figure out how to fix it, otherwise hopefully Gael can have a look at it.

Generally, it would be very appreciated, if the test suite was run with MKL activated more regularly. See here on how to do that:

You can also test the latest stable version (3.2.3 at the moment)
Comment 2 Kevin locke 2015-01-02 18:47:18 UTC
Hi Cristoph,

Sorry for the slow reply, I missed your response because the mail server used by Bugzilla ( is blacklisted by the Barracuda RBL <>, which is used by my mail server.

Bisecting with "#define EIGEN_TEST_EVALUATORS" added to the test program shows that the error was introduced in 1b9b24c4ace8.  However, the preceeding commit (ab2f3cc049c1) shows a different error which may be covering the error I was looking for, the last of which was:

In file included from ./Eigen/Core:386:0,
                 from eigentest.cpp:3:
./Eigen/src/Core/products/TriangularMatrixVector.h:216:8: error: ‘triangular_product_impl’ is not a class template
 struct triangular_product_impl<Mode,true,Lhs,false,Rhs,true>
./Eigen/src/Core/products/TriangularMatrixVector.h:227:61: error: wrong number of template arguments (6, should be 3)
 struct triangular_product_impl<Mode,false,Lhs,true,Rhs,false>
./Eigen/src/Core/products/TriangularMatrixVector.h:216:60: error: provided for ‘template<int Mode, class Lhs, class Rhs> struct Eigen::internal::triangular_product_impl’
 struct triangular_product_impl<Mode,true,Lhs,false,Rhs,true>

It appears that there were different errors preceding this one as well.  If it would be helpful to determine the history of when each error was introduced, let me know and I'll work it out.  But, as you say, it looks like software rot in the MKL codepaths and just need some love from someone familiar with MKL and the new evaluator design.

Eigen 3.2.3 compiles correctly.  Unfortunately, for our use case we need AVX which is not available in 3.2.3 (in my understanding).

I'll see about running the test suite more regularly with MKL to help catch these issues as they appear.  Thanks for pointing that out!
Comment 3 Gael Guennebaud 2015-06-23 09:08:07 UTC
*** Bug 1015 has been marked as a duplicate of this bug. ***
Comment 4 Gael Guennebaud 2015-06-23 11:12:44 UTC
Summary:     Bug 923: fix EIGEN_USE_BLAS mode

Support for VML coming soon...
Comment 5 Gael Guennebaud 2015-07-22 12:40:35 UTC
Forgot to update this entry:

Note You need to log in before you can comment on or make changes to this bug.