[Trilinos-Users] Two compilation problems with
MultiLevelPreconditioner
James Willenbring
jmwille at sandia.gov
Thu Nov 29 08:36:26 MST 2007
Ernesto,
Did you use -DHAVE_CONFIG_H? It looks like you might not have. We are
currently looking at lifting the requirement of defining HAVE_CONFIG_H,
but for now, that may help you avoid these problems.
Jim
On Wed, 2007-11-28 at 21:58 -0800, Ernesto Prudencio wrote:
> Hi. In a include file of mine, called trilinos.hpp, I have:
>
> // BEGIN FILE trilinos.hpp
>
> #include <Epetra_MpiComm.h>
> #include <Epetra_Map.h>
> #include <Epetra_Vector.h>
> #include <Epetra_CrsMatrix.h>
> #include <AztecOO.h> // line 14
> #include <ml_include.h>
> #include <ml_MultiLevelOperator.h>
> #include <Teuchos_ParameterList.hpp> // line 17
> #include <ml_MultiLevelPreconditioner.h>
> #include <ml_epetra_utils.h>
> ...
>
> class trilinos {
> ...
> private:
> Epetra_MpiComm* m_commForTrilinos;
> Epetra_Map* m_mapForTrilinos;
> Epetra_CrsMatrix* m_matrixForTrilinos;
> Epetra_LinearProblem* m_problemForTrilinos;
> AztecOO* m_solverForTrilinos;
> Epetra_Vector* m_rhsForTrilinos;
> Epetra_Vector* m_dofsForTrilinos;
> ML* m_mlHandle;
> ML_Aggregate* m_mlAggObject;
> ML_Epetra::MultiLevelOperator* m_mlOperator;
> Teuchos::ParameterList* m_mlList;
> ML_Epetra::MultiLevelPreconditioner* m_mlPreconditioner; // line 66
> int m_nLevels;
> ...
> }
>
> // END FILE trilinos.hpp
>
> --> Compilation problem 1: duplicated defines
>
> In file included from <installation>/include/Teuchos_ConfigDefs.hpp:77,
> from <installation>/include/Teuchos_ParameterListExceptions.hpp:33,
> from <installation>/include/Teuchos_ParameterList.hpp:37,
> from trilinos.hpp:17,
> from NML_ITLLinearSolver.C:13:
> <installation>/include/Teuchos_config.h:14:1: warning: "F77_FUNC" redefined
> In file included from <installation>/include/az_aztec.h:61,
> from <installation>/include/AztecOO.h:44,
> from trilinos.hpp:14,
> from NML_ITLLinearSolver.C:13:
> <installation>/include/az_f77func.h:99:1: warning: this is the location of
> the previous definition
>
> In file included from <installation>/include/Teuchos_ConfigDefs.hpp:77,
> from <installation>/include/Teuchos_ParameterListExceptions.hpp:33,
> from <installation>/include/Teuchos_ParameterList.hpp:37,
> from trilinos.hpp:17,
> from NML_ITLLinearSolver.C:13:
> <installation>/include/Teuchos_config.h:19:1: warning: "F77_FUNC_" redefined
> In file included from <installation>/include/az_aztec.h:61,
> from <installation>/include/AztecOO.h:44,
> from trilinos.hpp:14,
> from NML_ITLLinearSolver.C:13:
> <installation>/include/az_f77func.h:103:1: warning: this is the location
> of the previous definition
>
> --> How I "solved" compilation problem 1: put ifndef-endif pair around
> both defines in Teuchos_config.h
>
> --> Compilation problem 2:
>
> trilinos.hpp:66: error: ISO C++ forbids declaration of
> 'MultiLevelPreconditioner' with no type
> trilinos.hpp:66: error: invalid use of '::'
> trilinos.hpp:66: error: expected ';' before '*' token
>
> --> How I "solved" compilation problem 2: included ml_config.h in
> <installation>/include/ml_MultiLevelPreconditioner.h, so that "#if
> defined(HAVE_ML_EPETRA) && defined(HAVE_ML_TEUCHOS)" would work properly.
> However, such correction caused extra redefinition problems like in
> problem 1, "solved" again with ifndef-endif pairs.
>
> --> Once the compilation problems were solved, linking phase worked with
> libraries "-laztecoo -lml -lifpack -lepetra -lteuchos -lepetraext". And
> the executable worked properly as well.
>
> ///////////////// Question ////////////////////
>
> --> Any ideas if this is a problem of the library or a problem of my
> specific installation?
>
> My script for configuration reads like this:
>
> export CC=/usr/bin/mpicc
> export CXX=/usr/bin/mpiCC
> ./configure --prefix=$HOME/Desktop/trilinos-8.0.3/installation
> --enable-mpi --enable-epetra -enable-teuchos --enable-aztecoo --enable-ml
> --enable-didasko
>
> Thanks in advance,
>
> Ernesto.
>
>
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
More information about the Trilinos-Users
mailing list