[Trilinos-Users] Python-related compiler warning

Dustin Langewisch dustinl at mit.edu
Thu Jun 16 12:03:35 MDT 2011


Thanks! That did the trick.

On a somewhat related note, I had modified the original
twoD_diffusion_galerkin_example.cpp code to create a new folder for the
output .txt files, which required that I import <sys/stat.h> (maybe there
are better ways to do it, but that's what I found online). Initially, I put
the #include statement in the code just before calling mkdir (poor practice,
I know). Interestingly, it compiled fine before I made your suggested
change, but afterward I started getting errors. Anyway, I moved the #include
directive to the header with the rest of them and all is well now. Perhaps
that's to be expected, but I'm a novice and found it strange.

Thanks again,
Dustin


On Thu, Jun 16, 2011 at 8:20 AM, Bill Spotz <wfspotz at sandia.gov> wrote:

> 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 **
>
>
>
>
>
>
>


-- 
Dustin Langewisch
Graduate Student
MIT Nuclear Science and Engineering
(573) 289-4411
dustinl at mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20110616/e315efb9/attachment.html 


More information about the Trilinos-Users mailing list