Problems compiling the ATC library

Hi,

I downloaded revision 8752 of LAMMPS from the SVN repository, and
promptly set about compiling the libraries. Was unable, however, to
get the "atc" library to compile with Makefile.g++.

It produces the following errors:

g++ -O -g -fPIC -I../../src -DMPICH_IGNORE_CXX_SEEK -c ATC_Transfer.cpp
In file included from MatrixLibrary.h:7:0,
                 from PhysicsModel.h:19,
                 from ATC_Transfer.h:12,
                 from ATC_Transfer.cpp:2:
DiagonalMatrix.h: In instantiation of ‘DiagonalMatrix<T>&
DiagonalMatrix<T>::operator=(T) [with T = double]’:
ATC_Transfer.cpp:994:10: required from here
DiagonalMatrix.h:360:3: error: ‘set_all_elements_to’ was not declared
in this scope, and no declarations were found by argument-dependent
lookup at the point of instantiation [-fpermissive]
DiagonalMatrix.h:360:3: note: declarations in dependent base
‘Matrix<double>’ are not found by unqualified lookup
DiagonalMatrix.h:360:3: note: use ‘this->set_all_elements_to’ instead
make: *** [ATC_Transfer.o] Error 1

Is this something anyone has seen and/or fixed before?

Thanks for any insight,
Camilo

Hi,

I downloaded revision 8752 of LAMMPS from the SVN repository, and
promptly set about compiling the libraries. Was unable, however, to
get the "atc" library to compile with Makefile.g++.

It produces the following errors:

g++ -O -g -fPIC -I../../src -DMPICH_IGNORE_CXX_SEEK -c ATC_Transfer.cpp
In file included from MatrixLibrary.h:7:0,
                 from PhysicsModel.h:19,
                 from ATC_Transfer.h:12,
                 from ATC_Transfer.cpp:2:
DiagonalMatrix.h: In instantiation of ‘DiagonalMatrix<T>&
DiagonalMatrix<T>::operator=(T) [with T = double]’:
ATC_Transfer.cpp:994:10: required from here
DiagonalMatrix.h:360:3: error: ‘set_all_elements_to’ was not declared
in this scope, and no declarations were found by argument-dependent
lookup at the point of instantiation [-fpermissive]
DiagonalMatrix.h:360:3: note: declarations in dependent base
‘Matrix<double>’ are not found by unqualified lookup
DiagonalMatrix.h:360:3: note: use ‘this->set_all_elements_to’ instead
make: *** [ATC_Transfer.o] Error 1

Is this something anyone has seen and/or fixed before?

no, but it is easily fixed. apparently you are using a rather
recent g++ compiler that tightens the compliance to standards
a bit more than only g++ compilers. the "note" right before the
error message describes how to fix it, i.e with the following change.

diff --git a/lib/atc/DiagonalMatrix.h b/lib/atc/DiagonalMatrix.h
index fa8e904..2b290d0 100644
--- a/lib/atc/DiagonalMatrix.h
+++ b/lib/atc/DiagonalMatrix.h
@@ -357,7 +357,7 @@ void DiagonalMatrix<T>::write_restart(FILE *f)
template<typename T>
DiagonalMatrix<T>& DiagonalMatrix<T>::operator=(const T v)
{
- set_all_elements_to(v);
+ this->set_all_elements_to(v);
   return *this;
}
//-----------------------------------------------------------------------------

there is another g++ 4.7.x issue with the file GMRES.h
where the definition of the template functions ApplyPlaneRotation
and GeneratePlaneRotation needs to be moved up in the file
before the definition of the GMRES template function.

cheers,
     axel.

Hi Axel,

Thanks for the help. I modified the code per your suggestion, and
also fixed a few issues with the "mpi.h" location. I am showing
"libatc.a" now.

Camilo