15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SciPy Reference Guide, Release 0.8.dev<br />

about is that I’ve hard coded things so that compilations are linked with the stdc++ library. Is this standard<br />

across Unix compilers, or is this a gcc-ism?<br />

For blitz(), you’ll need a reasonably recent version of gcc. 2.95.2 works on windows and 2.96 looks fine on<br />

Linux. Other versions are likely to work. Its likely that KAI’s C++ compiler and maybe some others will work,<br />

but I haven’t tried. My advice is to use gcc for now unless your willing to tinker with the code some.<br />

On Windows, either MSVC or gcc (mingw32) should work. Again, you’ll need gcc for blitz() as the MSVC<br />

compiler doesn’t handle templates well.<br />

I have not tried Cygwin, so please report success if it works for you.<br />

• NumPy<br />

The python NumPy module is required for blitz() to work and for numpy.distutils which is used by weave.<br />

1.12.4 Installation<br />

There are currently two ways to get weave. First, weave is part of SciPy and installed automatically (as a subpackage)<br />

whenever SciPy is installed. Second, since weave is useful outside of the scientific community, it has been<br />

setup so that it can be used as a stand-alone module.<br />

The stand-alone version can be downloaded from here. Instructions for installing should be found there as well.<br />

setup.py file to simplify installation.<br />

1.12.5 Testing<br />

Once weave is installed, fire up python and run its unit tests.<br />

>>> import weave<br />

>>> weave.test()<br />

runs long time... spews tons of output and a few warnings<br />

.<br />

.<br />

.<br />

..............................................................<br />

................................................................<br />

..................................................<br />

----------------------------------------------------------------------<br />

Ran 184 tests in 158.418s<br />

OK<br />

>>><br />

This takes a while, usually several minutes. On Unix with remote file systems, I’ve had it take 15 or so minutes. In the<br />

end, it should run about 180 tests and spew some speed results along the way. If you get errors, they’ll be reported at<br />

the end of the output. Please report errors that you find. Some tests are known to fail at this point.<br />

If you only want to test a single module of the package, you can do this by running test() for that specific module.<br />

>>> import weave.scalar_spec<br />

>>> weave.scalar_spec.test()<br />

.......<br />

----------------------------------------------------------------------<br />

Ran 7 tests in 23.284s<br />

1.12. Weave 89

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!