[SciPy-dev] weave -- inline C/C++ in Python, an implementation

eric eric at scipy.org
Fri Jan 4 18:10:01 EST 2002


Hey Fernando,

The fixed width problem occurs for me too.  I haven't found the cause yet.
I'll keep looking later tonight.

The problem with cerr was supposed to go away when I hard coded the
inclusion of the stdc++ library
in build_tools.py.  Hmmm.  Looks like I did this in a pretty hap-hazard way:

        if sys.platform[:-1] == 'linux':
            libraries = kw.get('libraries',[])
            kw['libraries'] = ['stdc++'] +  libraries

Looks like this is guaranteed to fail for most cases.  Does mandrake define
sys.platform differently than
RH?  Anyway, I've changed this to:

        if compiler_name != 'msvc':
            libraries = kw.get('libraries',[])
            kw['libraries'] = ['stdc++'] +  libraries

so it should add the library for everything except microsoft vc++.  Until I
figure out how to do this right (like force g++),
hopefully this will work.

I've uploaded new source files.  Please see if this fixes the problem.

thanks,
eric

----- Original Message -----
From: "Fernando Pérez" <fperez at pizero.colorado.edu>
To: <scipy-dev at scipy.org>
Sent: Friday, January 04, 2002 6:43 PM
Subject: Re: [SciPy-dev] weave -- inline C/C++ in Python, an implementation


> Hi Eric,
>
> Failure report with weave. Platform:
>
> [~]> python
> Python 2.1.1 (#1, Aug 30 2001, 17:36:05)
> [GCC 2.96 20000731 (Mandrake Linux 8.1 2.96-0.61mdk)] on linux-i386
>
> I installed it with the standard routine (setup.py install) with
apparently no
> problems. When running weave.test(), I get:
>
> [snipped early part which seems ok]
>
> No test suite found for  weave.sequence_spec
> ..
> Expression: result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]+
> b[1:-1,2:] + b[1:-1,:-2]) / 5.
> Run: (10, 10) f
>
EEE....EEEE....EEE....EE....EEEE....EEE......EEEEEE.........................
.EEEwarning:
> specified build_dir '_bad_path_' does not exist or is or is not writable.
> Trying default locations
> ...warning: specified build_dir '..' does not exist or is or is not
writable.
> Trying default locations
> .warning: specified build_dir '_bad_path_' does not exist or is or is not
> writable. Trying default locations
> ...warning: specified build_dir '..' does not exist or is or is not
writable.
> Trying default locations
>
............................................................................
...................
> ======================================================================
> ERROR: result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/python2.1/site-packages/weave/tests/test_blitz_tools.py",
> line 148, in check_5point_avg_2d
>     self.generic_2d(expr)
>   File "/usr/lib/python2.1/site-packages/weave/tests/test_blitz_tools.py",
> line 124, in generic_2d
>     standard,compiled = self.generic_test(expr,arg_dict,type,size)
>   File "/usr/lib/python2.1/site-packages/weave/tests/test_blitz_tools.py",
> line 81, in generic_test     blitz_tools.blitz(expr,arg_dict,{},verbose=0)
>   File "/usr/lib/python2.1/site-packages/weave/blitz_tools.py", line 93,
in
> blitz
>     type_factories = blitz_type_factories)
>   File "/usr/lib/python2.1/site-packages/weave/inline_tools.py", line 407,
in
> compile_function
>     exec 'import ' + module_name
>   File "<string>", line 1, in ?
> ImportError:
>
/usr/local/home/fperez/tmp/test_files/sc_5599df30197fe981824ad8ec934a784e3.s
o:
> undefined symbol: cerr
> ======================================================================
> ERROR: check_int_return (test_scalar_spec.test_unix_int_specification)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/python2.1/site-packages/weave/tests/test_scalar_spec.py",
> line 110, in check_int_return
>     exec 'from ' + mod_name + ' import test'
>   File "<string>", line 1, in ?
> ImportError:
>
/usr/local/home/fperez/tmp/test_files/sc_504aaf25fe1bf17daaf243c7c8f713d93.s
o:
> undefined symbol: cerr
>
>
> [snipped lots more of similar error messages, all failing because cerr
isn't
> available]. I tested my c++ libraries and cerr is perfectly accessible for
me
> with g++ with a simple #include <iostream.h>, so I don't think my gcc/g++
> setup is the problem.
>
> At the end after all the snipped stuff I get:
>
> ======================================================================
> ERROR: check_call_function (test_common_spec.test_callable_specification)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/python2.1/site-packages/weave/tests/test_common_spec.py",
> line 56, in check_call_function
>     actual = inline_tools.inline(code,['func','search_str','sub_str'])
>   File "/usr/lib/python2.1/site-packages/weave/inline_tools.py", line 316,
in
> inline
>     auto_downcast = auto_downcast,
>   File "/usr/lib/python2.1/site-packages/weave/inline_tools.py", line 407,
in
> compile_function
>     exec 'import ' + module_name
>   File "<string>", line 1, in ?
> ImportError:
>
/usr/local/home/fperez/tmp/test_files/sc_263056b76227e75db905e6c70b5397fd1.s
o:
> undefined symbol: cerr
> ----------------------------------------------------------------------
> Ran 184 tests in 260.053s
>
> FAILED (errors=28)
> <unittest.TextTestRunner instance at 0x831bac4>
>
>
> I hope this helps you, ask me if you want more details.
>
> Very much looking forward to weave being fully functional.
>
> Cheers,
>
> f.
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-dev
>





More information about the SciPy-Dev mailing list