Boost logo

Boost :

From: Ralf W. Grosse-Kunstleve (rwgk_at_[hidden])
Date: 2004-09-02 00:19:42


--- Markus_Schöpflin <markus.schoepflin_at_[hidden]> wrote:

> Ralf W. Grosse-Kunstleve wrote:
>
> > The two patches below are now in CVS. Thanks Markus for your help! I've
> tested
> > with a fairly large variety of compilers, but not VC6, VC7.0 or any
> > Codewarrior. We should keep an eye on the Metacomm logs.
> >
> > I hope this is the end of our struggle with the "Python.h first"
> requirement.
>
> Just a small note. The version check in wrap_python.h now is essentially
> a no-op, because you're including <pyconfig.h> before in prefix.hpp. As
> the python config file was called <config.h> before version 2.2, it
> wouldn't compile anyway for older python versions.

Good point, but it is a bit more than a no-op:

% g++ -fPIC -ftemplate-depth-120 -w -DNDEBUG -O3 -ffast-math
-DBOOST_PYTHON_MAX_BASES=2 -DBOOST_PYTHON_SOURCE
-I/net/worm/scratch1/rwgk/hot/boost
-I/usr/local_cci/Python-1.5.2/include/python1.5 -c -o
boost/libs/python/src/converter/builtin_converters.os
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp
In file included from
/net/worm/scratch1/rwgk/hot/boost/boost/python/handle.hpp:8,
                 from
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:6:
/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/prefix.hpp:13:23:
pyconfig.h: No such file or directory
In file included from
/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/prefix.hpp:18,
                 from
/net/worm/scratch1/rwgk/hot/boost/boost/python/handle.hpp:8,
                 from
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:6:
/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/wrap_python.hpp:44:2:
#error Python 2.2 or higher is required for this version of Boost.Python.
In file included from
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:12:
/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/wrap_python.hpp:44:2:
#error Python 2.2 or higher is required for this version of Boost.Python.
In file included from
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:14:
/net/worm/scratch1/rwgk/hot/boost/boost/python/converter/builtin_converters.hpp:
In
   member function `PyObject*
   boost::python::to_python_value<std::wstring&>::operator()(const
   std::wstring&) const':
/net/worm/scratch1/rwgk/hot/boost/boost/python/converter/builtin_converters.hpp:116:
`::
   PyUnicode_FromWideChar' undeclared (first use here)
/net/worm/scratch1/rwgk/hot/boost/boost/python/converter/builtin_converters.hpp:
In
   constructor
   `boost::python::converter::arg_to_python<std::wstring>::arg_to_python(const
   std::wstring&)':
/net/worm/scratch1/rwgk/hot/boost/boost/python/converter/builtin_converters.hpp:116:
`::
   PyUnicode_FromWideChar' undeclared (first use here)
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:
In
   function `PyObject*
   boost::python::converter::<unnamed>::encode_string_unaryfunc(PyObject*)':
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:278:
`
   PyUnicode_FromEncodedObject' undeclared (first use this function)
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:278:
(Each
   undeclared identifier is reported only once for each function it appears
   in.)
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:
In
   static member function `static PyObject*(**
  
boost::python::converter::<unnamed>::wstring_rvalue_from_python::get_slot(PyObject*))(PyObject*)':
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:290:
`
   PyUnicode_Check' undeclared (first use this function)
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:
In
   static member function `static std::wstring
  
boost::python::converter::<unnamed>::wstring_rvalue_from_python::extract(PyObject*)':
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:302:
`
   PyUnicodeObject' undeclared (first use this function)
/net/worm/scratch1/rwgk/hot/boost/libs/python/src/converter/builtin_converters.cpp:302:
parse
   error before `;' token

> May I suggest to move the inclusion of <pyconfig.h> after the inclusion
> of <patchlevel.h> in wrap_python? Or move the version check to
> prefix.hpp. Just an idea...

The #error is not the first error message, but it appears in the output. That
should be enough of a clue. I am not keen including patchlevel.h (or any other
file) before pyconfig.h even though it will most likely be fine. On the other
hand it is becoming more and more unlikely that anybody still has Python 2.1 or
earlier. So why take chances? Considering all this I arrive at the conclusion
that we should leave the includes as they are until we encounter a real
problem.

Cheers,
        Ralf

                
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk