|
From: Bruce S. <Bru...@nc...> - 2009-04-29 18:29:33
|
I recognize this problem, which is a bug in some versions of the Boost
libraries. What version of Boost are you using?
I found the following on the web:
**************
Furthermore building pyrap with boost-1.37 and gcc-4.3.2 gave an error
due to a missing include. The following patch has to be applied to boost:
Index: boost/python/detail/translate_exception.hpp
===================================================================
--- boost/python/detail/translate_exception.hpp (revision 50228)
+++ boost/python/detail/translate_exception.hpp (working copy)
@@ -9,6 +9,7 @@
# include <boost/call_traits.hpp>
# include <boost/type_traits/add_const.hpp>
+# include <boost/type_traits/add_reference.hpp>
# include <boost/function/function0.hpp>
***************
I was able to build Visual 5 on ubuntu 9.04 without having to make this change,
as I happened to pick Boost 1.35 in the package manager, which apparently
doesn't have this bug, but I had to make this change on Windows using Boost 1.38.
Since Python 2.6 ships with ubuntu 9.04, and there is now a numpy for Python 2.6
(a very recent development), I built Visual 5 for Python 2.6, and most example
programs run okay, but:
On both Windows and ubuntu, when I build Visual for Python 2.6 and numpy 1.3.0,
I get a run-time failure on something that works on Python 2.5 with numpy 1.2.1.
There is a vector(double,double,double) class in Visual which now fails if
handed numpy.int32 arguments (works fine with numpy.float64 arguments). I used
Boost 1.35 with Python 2.5 and have used Boost 1.38 on Windows and 1.35 on unbuntu.
This test routine fails:
xs = arange(0,10,1) # works okay if xs = arange(0,10,0.1)
x = xs[1]
print type(x)
v = vector(x,0,0)
print v
I've posted pleas for help on both the Boost and numpy mailing lists but haven't
gotten any replies. I would much appreciate suggestions for what to do.
Bruce Sherwood
Lenica Reggie wrote:
> Hello all,
>
> I'm having trouble building vpython 5 on ubuntu 9.4. I had it up and
> running on 8.10, but for some reason it is unwilling to compile on the
> newer version. I am using python version 2.6.2 and gcc compiler version
> 4.3, and I'm pretty sure I installed all the packages mentioned in the
> INSTALL.txt and I even tried changing to the newest threadpool version
> with no success. The error message I get in build.log is the following
> (attatched you can see the whole log file):
>
>
> In file included from
> /usr/include/boost/python/exception_translator.hpp:12,
> from ../../visual-5.03_candidate/src/python/cvisualmodule.cpp:11:
> /usr/include/boost/python/detail/translate_exception.hpp:34: error:
> expected nested-name-specifier before ‘add_reference’
> /usr/include/boost/python/detail/translate_exception.hpp:34: error:
> expected ‘;’ before ‘<’ token
> /usr/include/boost/python/detail/translate_exception.hpp: In member
> function ‘bool boost::python::detail::translate_exception<ExceptionType,
> Translate>::operator()(const boost::python::detail::exception_handler&,
> const boost::function0<void>&, typename
> boost::call_traits<Translate>::param_type) const’:
> /usr/include/boost/python/detail/translate_exception.hpp:56: error:
> expected type-specifier before ‘exception_cref’
> /usr/include/boost/python/detail/translate_exception.hpp:56: error:
> expected `)' before ‘e’
> /usr/include/boost/python/detail/translate_exception.hpp:56: error:
> expected `{' before ‘e’
> /usr/include/boost/python/detail/translate_exception.hpp:56: error: ‘e’
> was not declared in this scope
> /usr/include/boost/python/detail/translate_exception.hpp:56: error:
> expected `;' before ‘)’ token
|