[SciPy-user] weave and compilers other than GCC 2.95?

Steve M. Robbins steven.robbins at videotron.ca
Tue Aug 27 08:23:28 CDT 2002


Hullo,

Since July (when a discussion here alerted me to it) I've been happily
using weave to speed up some loops in my code.  I was developing under
Debian linux which uses GCC 2.95.4 as the default compiler.

I finally managed to get scipy built on our IRIX system the other day,
and tried to run my code there.  Sadly, the IRIX compiler balked at
the weave-produced code.

I got a number of errors of the type

  #error directive:  This header file requires the -LANG:std option

I realize that weave.inline() lets you specify extra compiler args,
but that's a little tedious for system-dependent flags like this.
Just where does the compiler definition come from, anyway?  Is there a
global way to set it, e.g. using environment args or a config file?

OK, so as a test, I set -LANG:std using extra_compile_args.  Now I
have 48 errors instead of 10!

Most of the errors are of the following kind.

  A type specifier is expected.

        template <class T> bool operator==(const SeqBase<T>::iterator& left, const SeqBase<T>::iterator& right);
                                                 ^
In addition there are "cout undeclared" errors.


So I'm left scratching my head.  Has weave never before been tested
with the IRIX compiler?  Or am I doing something stupid?  I'm using
weave checked out with the scipy CVS tree.  Is that current?
Python is 2.1.3 with Numeric 21.

Now that I have the weave-produced code in a file in
~/.python21_compiled, I tried it with other compilers available.  None
of my GCC 3.0.x nor GCC 3.1 nor GCC 3.2 would compile the file either!
Neither under IRIX nor under Linux.

Besides some warnings about "antiquated headers" :-) there are errors
like the following

  ....scipy/weave/CXX/Objects.hxx:1143: no class template named
  `random_access_iterator' in `std'

as well as "cout undeclared".

These errors sound like they can be cured by #including the right
mix of headers.  Is there a patch already available for this?

Thanks,
-Steve

P.S. I'm testing weave, by the way, using Fernando Perez's examples.

On Mon, Jul 22, 2002 at 08:55:15PM -0600, Fernando Perez wrote:
> 
> I've posted an updated version of my weave examples with this at:
> 
> http://www-hep.colorado.edu/~fperez/python/python-c/weave_examples.html
> 
> http://www-hep.colorado.edu/~fperez/python/python-c/weave_examples.py
> 
> One is color highlighted, the other pure text for python use.





More information about the SciPy-user mailing list