[Trilinos-Users] Python-related compiler warning

Bill Spotz wfspotz at sandia.gov
Thu Jun 16 08:20:47 MDT 2011


Dustin,

I have a fix for you.  This is one of the rare areas where PyTrilinos pushes outward and affects other packages.  We can improve this, however, to be less intrusive and less fragile.  In the file

  packages/epetraext/src/model_evaluator/EpetraExt_ModelEvaluator.h

look for the code

  #ifdef HAVE_PYTRILINOS
  #undef HAVE_INTTYPES_H
  #undef HAVE_STDINT_H
  #undef HAVE_SYS_TIME_H
  #include "Python.h"
  #endif

and change it to

  #ifdef HAVE_PYTRILINOS
  #ifndef PyObject_HEAD
  struct _object;
  typedef _object PyObject;
  #endif
  #endif

This change will be in the next release.

-Bill

On Jun 15, 2011, at 3:20 PM, Dustin Langewisch wrote:

> Hi all, I'm new to Trilinos, and just recently was able to get it installed correctly (or so I think). But when I try to compile the twoD_diffusion_galerkin_example.cpp included with the Stokhos package, my compiler spits out the warning given below. Everything compiles, and as far as I can tell everything is working correctly, but the warning is very annoying and occasionally distracts from actual compilation issues. Does anyone know how I can fix this issue, or at least how I can make my compiler stop issuing the warning? 
> 
> I believe it is Stokhos-related since I haven't seen the message for other non-Stokhos examples that I've compiled. Also, PyTrilinos seems to be working, so I don't think it's a python thing despite the various references to python in the warning. 
> 
> In file included from /usr/include/python2.6/Python.h:8,
>                  from /home/dustin/solvers/Trilinos/mpi/include/EpetraExt_ModelEvaluator.h:43,
>                  from /home/dustin/solvers/Trilinos/mpi/include/Stokhos_SGModelEvaluator.hpp:36,
>                  from /home/dustin/solvers/Trilinos/mpi/include/Stokhos.hpp:77,
>                  from twoD_diffusion_galerkin_example.cpp:54:
> /usr/include/python2.6/pyconfig.h:1031:1: warning: "_POSIX_C_SOURCE" redefined
> In file included from /usr/include/c++/4.4/x86_64-linux-gnu/bits/os_defines.h:39,
>                  from /usr/include/c++/4.4/x86_64-linux-gnu/bits/c++config.h:243,
>                  from /usr/include/c++/4.4/iostream:39,
>                  from twoD_diffusion_galerkin_example.cpp:49:
> /usr/include/features.h:158:1: warning: this is the location of the previous definition
> In file included from /usr/include/python2.6/Python.h:8,
>                  from /home/dustin/solvers/Trilinos/mpi/include/EpetraExt_ModelEvaluator.h:43,
>                  from /home/dustin/solvers/Trilinos/mpi/include/Stokhos_SGModelEvaluator.hpp:36,
>                  from /home/dustin/solvers/Trilinos/mpi/include/Stokhos.hpp:77,
>                  from twoD_diffusion_galerkin_example.cpp:54:
> /usr/include/python2.6/pyconfig.h:1040:1: warning: "_XOPEN_SOURCE" redefined
> In file included from /usr/include/c++/4.4/x86_64-linux-gnu/bits/os_defines.h:39,
>                  from /usr/include/c++/4.4/x86_64-linux-gnu/bits/c++config.h:243,
>                  from /usr/include/c++/4.4/iostream:39,
>                  from twoD_diffusion_galerkin_example.cpp:49:
> /usr/include/features.h:160:1: warning: this is the location of the previous definition
> 
> Thanks,
> Dustin
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users

** Bill Spotz                                              **
** Sandia National Laboratories  Voice: (505)845-0170      **
** P.O. Box 5800                 Fax:   (505)284-0154      **
** Albuquerque, NM 87185-0370    Email: wfspotz at sandia.gov **








More information about the Trilinos-Users mailing list