building 3.7.1 from source, _ctypes and libffi troubles
fetchinson at googlemail.com
Tue Dec 25 07:53:53 EST 2018
>> And as far as I know pkg-config is used by python's configure script
>> so everything should be fine. I also set
>> LD_LIBRARY_PATH=/home/fetch/opt/lib:/home/fetch/opt/lib64 and also
> I looked into this a little. I found that setting C_INCLUDE_PATH as you
> did disables finding libffi headers since pkg-config prints nothing with
> pkg-config --cflags libffi then and it seems the headers are found with
This didn't actually occur for me, I had C_INCLUDE_PATH set and your
second suggestion (see below) worked.
> As for the libraries, detect_modules() in setup.py wants to find extra
> library directories from the generated makefile so you need to make sure
> they actually go in there, like this for example:
> LDFLAGS=`pkg-config --libs-only-L libffi` ./configure
> Then you'll have CONFIGURE_LDFLAGS and PY_LDFLAGS set in the generated
> makefile and setup.py will pick up the directory from there.
Thanks a lot! This indeed worked, now _ctypes compiles no problemlo!
> Anyways, hope it helps. This worked for me on Ubuntu 16.04.5 LTS.
More information about the Python-list