SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.03k stars 1.23k forks source link

c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory #include <ffi.h> #2305

Closed mpeter1975 closed 8 years ago

mpeter1975 commented 8 years ago

Hi!

Cross compiling pythonfor qoriq. First:

Cross-compiling python for qoriq.
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found

but libffi was compiled stand alone before, as a test.

And then:

In file included from /root/spksrc/native/python/work-native/install/usr/local/include/python2.7/Python.h:58:0,
                     from c/_cffi_backend.c:2:
    /root/spksrc/native/python/work-native/install/usr/local/include/python2.7/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
     #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
      ^
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
                     ^
    compilation terminated.
Dr-Bean commented 8 years ago

Make sure you compile native/python first. See https://github.com/SynoCommunity/spksrc/issues/2262#issuecomment-211246816.

If that is not your problem, either make clean first or provide more detailed information; which specific commands did you run, and from where?

mpeter1975 commented 8 years ago

Compiling native/python with make clean; make from the /root/spksrc/native/python folder:

  /root/spksrc/native/python/work-native/install/usr/local/include/python2.7/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
     #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
      ^
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
                     ^
    compilation terminated.
    error: command '/usr/local/powerpc-e500v2-linux-gnuspe/bin/powerpc-e500v2-linux-gnuspe-gcc' failed with exit status 1

    ----------------------------------------
Command "/root/spksrc/native/python/work-native/install/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-KKlMKS/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-evm_M2-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-KKlMKS/cffi/
Makefile:27: recipe for target 'myPostInstall' failed
Dr-Bean commented 8 years ago

On what type of system are you running this? The error /usr/local/powerpc-e500v2-linux-gnuspe/bin/powerpc-e500v2-linux-gnuspe-gcc doesn't make a lot of sense here.

mpeter1975 commented 8 years ago

It's an Ubuntu 1604 LTS, with spksrc toolkit compiling for DS413 qoriq system. Mediainfo and other packages were compiled successfully, the only problem is that missing ffi.h

Dr-Bean commented 8 years ago

Assuming you mean you're running the Ubuntu VM on an x86-64 based device, that error message indicates that the make clean didn't do what I would expect. Please verify that make clean was completed correctly in native/python. There should be no work dir once it has run. After that, run make again.

Dr-Bean commented 8 years ago

Closing, see previous comment.