From: Lenica R. <Lr...@ia...> - 2009-04-29 15:41:38
Attachments:
build.log.tar.gz
|
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 It almost looks like a compiler problem? I tried setting the option g++ -V 3.4 in the makefile but this had no effect. the output of configure is the following: $ ../visual-5.03_candidate/configure --prefix /usr/local checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of gcc... none checking whether gcc and cc understand -c and -o together... yes checking how to run the C preprocessor... gcc -E checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... none checking whether make sets $(MAKE)... (cached) yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognize dependent libraries... pass_all checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for xlf... no checking for f77... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for xlf90... no checking for f90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for xlf95... no checking for f95... no checking for fort... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 1572864 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so (cached) (cached) checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking whether to enable maintainer-specific portions of Makefiles... no checking for some Win32 platform... no checking for some Mac OSX platform... no checking for a Python interpreter with version >= 2.2... python checking for python... /usr/bin/python checking for python version... 2.6 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.6/site-packages checking for python extension module directory... ${exec_prefix}/lib/python2.6/site-packages checking for array in python module numpy... yes checking for headers required to compile python extensions... found checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for GTKGLEXTMM... yes checking for GLIBMM... yes checking for PANGOMM... yes checking for LIBGLADEMM... yes checking for PANGOFT2... yes checking for FREETYPE2... yes checking for GTK... yes checking for GTHREAD... yes checking where to install documentation... ${prefix}/lib/python2.6/site-packages/visual/docs checking whether to install html documentation... yes checking where to install example programs... ${prefix}/lib/python2.6/site-packages/visual/examples checking whether to install example programs... yes configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating site-packages/visual/Makefile config.status: creating docs/Makefile config.status: creating examples/Makefile config.status: creating bin/vpython config.status: creating include/config.h config.status: include/config.h is unchanged config.status: executing depfiles commands it would be great if I could get this working! Thanks in advance for any help on this. cheers Lenica |
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 |
From: Guy K. K. <g....@ma...> - 2009-04-30 02:44:45
|
On Thu, 30 Apr 2009 06:29:23 Bruce Sherwood wrote: > 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. Lenica, I've got some Jaunty packages compiled with Boost 1.35 here, but you need to resolve your dependencies manually, as they're built with checkinstall and don't contain any dependencies. But it still helps a lot to not have to build it yourself. https://gutefee.massey.ac.nz/moin/Python/3D FYI, configuring, building and creation of the package has been accomplished with these commands: /configure --prefix=/usr --disable-docs make -j 3 # I use a dual core, so I gain some speed though the "-j 3" sudo checkinstall --pkgname python-visual --pkgversion 5.0rc3 --pkglicense "Boost Public License" --maintainer "Guy K. Kloss \<g....@ma...\>" > 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. Here using python-numpy in version 1.2.1-1ubuntu1, which strangely enough works with Python 2.6 on Jaunty (1.3 is supposed to be the numpy version that works with Python 2.6). > This test routine fails: Indeed, never noticed ... In [1]: import numpy In [2]: import visual In [3]: xs = numpy.arange(0,10,1) In [4]: x = xs[1] In [5]: print type(x) <type 'numpy.int32'> In [6]: v = visual.vector(x,0,0) ArgumentError Traceback (most recent call last) /home/gkloss/<ipython console> in <module>() ArgumentError: Python argument types in vector.__init__(vector, numpy.int32, int, int) did not match C++ signature: __init__(_object*, cvisual::vector) __init__(_object*) __init__(_object*, double) __init__(_object*, double, double) __init__(_object*, double, double, double) > 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. Maybe you need to add another constructor to the C++ code containing integers? Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura Pūtaiao o Mōhiohio me Pāngarau Room 2.63, Quad Block A Building Massey University, Auckland, Albany Private Bag 102 904, North Shore Mail Centre voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181 eMail: G....@ma... http://iims.massey.ac.nz |
From: Lenica R. <Lr...@ia...> - 2009-05-05 09:09:56
|
Thanks for the tips. I tried editing the file translate_exception.hpp , but later on got another error with the linker, so I decided, the hell with this, and installed the boost 1.35 libraries instead of their newer versions and finally got it to work. Hopefully everything will work fine now. Anyways, thanks again! Bruce Sherwood wrote: > 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. > |