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

Lack of inclusion of <iostream>?

Tags: None
(comma "," separated)
dhlin
Registered Member
Posts
18
Karma
0

Lack of inclusion of <iostream>?

Fri Apr 13, 2012 10:53 pm
I am using the latest checkout from Mercurial.

The following simple code triggers huge amount of compilation errors.

(Compiler: GCC 4.6.2, with -DEIGEN_USE_MKL_ALL )

Code: Select all
// When commented, the compiler will generate huge amount of errors
// complaining that a lot of stuff in std namespace is not found
// When uncommented, it works fine.
// #include <iostream> 


#include <Eigen/Dense>

int main(int argc, char *argv[])
{
    return 0;
}

I guess some standard head files are missing in Eigen?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
I cannot reproduce. Do you experience the same issue without -DEIGEN_USE_MKL_ALL ? In any case, could you paste the first error messages. Thanks.
dhlin
Registered Member
Posts
18
Karma
0
Ok. Below is more detailed information about how to produce the error (I did it again using clang++, which also met with compilation errors)

The version of Eigen that I am using is from directly checked out from Mercurial repo. Here is the info

Code: Select all
changeset:   4600:7b5f0df90228
tag:         tip
user:        Jitse Niesen <jitse@maths.leeds.ac.uk>
date:        Mon Apr 16 13:47:48 2012 +0100
summary:     Remove unused file EigenvaluesCommon.h


Here is the C++ code (very simple, just not to include <iostream>).
The filename is "simple_eigen.cpp"

Code: Select all
#include <Eigen/Dense>

int main(int argc, char *argv[])
{
    return 0;
}


Here is how I compile it

Code: Select all
clang++ -isystem  /Users/dhlin/works/eigen -O3 -isystem /opt/intel/mkl/include -DEIGEN_USE_MKL_ALL simple_eigen.cpp -o simple_eigen



Here is the error messages (produced by clang++, ver 3.0). Note: if MKL is not turned on, then everything works fine.

Code: Select all
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:365:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:154:1: error: no member named
      'cout' in namespace 'std'; did you mean 'count'?
EIGEN_MKL_TRMV_CM(double, double, d, d)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:126:12: note: instantiated from:
      std::cout << "TRMV: CM\n";\
      ~~~~~^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:155:1: error: no member named
      'cout' in namespace 'std'; did you mean 'count'?
EIGEN_MKL_TRMV_CM(dcomplex, MKL_Complex16, cd, z)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:126:12: note: instantiated from:
      std::cout << "TRMV: CM\n";\
      ~~~~~^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:156:1: error: no member named
      'cout' in namespace 'std'; did you mean 'count'?
EIGEN_MKL_TRMV_CM(float, float, f, s)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:126:12: note: instantiated from:
      std::cout << "TRMV: CM\n";\
      ~~~~~^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:157:1: error: no member named
      'cout' in namespace 'std'; did you mean 'count'?
EIGEN_MKL_TRMV_CM(scomplex, MKL_Complex8, cf, c)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:126:12: note: instantiated from:
      std::cout << "TRMV: CM\n";\
      ~~~~~^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:240:1: error: no member named
      'cout' in namespace 'std'; did you mean 'count'?
EIGEN_MKL_TRMV_RM(double, double, d, d)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:212:12: note: instantiated from:
      std::cout << "TRMV: RM\n";\
      ~~~~~^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:241:1: error: no member named
      'cout' in namespace 'std'; did you mean 'count'?
EIGEN_MKL_TRMV_RM(dcomplex, MKL_Complex16, cd, z)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:212:12: note: instantiated from:
      std::cout << "TRMV: RM\n";\
      ~~~~~^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:242:1: error: no member named
      'cout' in namespace 'std'; did you mean 'count'?
EIGEN_MKL_TRMV_RM(float, float, f, s)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:212:12: note: instantiated from:
      std::cout << "TRMV: RM\n";\
      ~~~~~^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:243:1: error: no member named
      'cout' in namespace 'std'; did you mean 'count'?
EIGEN_MKL_TRMV_RM(scomplex, MKL_Complex8, cf, c)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularMatrixVector_MKL.h:212:12: note: instantiated from:
      std::cout << "TRMV: RM\n";\
      ~~~~~^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:87:1: error: no template named
      'triangular_solve_matrix'; did you mean 'Eigen::internal::triangular_solve_matrix'?
EIGEN_MKL_TRSM_L(double, double, d)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:41:8: note: instantiated from:
struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
       ^
/Users/dhlin/works/eigen/Eigen/src/Core/SolveTriangular.h:38:8: note:
      'Eigen::internal::triangular_solve_matrix' declared here
struct triangular_solve_matrix;
       ^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:87:1: error: use of undeclared
      identifier 'OnTheLeft'; did you mean 'Eigen::OnTheLeft'?
EIGEN_MKL_TRSM_L(double, double, d)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:41:46: note: instantiated from:
struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
                                             ^
/Users/dhlin/works/eigen/Eigen/src/Core/util/Constants.h:285:3: note: 'Eigen::OnTheLeft' declared here
  OnTheLeft = 1, 
  ^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:87:1: error: use of undeclared
      identifier 'ColMajor'; did you mean 'Eigen::ColMajor'?
EIGEN_MKL_TRSM_L(double, double, d)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:41:87: note: instantiated from:
struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
                                                                                      ^
/Users/dhlin/works/eigen/Eigen/src/Core/util/Constants.h:272:3: note: 'Eigen::ColMajor' declared here
  ColMajor = 0,
  ^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:87:1: error: class template
      partial specialization of 'triangular_solve_matrix' must originally be declared in namespace 'internal'
EIGEN_MKL_TRSM_L(double, double, d)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:41:8: note: instantiated from:
struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
       ^
/Users/dhlin/works/eigen/Eigen/src/Core/SolveTriangular.h:38:8: note: explicitly specialized declaration is
      here
struct triangular_solve_matrix;
       ^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:87:1: error: cannot refer to
      class template 'Conjugate' without a template argument list
EIGEN_MKL_TRSM_L(double, double, d)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:47:45: note: instantiated from:
    conjA = ((TriStorageOrder==ColMajor) && Conjugate) ? 1 : 0 \
                                            ^
/Users/dhlin/works/eigen/Eigen/src/Core/util/ForwardDeclarations.h:101:37: note: template is declared here
template<typename MatrixType> class Conjugate;
                                    ^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:87:1: error: cannot refer to
      class template 'Conjugate' without a template argument list
EIGEN_MKL_TRSM_L(double, double, d)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:64:45: note: instantiated from:
   transa = (TriStorageOrder==RowMajor) ? ((Conjugate) ? 'C' : 'T') : 'N'; \
                                            ^
/Users/dhlin/works/eigen/Eigen/src/Core/util/ForwardDeclarations.h:101:37: note: template is declared here
template<typename MatrixType> class Conjugate;
                                    ^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:88:1: error: no template named
      'triangular_solve_matrix'; did you mean 'Eigen::internal::triangular_solve_matrix'?
EIGEN_MKL_TRSM_L(dcomplex, MKL_Complex16, z)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:41:8: note: instantiated from:
struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
       ^
/Users/dhlin/works/eigen/Eigen/src/Core/SolveTriangular.h:38:8: note:
      'Eigen::internal::triangular_solve_matrix' declared here
struct triangular_solve_matrix;
       ^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:88:1: error: use of undeclared
      identifier 'dcomplex'; did you mean 'Eigen::dcomplex'?
EIGEN_MKL_TRSM_L(dcomplex, MKL_Complex16, z)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:41:32: note: instantiated from:
struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
                               ^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:88:18: note: instantiated from:
EIGEN_MKL_TRSM_L(dcomplex, MKL_Complex16, z)
                 ^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:89:1: error: no template named
      'triangular_solve_matrix'; did you mean 'Eigen::internal::triangular_solve_matrix'?
EIGEN_MKL_TRSM_L(float, float, s)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:41:8: note: instantiated from:
struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
       ^
/Users/dhlin/works/eigen/Eigen/src/Core/SolveTriangular.h:38:8: note:
      'Eigen::internal::triangular_solve_matrix' declared here
struct triangular_solve_matrix;
       ^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:89:1: error: use of undeclared
      identifier 'OnTheLeft'; did you mean 'Eigen::OnTheLeft'?
EIGEN_MKL_TRSM_L(float, float, s)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:41:46: note: instantiated from:
struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
                                             ^
/Users/dhlin/works/eigen/Eigen/src/Core/util/Constants.h:285:3: note: 'Eigen::OnTheLeft' declared here
  OnTheLeft = 1, 
  ^
In file included from simple_eigen.cpp:3:
In file included from /Users/dhlin/works/eigen/Eigen/Dense:1:
In file included from /Users/dhlin/works/eigen/Eigen/Core:366:
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:89:1: error: use of undeclared
      identifier 'ColMajor'; did you mean 'Eigen::ColMajor'?
EIGEN_MKL_TRSM_L(float, float, s)
^
/Users/dhlin/works/eigen/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h:41:87: note: instantiated from:
struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
                                                                                      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.


There can be more errors (clang stop after it found 20). Similar things can be produced with g++.

Hope the information helps.
dhlin
Registered Member
Posts
18
Karma
0
I tried to trace the error:

In current version (with changeset: 4600:7b5f0df90228), I found the following statement (line 126 @ TriangularMatrixVector_MKL.h)
Code: Select all
std::cout << "TRMV: CM\n";


This statement is part of the macro definition of EIGEN_MKL_TRMV_CM. It seems that such a macro is used to generate a long function.

Then from line 154 to line 157, this macro is used to actually generate several functions, respectively for double/float/dcomplex/scomplex.

So when there functions are called, the printing statement will inevitably executed, which I believe is not a desired effect.

There are other such statements in the MKL-related codes, which, I believe, are just for debug purpose and should be commented out once the debugging is done.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
thanks, I did not see them when reviewing the MKL code. (fixed in the devel branch)


Bookmarks



Who is online

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