'undefined symbol: PyArray_DescrFromType' when loading numpy extension

Create issue
Issue #47 new
piem created an issue

Hi,

I'm trying to build aubio with pypy. the source builds fine, but when loading the module, i get an 'undefined symbol: PyArray_DescrFromType'. any idea what could be missing?

more info here: https://github.com/aubio/aubio/issues/17#issuecomment-213969499

thanks, Paul

Comments (7)

  1. piem reporter

    Hi @mattip,

    Thanks for the feedback. I tried with 5.0.1, adding pypy's numpy/include to the headers, but I get the same error. Missing symbols include:

    • PyArray_DescrFromType
    • PyArray_MultiplyList
    • PyArray_FromAny

    all of which can be found in <numpy/__multiarray_api.h>.

  2. mattip

    We will be releasing pyyp 5.1.1 to fix the missing header part of this issue. You still need to fix the ufunc problems in aubio, but this should allow you to move forward:

    #! /bin/bash
    set -e
    set -x
    
    wget http://buildbot.pypy.org/nightly/release-5.x/pypy-c-jit-83928-60dff1f57b81-linux64.tar.bz2
    tar xf pypy-c-jit-83928-60dff1f57b81-linux64.tar.bz2
    
    virtualenv -p pypy-c-jit-83928-60dff1f57b81-linux64/bin/pypy aubioforpypy
    source aubioforpypy/bin/activate
    
    pypy -m pip install --upgrade setuptools
    
    git clone https://bitbucket.org/pypy/numpy.git
    pushd numpy
    pypy setup.py install
    popd
    
    pypy -c "import numpy" && echo "numpy successfully installed"
    
    git clone --branch=develop https://github.com/aubio/aubio.git
    pushd aubio
    make getwaf
    pypy waf configure build
    pushd python
    echo still need to fix missing ufunc problems
    pypy setup.py install # complains about missing ufunc definitions
    popd
    
    export LD_LIBRARY_PATH=$PWD/aubio/build/src
    pypy -c "import aubio" && echo "aubio successfully installed"
    
  3. piem reporter

    great, thank you! after applying this patch, i could build and load aubio from pypy.

    is there anything I should do to fix aubio's ufuncs, or should I wait for a future pypy/numpy version?

    best, Paul

  4. mattip

    it is acutally missing support in pypy/module/cpyext/ndarrayobject.py, we seem to be missing a typedef We are working on an alternative implementation of all this stuff, so maybe by pypy 6 it will all Just Work(tm)

  5. Log in to comment