[Numpy-discussion] Current SVN segfaults under VC7

Fernando Perez Fernando.Perez at colorado.edu
Wed Mar 22 16:57:05 CST 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
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



svn update ${PACKAGE}

export PYTHONPATH=${PYPREFIX}/lib/${PYTHON}/site-packages:${PYTHONPATH}:

# remove existing ${PACKAGE} to make sure the build doesn't pick up spurious 
rm -rf $PYPREFIX/lib/${PYTHON}/site-packages/${PACKAGE}

# make/install
rm -rf build
$PYTHON setup.py install --prefix=$PYPREFIX


With that, I can just type

./makepkg numpy


./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).



More information about the Numpy-discussion mailing list