title: Not able to install cffi python package in AIX box
body: <p>I am trying to install cffi package using pip for python 3.5 on AIX server, but it is failing with an error about xlc_r and also about not finding libffi package.</p>
  
  <p>pip install cffi </p>
  
  <pre><code>ERROR: Command errored out with exit status 1:
       command: /path/to/my/venv/privpyenv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2x788gcb/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2x788gcb/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-6kyp6skh/install-record.txt --single-version-externally-managed --compile --install-headers /path/to/my/venv/privpyenv/include/site/python3.5/cffi
           cwd: /tmp/pip-install-2x788gcb/cffi/
      Complete output (68 lines):
      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
      unable to execute 'xlc_r': Not a directory
      unable to execute 'xlc_r': Not a directory
  
          No working compiler found, or bogus compiler options passed to
          the compiler from Python's standard "distutils" module.  See
          the error messages above.  Likely, the problem is not related
          to CFFI but generic to the setup.py of any Python package that
          tries to compile C code.  (Hints: on OS/X 10.8, for errors about
          -mno-fused-madd see http://stackoverflow.com/questions/22313407/
          Otherwise, see https://wiki.python.org/moin/CompLangPython or
          the IRC channel #python on irc.freenode.net.)
  
          Trying to continue anyway.  If you are trying to install CFFI from
          a build done in a different context, you can ignore this warning.
  
      running install
      running build
      running build_py
      creating build
      creating build/lib.aix-7.1-3.5
      creating build/lib.aix-7.1-3.5/cffi
      copying cffi/__init__.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/api.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/backend_ctypes.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/cffi_opcode.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/commontypes.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/cparser.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/error.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/ffiplatform.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/lock.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/model.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/pkgconfig.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/recompiler.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/setuptools_ext.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/vengine_cpy.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/vengine_gen.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/verifier.py -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/_cffi_include.h -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/parse_c_type.h -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/_embedding.h -&gt; build/lib.aix-7.1-3.5/cffi
      copying cffi/_cffi_errors.h -&gt; build/lib.aix-7.1-3.5/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.aix-7.1-3.5
      creating build/temp.aix-7.1-3.5/c
      xlc_r -DNDEBUG -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr4 -q64 -I/opt/buildaix/includes -I/usr/include/ffi -I/usr/include/libffi -I/path/to/my/venv/privpyenv/include -I/opt/include/python3.5m -c c/_cffi_backend.c -o build/temp.aix-7.1-3.5/c/_cffi_backend.o
      unable to execute 'xlc_r': Not a directory
      error: command 'xlc_r' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /path/to/my/venv/privpyenv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2x788gcb/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2x788gcb/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-6kyp6skh/install-record.txt --single-version-externally-managed --compile --install-headers /path/to/my/venv/privpyenv/include/site/python3.5/cffi Check the logs for full command output.
  </code></pre>
  
  <p>Where I found libffi:</p>
  
  <pre><code>/opt/freeware/lib &gt; ls -lrt | grep libffi
  -rwxr-xr-x    1 root     system        25553 Nov 25 2014  libffi.so.6
  -rwxr-xr-x    1 root     system        92378 Nov 25 2014  libffi.so.5
  -rwxr-xr-x    1 root     system       250592 Nov 25 2014  libffi.a
  </code></pre>
  
  <p>I tried this <a href="http://www.rootvg.net/content/view/812/169/" rel="nofollow noreferrer">http://www.rootvg.net/content/view/812/169/</a>. Did not work.
  I am using python3.5 on AIX 7.1</p>
  
  <p>Expecting suggestions about a fix here.</p>