[Numpy-discussion] Current SVN segfaults under VC7
Fernando Perez
Fernando.Perez at colorado.edu
Wed Mar 22 16:57:05 EST 2006
Zachary Pincus wrote:
> I've seen this too, and been able to fix it by removing the build
> directory and rebuilding everything.
>
> I wonder if there's a bug in numpy's dependency checking that's
> causing certain files to not get rebuilt when they ought. I recently
> updated to the SVN head, and numpy segfaulted on import, just as you
> describe. After puttering around with GDB, it looked like some of the
> code was out of synch with other parts of the code, so I decided to
> rebuild from scratch.
>
> After I deleted the entire numpy build directory ('python setup.py
> clean' *did not* work) and re-built, things worked just fine. I've
> also had this problem with scipy, and the same solution applied.
>
> Anyhow, try removing all traces of build products from the numpy
> directory and rebuilding... maybe that will fix things.
Just a hint from experience: do NOT trust distutils to do proper dependency
management and know what to rebuild and what not to. Most of us have settled
on some variation of:
planck[scipy]> d
/usr/local/installers/src/scipy
total 16
-rwxr-xr-x 1 fperez 390 Mar 8 13:28 makepkg*
drwxr-xr-x 6 fperez 4096 Mar 14 11:52 numpy/
drwxr-xr-x 4 fperez 4096 Nov 17 15:16 scipy/
-rwxr-xr-x 1 fperez 415 Jan 5 01:37 testpkg*
planck[scipy]> cat makepkg
#!/bin/sh
PACKAGE=$1
PYTHON=python2.3
PYPREFIX=$HOME/tmp/local
svn update ${PACKAGE}
export PYTHONPATH=${PYPREFIX}/lib/${PYTHON}/site-packages:${PYTHONPATH}:
# remove existing ${PACKAGE} to make sure the build doesn't pick up spurious
things
rm -rf $PYPREFIX/lib/${PYTHON}/site-packages/${PACKAGE}
# make/install
cd ${PACKAGE}
rm -rf build
$PYTHON setup.py install --prefix=$PYPREFIX
################
With that, I can just type
./makepkg numpy
or
./makepkg scipy
and I'm almost sure it will do the right thing.
I wonder if we shouldn't add this to the wiki as the recommended procedure for
builds (at least under *nix). I know it allows me to do fresh svn builds of
numpy/scipy at any time without having to think (a process rarely successful
within the confines of my skull).
Cheers,
f
More information about the NumPy-Discussion
mailing list