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

eric jones eric at enthought.com
Tue Aug 27 12:35:18 CDT 2002


Hey Steve,

Your in new territory here.  The only compilers I have used are
gcc-2.95.3 and MSVC.

One of the main problems is that CXX is pretty hard on compilers because
of its heavy use of templates.  The good news is I have a new version of
weave in my sandbox that uses SCXX instead of CXX.  SCXX, written by
Gordon McMillan, is very similar to CXX, but it doesn't use templates at
all.  I'm betting this will be significantly more portable.  The new
version of weave will require some code re-write on the user end because
of this and a few other changes.  The bad news is that I am traveling
for the next two weeks and won't check this in until I get back -- and
maybe until the end of Sept. :(  I can send it to you off-line if you're
brave.

The second issue is that distutils doesn't automatically handle building
C++ libraries.  Weave uses a hack that replaces gcc with g++ if gnu is
used.  g++ links in the correct libraries for cout, etc. while gcc
doesn't.  I'm betting your hitting a similar problem.  One temporary fix
might be to try libraries=['stdc++'] as an inline() keyword argument.

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

Yikes!  This looks like something we'll just have to hard code when MIPS
is detected.  Or maybe if we build with the MIPS c++ compiler (is it
different than the c compiler on this platform?) this flag will
automatically be set.  I can't imagine a C++ compiler having to have a
flag set to use the std namespace files.

I am hoping to get a sliver of time next month to finish up the changes.
When I do, if it isn't already, we can work together to make sure it
runs on MIPS.  With the change to SCXX, inline() should theoretically
work everywhere.  blitz() on the other hand... I think that is still
relegated to the world of gcc.

eric

> -----Original Message-----
> From: scipy-user-admin at scipy.net [mailto:scipy-user-admin at scipy.net]
On
> Behalf Of Steve M. Robbins
> Sent: Tuesday, August 27, 2002 8:23 AM
> To: scipy-user at scipy.net
> Subject: [SciPy-user] weave and compilers other than GCC 2.95?
> 
> 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.
> 
> 
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user




More information about the SciPy-user mailing list