Subject: Re: weave compilation fails
Package: python-scipy
Version: 0.7.0-2+b1
Severity: normal

*** Please type your report below this line ***

This bug is fixed in the package "libblitz0-dev".

So my solution is use this package to replace blitz++ in python-scipy:
cunzh...@debian:~$ sudo apt-get install libblitz0-dev
cunzh...@debian:~$ sudo rm -r /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz
cunzh...@debian:~$ sudo ln -s /usr/include/blitz  /usr/lib/python2.5/site-packages/scipy/weave/blitz

Another way is to fix python-scipy source with the patch from
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=455661,
and recompile it.


Then weave works well.

Dear Maintainers, I have a question there. Is the blitz++ library in the "python-scipy" package same as those files in the package "libblitz0-dev"?
If so, why not doing a depend to libblitz0-dev  for python-scipy ?

Thank you!

Cun Zhang



====Error message====
In file included from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/applics.h:394,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/vecexpr.h:26,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/vecpick.cc:16,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/vecpick.h:287,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/vector.h:443,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/tinyvec.h:424,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array-impl.h:38,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array.h:26,
                 from /home/cunzhang/.python25_compiled/sc_9fa2bd3407c2f075f1c56212f3e784ad0.cpp:11:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/mathfunc.h: In static member function ‘static long int blitz::_bz_abs<long int>::apply(long int)’:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/mathfunc.h:45: error: ‘labs’ is not a member of ‘std’
In file included from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array/funcs.h:23,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array/newet.h:23,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array/et.h:21,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array-impl.h:2509,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array.h:26,
                 from /home/cunzhang/.python25_compiled/sc_9fa2bd3407c2f075f1c56212f3e784ad0.cpp:11:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/funcs.h: In static member function ‘static int blitz::Fn_abs<int>::apply(int)’:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/funcs.h:503: error: call of overloaded ‘abs(int&)’ is ambiguous
/usr/include/c++/4.4/cmath:94: note: candidates are: double std::abs(double)
/usr/include/c++/4.4/cmath:98: note:                 float std::abs(float)
/usr/include/c++/4.4/cmath:102: note:                 long double std::abs(long double)
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/funcs.h: In static member function ‘static long int blitz::Fn_abs<long int>::apply(long int)’:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/funcs.h:524: error: ‘labs’ is not a member of ‘std’
In file included from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/applics.h:394,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/vecexpr.h:26,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/vecpick.cc:16,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/vecpick.h:287,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/vector.h:443,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/tinyvec.h:424,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array-impl.h:38,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array.h:26,
                 from /home/cunzhang/.python25_compiled/sc_9fa2bd3407c2f075f1c56212f3e784ad0.cpp:11:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/mathfunc.h: In static member function ‘static long int blitz::_bz_abs<long int>::apply(long int)’:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/mathfunc.h:45: error: ‘labs’ is not a member of ‘std’
In file included from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array/funcs.h:23,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array/newet.h:23,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array/et.h:21,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array-impl.h:2509,
                 from /usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/array.h:26,
                 from /home/cunzhang/.python25_compiled/sc_9fa2bd3407c2f075f1c56212f3e784ad0.cpp:11:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/funcs.h: In static member function ‘static int blitz::Fn_abs<int>::apply(int)’:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/funcs.h:503: error: call of overloaded ‘abs(int&)’ is ambiguous
/usr/include/c++/4.4/cmath:94: note: candidates are: double std::abs(double)
/usr/include/c++/4.4/cmath:98: note:                 float std::abs(float)
/usr/include/c++/4.4/cmath:102: note:                 long double std::abs(long double)
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/funcs.h: In static member function ‘static long int blitz::Fn_abs<long int>::apply(long int)’:
/usr/lib/python2.5/site-packages/scipy/weave/blitz/blitz/funcs.h:524: error: ‘labs’ is not a member of ‘std’
Traceback (most recent call last):
  File "wtest.py", line 13, in <module>
    weave.inline(code,['a'],type_converters=weave.converters.blitz)
  File "/usr/lib/python2.5/site-packages/scipy/weave/inline_tools.py", line 335, in inline
    **kw)
  File "/usr/lib/python2.5/site-packages/scipy/weave/inline_tools.py", line 462, in compile_function
    verbose=verbose, **kw)
  File "/usr/lib/python2.5/site-packages/scipy/weave/ext_tools.py", line 365, in compile
    verbose = verbose, **kw)
  File "/usr/lib/python2.5/site-packages/scipy/weave/build_tools.py", line 272, in build_extension
    setup(name = module_name, ext_modules = [ext],verbose=verb)
  File "/usr/lib/python2.5/site-packages/numpy/distutils/core.py", line 184, in setup
    return old_setup(**new_attr)
  File "/usr/lib/python2.5/distutils/core.py", line 168, in setup
    raise SystemExit, "error: " + str(msg)
scipy.weave.build_tools.CompileError: error: Command "g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -fPIC -I/usr/lib/python2.5/site-packages/scipy/weave -I/usr/lib/python2.5/site-packages/scipy/weave/scxx -I/usr/lib/python2.5/site-packages/scipy/weave/blitz -I/usr/lib/python2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c /home/cunzhang/.python25_compiled/sc_9fa2bd3407c2f075f1c56212f3e784ad0.cpp -o /tmp/cunzhang/python25_intermediate/compiler_5d6a6990cef58488c417b53617f48c12/home/cunzhang/.python25_compiled/sc_9fa2bd3407c2f075f1c56212f3e784ad0.o" failed with exit status 1

========

Test script:

#/usr/bin/python
from scipy import weave
from scipy import *
a=zeros((3,3))
code=r"""
int i,j;
for(i=0;i<3;i++){
    for(j=0;j<3;j++){
        a(i,j)=i+j;
    }
}
"""
weave.inline(code,['a'],type_converters=weave.converters.blitz)
print a

========
-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-scipy depends on:
ii  libamd2.2.0                 1:3.4.0-1    approximate minimum degree orderin
ii  libatlas3gf-base [liblapack 3.6.0-24     Automatically Tuned Linear Algebra
ii  libblas3gf [libblas.so.3gf] 1.2-4        Basic Linear Algebra Subroutines 3
ii  libc6                       2.10.2-6     Embedded GNU C Library: Shared lib
ii  libgcc1                     1:4.4.3-3    GCC support library
ii  libgfortran3                4.4.3-3      Runtime library for GNU Fortran ap
ii  liblapack3gf [liblapack.so. 3.2.1-2      library of linear algebra routines
ii  libstdc++6                  4.4.3-3      The GNU Standard C++ Library v3
ii  libumfpack5.4.0             1:3.4.0-1    sparse LU factorization library
ii  python                      2.5.4-9      An interactive high-level object-o
ii  python-central              0.6.14+nmu2  register and build utility for Pyt
ii  python-numpy                1:1.3.0-3+b1 Numerical Python adds a fast array

Versions of packages python-scipy recommends:
ii  g++ [c++-compiler]            4:4.4.3-1  The GNU C++ compiler
ii  g++-4.3 [c++-compiler]        4.3.4-8    The GNU C++ compiler
ii  g++-4.4 [c++-compiler]        4.4.3-3    The GNU C++ compiler

Versions of packages python-scipy suggests:
pn  python-profiler               <none>     (no description available)

-- no debconf information

Reply via email to