elemental / Elemental

Distributed-memory, arbitrary-precision, dense and sparse-direct linear algebra, conic optimization, and lattice reduction
Other
504 stars 110 forks source link

include/El/lapack-like/decomp.hpp:256:26: note: previous definition is here Int a, Int b, SortType sort=UNSORTED, #3

Closed jeffhammond closed 10 years ago

jeffhammond commented 10 years ago

Did I fail to set something correctly or is this a real bug?

CMake invocation:

Jeffs-MacBook-Air:build-rma jhammond$ cmake .. -DCMAKE_CXX_COMPILER=/opt/mpich/dev/clang/debug/bin/mpicxx -DCMAKE_C_COMPILER=/opt/mpich/dev/clang/debug/bin/mpicc -DCMAKE_Fortran_COMPILER=gfortran -DMATH_LIBS="-framework Accelerate" && make -j2

MPI info:

Jeffs-MacBook-Air:build-rma jhammond$ /opt/mpich/dev/clang/debug/bin/mpicxx -show
clang++ -I/opt/mpich/dev/clang/debug/include -L/opt/mpich/dev/clang/debug/lib -lmpicxx -lmpi -lpmpi -lpthread

Compiler info:

Jeffs-MacBook-Air:build-rma jhammond$ clang++ -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix

Error:

[ 60%] Building CXX object CMakeFiles/El.dir/src/lapack-like/condense/Bidiag.cpp.o
[ 60%] Building CXX object CMakeFiles/El.dir/src/lapack-like/condense/HermitianTridiag.cpp.o
[ 60%] Building CXX object CMakeFiles/El.dir/src/lapack-like/condense/Hessenberg.cpp.o
[ 60%] Building CXX object CMakeFiles/El.dir/src/lapack-like/decomp/HermitianEig.cpp.o
[ 61%] Building CXX object CMakeFiles/El.dir/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp.o
[ 61%] Building CXX object CMakeFiles/El.dir/src/lapack-like/decomp/HermitianTridiagEig.cpp.o
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:120:26: error: redefinition of default
      argument
  Int a, Int b, SortType sort=UNSORTED,
                         ^    ~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:256:26: note: previous definition is here
  Int a, Int b, SortType sort=UNSORTED,
                         ^    ~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:121:35: error: redefinition of default
      argument
  const HermitianEigCtrl<Base<F>> ctrl=HermitianEigCtrl<Base<F>>() )
                                  ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:257:35: note: previous definition is here
  const HermitianEigCtrl<Base<F>> ctrl=HermitianEigCtrl<Base<F>>() );
                                  ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:221:34: error: redefinition of default
      argument
  Base<F> a, Base<F> b, SortType sort=UNSORTED,
                                 ^    ~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:286:34: note: previous definition is here
  Base<F> a, Base<F> b, SortType sort=UNSORTED,
                                 ^    ~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:222:35: error: redefinition of default
      argument
  const HermitianEigCtrl<Base<F>> ctrl=HermitianEigCtrl<Base<F>>() )
                                  ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:287:35: note: previous definition is here
  const HermitianEigCtrl<Base<F>> ctrl=HermitianEigCtrl<Base<F>>() );
                                  ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:240:34: error: redefinition of default
      argument
  Base<F> a, Base<F> b, SortType sort=UNSORTED,
                                 ^    ~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:292:34: note: previous definition is here
  Base<F> a, Base<F> b, SortType sort=UNSORTED,
                                 ^    ~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:241:35: error: redefinition of default
      argument
  const HermitianEigCtrl<Base<F>> ctrl=HermitianEigCtrl<Base<F>>() )
                                  ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:293:35: note: previous definition is here
  const HermitianEigCtrl<Base<F>> ctrl=HermitianEigCtrl<Base<F>>() );
                                  ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:385:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(float)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:336:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:253:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:385:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(float)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:360:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:283:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:385:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(float)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:366:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:289:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:386:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(double)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:336:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:253:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:386:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(double)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:360:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:283:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:386:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(double)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:366:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:289:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:387:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(Complex<float>)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:336:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:253:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:387:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(Complex<float>)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:360:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:283:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:387:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(Complex<float>)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:366:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:289:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:388:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(Complex<double>)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:336:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:253:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:388:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(Complex<double>)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:360:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:283:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:388:1: error: explicit instantiation of
      undefined function template 'HermitianGenDefiniteEig'
PROTO(Complex<double>)
^
/Users/jhammond/Work/ELEMENTAL/git/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp:366:17: note: expanded from macro 'PROTO'
  template void HermitianGenDefiniteEig \
                ^
/Users/jhammond/Work/ELEMENTAL/git/build-rma/include/El/lapack-like/decomp.hpp:289:6: note: explicit instantiation refers here
void HermitianGenDefiniteEig
     ^
18 errors generated.
make[2]: *** [CMakeFiles/El.dir/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
^Cmake[2]: *** [CMakeFiles/El.dir/src/lapack-like/decomp/HermitianTridiagEig.cpp.o] Interrupt: 2
make[1]: *** [CMakeFiles/El.dir/all] Interrupt: 2
make: *** [all] Interrupt: 2
jeffhammond commented 10 years ago

The following changes allow that code to compile but I have no idea if they are correct overall. And more changes are still required to compile the whole library.

Jeffs-MacBook-Air:build jhammond$ cat no-cpp-defaults.patch 
diff --git a/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp b/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp
index c58c629..2c23616 100644
--- a/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp
+++ b/src/lapack-like/decomp/HermitianGenDefiniteEig.cpp
@@ -117,8 +117,8 @@ template<typename F>
 void HermitianGenDefiniteEig
 ( HermitianGenDefiniteEigType type, UpperOrLower uplo, 
   Matrix<F>& A, Matrix<F>& B, Matrix<Base<F>>& w,
-  Int a, Int b, SortType sort=UNSORTED,
-  const HermitianEigCtrl<Base<F>> ctrl=HermitianEigCtrl<Base<F>>() )
+  Int a, Int b, SortType sort,
+  const HermitianEigCtrl<Base<F>> ctrl )
 {
     DEBUG_ONLY(CallStackEntry cse("HermitianGenDefiniteEig"))
     if( A.Height() != A.Width() || B.Height() != B.Width() )
@@ -218,8 +218,8 @@ template<typename F>
 void HermitianGenDefiniteEig
 ( HermitianGenDefiniteEigType type, UpperOrLower uplo, 
   Matrix<F>& A, Matrix<F>& B, Matrix<Base<F>>& w,
-  Base<F> a, Base<F> b, SortType sort=UNSORTED,
-  const HermitianEigCtrl<Base<F>> ctrl=HermitianEigCtrl<Base<F>>() )
+  Base<F> a, Base<F> b, SortType sort,
+  const HermitianEigCtrl<Base<F>> ctrl )
 {
     DEBUG_ONLY(CallStackEntry cse("HermitianGenDefiniteEig"))
     if( A.Height() != A.Width() || B.Height() != B.Width() )
@@ -237,8 +237,8 @@ template<typename F>
 void HermitianGenDefiniteEig
 ( HermitianGenDefiniteEigType type, UpperOrLower uplo, 
   DistMatrix<F>& A, DistMatrix<F>& B, DistMatrix<Base<F>,VR,STAR>& w,
-  Base<F> a, Base<F> b, SortType sort=UNSORTED,
-  const HermitianEigCtrl<Base<F>> ctrl=HermitianEigCtrl<Base<F>>() )
+  Base<F> a, Base<F> b, SortType sort,
+  const HermitianEigCtrl<Base<F>> ctrl )
 {
     DEBUG_ONLY(CallStackEntry cse("HermitianGenDefiniteEig"))
     if( A.Height() != A.Width() || B.Height() != B.Width() )
poulson commented 10 years ago

Good catch! I'm not sure why my compiler hasn't been catching that I defined the default values in both the declaration and definition. I'll commit a fix (essentially identical to yours, modulo switching to ASCENDING by default since it's what most people expect) very soon.

poulson commented 10 years ago

Fixed: https://github.com/elemental/Elemental/commit/4ced5f81915e3b44aa466dfadd7a21064ad69611