Please login or register. December 16, 2017, 01:39:40 AM

Author Topic: Error building CFFI from source.  (Read 622 times)

0 Members and 1 Guest are viewing this topic.

Rich

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
Error building CFFI from source.
« on: September 07, 2017, 03:59:03 PM »
I am trying to setup parakimo and it's dependencies.  When I get to cffi I get stuck and i do not know how to proceed.  The OS version is AIX 6.1.  The error is below

    building '_cffi_backend' extension
    creating build/temp.aix-6.1-2.7
    creating build/temp.aix-6.1-2.7/c
    /usr/vac/bin/xlc_r -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -D_LARGE_FILES -q32 -qbitfields=signed -qmaxmem=70000 -qalloca -bmaxdata:0x80000000 -Wl,-brtl -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DNDEBUG -g -O0 -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/opt/freeware/include/python2.7 -c c/_cffi_backend.c -o build/temp.aix-6.1-2.7/c/_cffi_backend.o
    "c/_cffi_backend.c", line 15.10: 1506-296 (S) #include file <ffi.h> not found.
    "/usr/include/alloca.h", line 35.1: 1506-224 (I) Incorrect pragma ignored.
    "c/malloc_closure.h", line 6.10: 1506-296 (S) #include file <ffi.h> not found.
    "c/malloc_closure.h", line 81.5: 1506-046 (S) Syntax error.
    "c/malloc_closure.h", line 158.43: 1506-277 (S) Syntax error: possible missing ')' or ','?
    "c/malloc_closure.h", line 160.54: 1506-045 (S) Undeclared identifier p.
    "c/malloc_closure.h", line 166.8: 1506-166 (S) Definition of function ffi_closure requires parentheses.
    "c/malloc_closure.h", line 166.20: 1506-276 (S) Syntax error: possible missing '{'?
    "c/malloc_closure.h", line 175.19: 1506-022 (S) "closure" is not a member of "union mmaped_block".
    "c/_cffi_backend.c", line 259.5: 1506-046 (S) Syntax error.
    "c/_cffi_backend.c", line 1681.9: 1506-045 (S) Undeclared identifier ffi_closure.
    "c/_cffi_backend.c", line 1681.22: 1506-045 (S) Undeclared identifier closure.
    "c/_cffi_backend.c", line 1681.30: 1506-277 (S) Syntax error: possible missing ';' or ','?
    "c/_cffi_backend.c", line 1701.9: 1506-045 (S) Undeclared identifier ffi_closure.
    "c/_cffi_backend.c", line 1701.22: 1506-045 (S) Undeclared identifier closure.
    "c/_cffi_backend.c", line 1701.30: 1506-277 (S) Syntax error: possible missing ';' or ','?
    "c/_cffi_backend.c", line 1722.9: 1506-045 (S) Undeclared identifier ffi_closure.
    "c/_cffi_backend.c", line 1722.22: 1506-045 (S) Undeclared identifier closure.
    "c/_cffi_backend.c", line 1722.30: 1506-277 (S) Syntax error: possible missing ';' or ','?
    "c/_cffi_backend.c", line 1928.53: 1506-046 (S) Syntax error.
    "c/_cffi_backend.c", line 2618.53: 1506-275 (S) Unexpected text ffi_abi encountered.
    "c/_cffi_backend.c", line 2751.17: 1506-275 (S) Unexpected text fabi encountered.
    "c/_cffi_backend.c", line 2751.9: 1506-045 (S) Undeclared identifier ffi_abi.
    "c/_cffi_backend.c", line 2793.9: 1506-045 (S) Undeclared identifier fabi.
    "c/_cffi_backend.c", line 2847.26: 1506-022 (S) "cif" is not a member of "struct {...}".
    "c/_cffi_backend.c", line 2858.38: 1506-045 (S) Undeclared identifier ffi_arg.
    "c/_cffi_backend.c", line 4042.5: 1506-045 (S) Undeclared identifier ffi_type.
    "c/_cffi_backend.c", line 4042.15: 1506-045 (S) Undeclared identifier ffitype.
    "c/_cffi_backend.c", line 4060.28: 1506-045 (S) Undeclared identifier ffi_type_sint8.
    "c/_cffi_backend.c", line 4061.28: 1506-045 (S) Undeclared identifier ffi_type_sint16.
    "c/_cffi_backend.c", line 4062.28: 1506-045 (S) Undeclared identifier ffi_type_sint32.
    "c/_cffi_backend.c", line 4063.28: 1506-045 (S) Undeclared identifier ffi_type_sint64.
    "c/_cffi_backend.c", line 4069.24: 1506-045 (S) Undeclared identifier ffi_type_float.
    "c/_cffi_backend.c", line 4071.24: 1506-045 (S) Undeclared identifier ffi_type_double.
    "c/_cffi_backend.c", line 4079.28: 1506-045 (S) Undeclared identifier ffi_type_longdouble.
    "c/_cffi_backend.c", line 4086.28: 1506-045 (S) Undeclared identifier ffi_type_uint8.
    "c/_cffi_backend.c", line 4087.28: 1506-045 (S) Undeclared identifier ffi_type_uint16.
    "c/_cffi_backend.c", line 4088.28: 1506-045 (S) Undeclared identifier ffi_type_uint32.
    "c/_cffi_backend.c", line 4089.28: 1506-045 (S) Undeclared identifier ffi_type_uint64.
    "c/_cffi_backend.c", line 4736.5: 1506-046 (S) Syntax error.
    "c/_cffi_backend.c", line 4761.8: 1506-166 (S) Definition of function ffi_type requires parentheses.
    "c/_cffi_backend.c", line 4761.17: 1506-276 (S) Syntax error: possible missing '{'?
    "c/_cffi_backend.c", line 4767.9: 1506-045 (S) Undeclared identifier ct.
    "c/_cffi_backend.c", line 4767.22: 1506-045 (S) Undeclared identifier place.
    "c/_cffi_backend.c", line 4767.29: 1506-045 (S) Undeclared identifier detail.
    "c/_cffi_backend.c", line 4767.37: 1506-045 (S) Undeclared identifier place.
    "c/_cffi_backend.c", line 4771.8: 1506-166 (S) Definition of function ffi_type requires parentheses.
    "c/_cffi_backend.c", line 4771.17: 1506-276 (S) Syntax error: possible missing '{'?
    "c/_cffi_backend.c", line 4774.25: 1506-045 (S) Undeclared identifier is_result_type.
    "c/_cffi_backend.c", line 4776.9: 1506-045 (S) Undeclared identifier ct.
    "c/_cffi_backend.c", line 4777.27: 1506-275 (S) Unexpected text ')' encountered.
    "c/_cffi_backend.c", line 4777.17: 1506-045 (S) Undeclared identifier ffi_type.
    "c/_cffi_backend.c", line 4777.40: 1506-277 (S) Syntax error: possible missing ')' or ','?
    "c/_cffi_backend.c", line 4780.17: 1506-045 (S) Undeclared identifier ffi_type_pointer.
    "c/_cffi_backend.c", line 4783.17: 1506-045 (S) Undeclared identifier ffi_type_void.
    "c/_cffi_backend.c", line 4794.19: 1506-045 (S) Undeclared identifier ffistruct.
    "c/_cffi_backend.c", line 4794.31: 1506-045 (S) Undeclared identifier ffifield.
    "c/_cffi_backend.c", line 4795.20: 1506-045 (S) Undeclared identifier elements.
    "c/_cffi_backend.c", line 4863.63: 1506-046 (S) Syntax error.
    "c/_cffi_backend.c", line 4863.28: 1506-098 (E) Missing argument(s).
    "c/_cffi_backend.c", line 4873.37: 1506-045 (S) Undeclared identifier fb.
    "c/_cffi_backend.c", line 4889.31: 1506-045 (S) Undeclared identifier FFI_TYPE_STRUCT.
    "c/_cffi_backend.c", line 4923.9: 1506-022 (S) "atypes" is not a member of "struct funcbuilder_s".
    "c/_cffi_backend.c", line 4923.55: 1506-046 (S) Syntax error.
    "c/_cffi_backend.c", line 4923.26: 1506-098 (E) Missing argument(s).
    error: command '/usr/vac/bin/xlc_r' failed with exit status 1

    ----------------------------------------
    Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-ic8Z4p-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-fzDSMi-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-ic8Z4p-build

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1056
  • Karma: +0/-0
Re: Error building CFFI from source.
« Reply #1 on: September 07, 2017, 06:37:44 PM »
I work on repackaging cffi. However, iirc python is 64-bit, so you should need to set, better export OBJECT_MODE=64 before calling pip.

Rich

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
Re: Error building CFFI from source.
« Reply #2 on: September 07, 2017, 07:05:17 PM »
Thanks Michael.  I read on another thread that this was probably needed so I had it exported already when I ran the build.
bash-4.2$ export
...
declare -x OBJECT_MODE="64"

Also these 2 paths do not exist:
/usr/include/ffi
/usr/include/libffi

They seem to be part of the build command.  But it seems that ffi is installed on the server.  I tried to install the latest PRM and it complained:
bash-4.2$ sudo rpm libffi-3.0.12-1.aix6.1.ppc.rpm
file /opt/freeware/lib/libffi.so.6 from install of libffi-3.0.12-1 conflicts with file from package libffi-3.0.11-1
file /opt/freeware/lib64/libffi.so.6 from install of libffi-3.0.12-1 conflicts with file from package libffi-3.0.11-1
file /opt/freeware/lib/libffi.a from install of libffi-3.0.12-1 conflicts with file from package libffi-3.0.11-1

Maybe the headers are missing so it can't build the extension?  Sorry, I am new to AIX and build errors always confuse me.
« Last Edit: September 07, 2017, 07:36:50 PM by Rich »

Rich

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
Re: Error building CFFI from source.
« Reply #3 on: September 07, 2017, 08:40:02 PM »
Was going to try and install libffi-devel-3.0.11-1.aix6.1.ppc.rpm from http://www.bullfreeware.com but that site is not running.  It seems like the Unixverse is out to get me.

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1056
  • Karma: +0/-0
Re: Error building CFFI from source.
« Reply #4 on: September 07, 2017, 08:54:38 PM »
You could try this instead.

http://download.aixtools.net/tools/aixtools.libffi.3.2.1.1.I

And are you using my python packaging: http://www.aixtools.net/index.php/python

I have not been keeping that up to date - trying to get a patch recognized (for easier Lib/ctypes usage (find_library() in particular. That cannot work on AIX - at least not without a lot of extra GNU stuff installed.

In any case - if you try my packaging, and something is not working - I did something wrong (i.e., did not test well enough).

The key is that I do not install, generally, in /usr. Instead I install in /opt/* - so if you add /opt/bin to your PATH then my packages are found. Libraries are in /opt/lib, etc..

As I have not done everything right - a previous poster downloaded everything from http://www.aixtools.net/index.php/python, http://download.aixtools.net/tools/python-eggs/salt/, and http://download.aixtools.net/tools/python-eggs/ansible/ and then did a "pip install cffi" to fix my error in packaging. Maybe that will work for you as well. See also: http://forums.rootvg.net/aixtools/problem-with-cffi-not-found/msg2726/#msg2726

p.s. If you want a later bash (you can install it in parallel with the BULL/Perzl/IBM version - see http://www.aixtools.net/index.php/bash

Be back tomorrow!

Rich

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
Re: Error building CFFI from source.
« Reply #5 on: September 08, 2017, 01:21:30 PM »
No I am just using the system python that was installed on the server originally.  It is our test server and it has limited space so i don't want to duplicate python installs or anything.  I am just trying to get the module installed in the system python.  I will try your cffi package and see if that works, but not sure how to install that.

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1056
  • Karma: +0/-0
Re: Error building CFFI from source.
« Reply #6 on: September 08, 2017, 01:49:10 PM »
Well, the system python is probably ancient. And python itself is not that big.

root@x065:[/opt/lib/python2.7]python --version
Python 2.7.12

root@x065:[/opt/lib/python2.7]du -sm .
88.23   .

p.s. This is after installing cffi.

p.p.s. Mine can be installed (and uninstalled) without disturbing the "system" python.

I just wrote a short article on building python packages using my version: See http://www.rootvg.net/content/view/812/169/

Rich

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
Re: Error building CFFI from source.
« Reply #7 on: September 08, 2017, 02:22:43 PM »
Thanks Michael.  Yeah the system python is 2.7.6 so I will go your route and install the newer version.  I did look at that article and it shows the build steps for cffi :)  not sure if building it under your version of python would be any different than the current python, but since you have supplied the package I should be OK.  I am new to the AIX tools and all the commands so I will poke around and try to get it all working.

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1056
  • Karma: +0/-0
Re: Error building CFFI from source.
« Reply #8 on: September 08, 2017, 02:34:15 PM »
As I say in my AIXTOOLS wiki - I got started using the "native" installp format because:
    * So-called RPM hell (there was no yum support)
    * The RPM packages sometimes broke AIX standard files (i.e., both wrote to /usr/*)
    * I did not find (read, look well enough) how to actually package using rpm and/or write .spec files.
    FYI: most packages just reuse the .spec files that come with a package - and maybe this is why they sometimes step on AIX installp files (RPM knows nothing about RPM and v.v.)

The only thing to remember is to either remove the .toc file (after you download new files), or re-run the command inutoc. If you do not know the inutoc command - just remove the file .toc and use 'smit install' to install the packages.

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1056
  • Karma: +0/-0
Re: Error building CFFI from source.
« Reply #9 on: September 08, 2017, 04:03:23 PM »
I am reorgnizing my downloads - but for cffi this should work, and I would be grateful for your testing the packaging.

Download the following to a single directory:
http://download.aixtools.net/tools/aixtools.python.2.7.12.3.I
http://download.aixtools.net/tools/aixtools.libffi.3.2.1.1.I
http://download.aixtools.net/tools/python/eggs/aixtools.python.pycparser.2.18.0.0.I
http://download.aixtools.net/tools/python/eggs/aixtools.python.cffi.1.10.0.0.I

And use 'smit install' to install 'all'