Ned Deily <n...@python.org> added the comment:

As of current Python 3 releases, like 3.8, the python build no longer vendors a 
copy of libffi for most Unix systems and for those systems the 
--with-system-ffi configure option is ignored, i.e. configure and setup.py will 
always try to find an external libffi.  On most systems, if you use are OK with 
using the system-supplied libffi, building and execution should usually "just 
work".  But if you want to use another version of libffi, for example, one that 
you build from source, it can be very non-intuitive of how to successfully do 
that *especially* if there is already a system libffi installed.  Depending on 
the system, you may need to set environment build variables like LDFLAGS, 
CFLAGS or PKG_CONFIG_PATH, and LD_LIBRARY_PATH for the Python build and/or you 
might need to override some of the libffi build variables to install in the 
proper locations for your system.  It seems like, as has been suggested in 
various places, setup.py should at least try to use pkg-config to find libff
 i library locations as it already does to find libffi include files. But that 
might not be enough to get a working setup, i.e. you still might need to set 
LD_LIBRARY_PATH or the equivalent to find libffi. At the very least, there 
should be some documentation on how to build with a non-system libffi.

----------
components: +Build
nosy: +ned.deily
title: How to link with an external libffi? -> How to link with a non-system 
libffi?
versions: +Python 3.8, Python 3.9 -Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue14527>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to