Compilation error (redefinition of typedef) in the installation

Create issue
Issue #49 new
Takahiro UEDA created an issue

I tried to install numpy (2de5fff) within pypy 5.1.1 (installed via pyenv), but I got the following error of redefinitions of typedef:

    building 'numpy.core._partition' extension
    compiling C sources
    C compiler: cc -O2 -fPIC -Wimplicit -O2 -fPIC -Wimplicit -O2 -fPIC -Wimplicit

    creating build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/numpy/core/src/npysort
    compile options: '-DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/localstore/theorie/tueda/build/linuxbrew/var/pyenv/versions/pypy-5.1.1/include -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -c'
    cc: numpy/core/_partition.c
    numpy/core/_partition.c:424: error: redefinition of typedef ‘Py_uintptr_t’
    /localstore/theorie/tueda/build/linuxbrew/var/pyenv/versions/pypy-5.1.1/include/pyport.h:56: note: previous declaration of ‘Py_uintptr_t’ was here
    numpy/core/_partition.c:425: error: redefinition of typedef ‘Py_intptr_t’
    /localstore/theorie/tueda/build/linuxbrew/var/pyenv/versions/pypy-5.1.1/include/pyport.h:57: note: previous declaration of ‘Py_intptr_t’ was here
    numpy/core/_partition.c:424: error: redefinition of typedef ‘Py_uintptr_t’
    /localstore/theorie/tueda/build/linuxbrew/var/pyenv/versions/pypy-5.1.1/include/pyport.h:56: note: previous declaration of ‘Py_intptr_t’ was here
    numpy/core/_partition.c:425: error: redefinition of typedef ‘Py_intptr_t’
    /localstore/theorie/tueda/build/linuxbrew/var/pyenv/versions/pypy-5.1.1/include/pyport.h:57: note: previous declaration of ‘Py_ntptr_t’ was here
    error: Command "cc -O2 -fPIC -Wimplicit -O2 -fPIC -Wimplicit -O2 -fPIC -Wimplicit -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/localstore/theorie/tueda/build/linuxbrew/var/pyenv/versions/pypy-5.1.1/include -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -c numpy/core/_partition.c -o build/temp.linux-x86_64-2.7/numpy/core/_partition.o" failed with exit status 1

    ----------------------------------------
Command "/localstore/theorie/tueda/build/linuxbrew/var/pyenv/versions/pypy-5.1.1/bin/pypy -u -c "import setuptools, tokenize;__file__='/tmp/pip-ag1tew-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Wm_DuD-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-ag1tew-build/

The complete log is https://gist.githubusercontent.com/tueda/d58b9537b39304075c38cbdce6ae9ab1/raw/ef69641bdb034e1d2f911ebabcefd42b22b4d2ee/pypy_numpy_build.log.

Just in case, the compiler cc in my environment is cc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16).

Comments (4)

  1. mattip

    Do you have a subdirectory under /localstore/theorie/tueda/build/linuxbrew/var/pyenv/versions/pypy-5.1.1/include with the name numpy or _numpy or something like that? Your build should be using those headers and not the ones in numpy/core/...

    You may have better luck with one of the other commits right around that time, one before or one after.

    Any particular reason you are still using pypy 5.1.1? In PyPy terms it is ancient, almost a year old, a more modern PyPy 5.6 and up can simply pip install numpy from the upstream sources rather than using this repo's partial reimplementation. Although there might be some cases where this repo is faster, it seems the future is in the upstream repo.

  2. Takahiro UEDA reporter

    My report was actually almost one years ago :-) I'm now just using normal pypy -m pip install numpy from the upstream, which worked for at least numpy (1.12.0) with PyPy 5.6.0.

  3. Marvin

    Well, sorry, I missed to specify: I use Portable PyPy 5.7 x86_64 for Python 2.7. However, the errors are the same for this version as stated above. I have a local account (Centos 5), no root, I can't even use pip install to get packages from the internet, I can only download wheels from my own computer and upload them to my local account. So can I just download the standard py2.7 numpy .whl and install it?

  4. Log in to comment