[issue34823] libffi detection doesn’t work in my setup

Daniel Fetchinson cpython at roundup.psfhosted.org
Fri Dec 21 15:36:15 EST 2018


Daniel Fetchinson <fetchinson at gmail.com> added the comment:

I have the exact same issue, trying to compile 3.7.1 with a custom libffi location. Note that I must build libffi from source and can't install binaries provided by my distro, I believe this is the origin of the problem. Probably the python build system checks for libffi in some "standard" locations and it doesn't seem possible to use libffi from a custom location.

This is where libffi gets installed after passing --prefix=$HOME/opt to ./configure:


$HOME/opt/lib64/libffi.so.6.0.4
$HOME/opt/lib64/libffi.a
$HOME/opt/lib64/libffi.la
$HOME/opt/lib64/libffi.so.6
$HOME/opt/lib64/libffi.so
$HOME/opt/lib/pkgconfig/libffi.pc
$HOME/opt/lib/libffi-3.2.1/include/ffi.h
$HOME/opt/lib/libffi-3.2.1/include/ffitarget.h
$HOME/opt/share/info/libffi.info

In any case, just to be sure, I've copied the header files to

$HOME/opt/include/ffi.h
$HOME/opt/include/ffitarget.h

And pkg-config works:

[fetch at fetch opt]$ pkg-config --libs libffi
-L/home/fetch/opt/lib/../lib64 -lffi

[fetch at fetch opt]$ pkg-config --cflags libffi
-I/home/fetch/opt/lib/libffi-3.2.1/include

These environment variables are also set:

LD_LIBRARY_PATH=/home/fetch/opt/lib:/home/fetch/opt/lib64

C_INCLUDE_PATH=/home/fetch/opt/include

And still _ctypes fails to build (but python itself (minus _ctypes) compiles successful and works perfectly well).

----------
nosy: +fetchinson

______________________________________________
Python tracker <cpython at roundup.psfhosted.org>
<https://bugs.python.org/issue34823>
______________________________________________


More information about the Python-bugs-list mailing list