Re: compiling 3.7.0 from source with custom libffi path
Hi, I dont have "lib64" in libffi, are you sure it is "lib64" or just "lib"? On Monday, 1 July 2019 21:32:46 UTC+9, tom...@gmail.com wrote: > On Monday, September 24, 2018 at 11:48:59 AM UTC+3, Fetchinson . wrote: > > I'm trying to compile python 3.7.0 from source with a custom libffi > > path and the compiler/linker doesn't seem to pick up the right > > version. The system libffi doesn't have the development files so I've > > installed the latest libffi (also from source) to /opt/custom but > > still I get > > > > INFO: Could not locate ffi libs and/or headers > > > > Failed to build these modules: > > _ctypes > > > > Although I compile python with --prefix=/opt/custom because that's the > > location I'd like to install it too. So how do I tell the build system > > where to find my custom libffi? > > > > Cheers, > > Daniel > > > > > > > > -- > > Psss, psss, put it down! - http://www.cafepress.com/putitdown > > After some messing around with the build scripts, I figured it out. This > works for me: > > 0. Choose installation path for FFI -> $LIBFFI_PATH > 1. Configure, build, install libffi: > 1a. Download libffi from https://sourceware.org/libffi/ and untar it > 1b. ./configure --prefix $LIBFFI_PATH > 1c. make > 1d. make install > 2. Configure CPython: (I'm using tcsh syntax, it is slightly different with > bash) > 2a. setenv PKG_CONFIG_PATH $LIBFFI_PATH/lib/pkgconfig/ > 2b. setenv LDFLAGS "-L $LIBFFI_PATH/lib64/" > 2c. /configure --with-pydebug > 3. Build > 3a. setenv LD_LIBRARY_PATH "${LIBFFI_PATH}/lib64/" > 3b. make -s -j2 > > Good luck! -- https://mail.python.org/mailman/listinfo/python-list
Re: compiling 3.7.0 from source with custom libffi path
On Monday, September 24, 2018 at 11:48:59 AM UTC+3, Fetchinson . wrote: > I'm trying to compile python 3.7.0 from source with a custom libffi > path and the compiler/linker doesn't seem to pick up the right > version. The system libffi doesn't have the development files so I've > installed the latest libffi (also from source) to /opt/custom but > still I get > > INFO: Could not locate ffi libs and/or headers > > Failed to build these modules: > _ctypes > > Although I compile python with --prefix=/opt/custom because that's the > location I'd like to install it too. So how do I tell the build system > where to find my custom libffi? > > Cheers, > Daniel > > > > -- > Psss, psss, put it down! - http://www.cafepress.com/putitdown After some messing around with the build scripts, I figured it out. This works for me: 0. Choose installation path for FFI -> $LIBFFI_PATH 1. Configure, build, install libffi: 1a. Download libffi from https://sourceware.org/libffi/ and untar it 1b. ./configure --prefix $LIBFFI_PATH 1c. make 1d. make install 2. Configure CPython: (I'm using tcsh syntax, it is slightly different with bash) 2a. setenv PKG_CONFIG_PATH $LIBFFI_PATH/lib/pkgconfig/ 2b. setenv LDFLAGS "-L $LIBFFI_PATH/lib64/" 2c. /configure --with-pydebug 3. Build 3a. setenv LD_LIBRARY_PATH "${LIBFFI_PATH}/lib64/" 3b. make -s -j2 Good luck! -- https://mail.python.org/mailman/listinfo/python-list
Re: compiling 3.7.0 from source with custom libffi path
Exactly same issue.. ctypes wont build .. pkg-config finds libffi, headers are located in configure and still INFO: Could not locate ffi libs and/or headers python is getting really annoying to install .. not everyone has root privileges to install system-wide dependencies. On Tuesday, September 25, 2018 at 12:11:51 AM UTC+5:30, Fetchinson . wrote: > On 9/24/18, Thomas Jollans wrote: > > On 2018-09-24 16:30, Fetchinson . via Python-list wrote: > >> [fetch@fetch]$ grep LIBFFI_INCLUDE Makefile > >> LIBFFI_INCLUDEDIR= /opt/custom/lib/libffi-3.2.1/include > >> > >> So I'd say everything should work but it doesn't, I reran ./configure > >> and also make of course. > > > > I'm confused. ./configure succeeds? Then where's the error? > > Yes, ./configure succeeds, also make succeeds in general, so it > produces a usable python executable but _ctypes is not compiled so > _ctypes is not usable and can not be imported, libffi is only needed > for _ctypes AFAIK. The error, or better said INFO message, comes from > make: > > INFO: Could not locate ffi libs and/or headers > > Failed to build these modules: > _ctypes > > But nevertheless make install also succeeds, the only thing is that > _ctypes does not work. > > Cheers, > Daniel > > -- > Psss, psss, put it down! - http://www.cafepress.com/putitdown -- https://mail.python.org/mailman/listinfo/python-list
Re: compiling 3.7.0 from source with custom libffi path
On 9/24/18, Thomas Jollans wrote: > On 2018-09-24 16:30, Fetchinson . via Python-list wrote: >> [fetch@fetch]$ grep LIBFFI_INCLUDE Makefile >> LIBFFI_INCLUDEDIR= /opt/custom/lib/libffi-3.2.1/include >> >> So I'd say everything should work but it doesn't, I reran ./configure >> and also make of course. > > I'm confused. ./configure succeeds? Then where's the error? Yes, ./configure succeeds, also make succeeds in general, so it produces a usable python executable but _ctypes is not compiled so _ctypes is not usable and can not be imported, libffi is only needed for _ctypes AFAIK. The error, or better said INFO message, comes from make: INFO: Could not locate ffi libs and/or headers Failed to build these modules: _ctypes But nevertheless make install also succeeds, the only thing is that _ctypes does not work. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- https://mail.python.org/mailman/listinfo/python-list
Re: compiling 3.7.0 from source with custom libffi path
On 2018-09-24 16:30, Fetchinson . via Python-list wrote: > [fetch@fetch]$ grep LIBFFI_INCLUDE Makefile > LIBFFI_INCLUDEDIR= /opt/custom/lib/libffi-3.2.1/include > > So I'd say everything should work but it doesn't, I reran ./configure > and also make of course. I'm confused. ./configure succeeds? Then where's the error? -- https://mail.python.org/mailman/listinfo/python-list
Re: compiling 3.7.0 from source with custom libffi path
On 9/24/18, Thomas Jollans wrote: > On 2018-09-24 14:14, Fetchinson . via Python-list wrote: I'm trying to compile python 3.7.0 from source with a custom libffi path and the compiler/linker doesn't seem to pick up the right version. The system libffi doesn't have the development files so I've installed the latest libffi (also from source) to /opt/custom but still I get INFO: Could not locate ffi libs and/or headers >>> >>> Apparently the configure script uses pkg-config to locate libffi.[1] You >>> should be able to get it to find your libffi by setting PKG_CONFIG_PATH >>> appropriately (probably to "/opt/custom/lib/pkgconfig" ?) >>> >>> [1]: https://github.com/python/cpython/blob/v3.7.0/configure.ac#L2936 >> >> Thanks, tried it, but still no luck, exact same error message. > > Is there a .pc file for libffi? Can you run pkg-config manually, to > check if it works, and finds libffi in your environment? Yes, there is a .pc for libffi and if I first export PKG_CONFIG_PATH=/opt/custom then pkg-config finds the necessary include path: [fetch@fetch]$ pkg-config libffi --cflags-only-I -I/opt/custom/lib/libffi-3.2.1/include And of course this path is correct: [fetch@fetch]$ ls /opt/custom/lib/libffi-3.2.1/include ffi.h ffitarget.h And also the configure script correctly creates the Makefile: [fetch@fetch]$ grep LIBFFI_INCLUDE Makefile LIBFFI_INCLUDEDIR= /opt/custom/lib/libffi-3.2.1/include So I'd say everything should work but it doesn't, I reran ./configure and also make of course. Cheers, Daniel >> >> Cheers, >> Daniel >> >> >> Failed to build these modules: _ctypes Although I compile python with --prefix=/opt/custom because that's the location I'd like to install it too. So how do I tell the build system where to find my custom libffi? Cheers, Daniel >>> -- >>> https://mail.python.org/mailman/listinfo/python-list >>> >> >> > -- > https://mail.python.org/mailman/listinfo/python-list > -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- https://mail.python.org/mailman/listinfo/python-list
Re: compiling 3.7.0 from source with custom libffi path
On 2018-09-24 14:14, Fetchinson . via Python-list wrote: >>> I'm trying to compile python 3.7.0 from source with a custom libffi >>> path and the compiler/linker doesn't seem to pick up the right >>> version. The system libffi doesn't have the development files so I've >>> installed the latest libffi (also from source) to /opt/custom but >>> still I get >>> >>> INFO: Could not locate ffi libs and/or headers >> >> Apparently the configure script uses pkg-config to locate libffi.[1] You >> should be able to get it to find your libffi by setting PKG_CONFIG_PATH >> appropriately (probably to "/opt/custom/lib/pkgconfig" ?) >> >> [1]: https://github.com/python/cpython/blob/v3.7.0/configure.ac#L2936 > > Thanks, tried it, but still no luck, exact same error message. Is there a .pc file for libffi? Can you run pkg-config manually, to check if it works, and finds libffi in your environment? > > Cheers, > Daniel > > > >>> >>> Failed to build these modules: >>> _ctypes >>> >>> Although I compile python with --prefix=/opt/custom because that's the >>> location I'd like to install it too. So how do I tell the build system >>> where to find my custom libffi? >>> >>> Cheers, >>> Daniel >>> >>> >>> >> -- >> https://mail.python.org/mailman/listinfo/python-list >> > > -- https://mail.python.org/mailman/listinfo/python-list
Re: compiling 3.7.0 from source with custom libffi path
>> I'm trying to compile python 3.7.0 from source with a custom libffi >> path and the compiler/linker doesn't seem to pick up the right >> version. The system libffi doesn't have the development files so I've >> installed the latest libffi (also from source) to /opt/custom but >> still I get >> >> INFO: Could not locate ffi libs and/or headers > > Apparently the configure script uses pkg-config to locate libffi.[1] You > should be able to get it to find your libffi by setting PKG_CONFIG_PATH > appropriately (probably to "/opt/custom/lib/pkgconfig" ?) > > [1]: https://github.com/python/cpython/blob/v3.7.0/configure.ac#L2936 Thanks, tried it, but still no luck, exact same error message. Cheers, Daniel >> >> Failed to build these modules: >> _ctypes >> >> Although I compile python with --prefix=/opt/custom because that's the >> location I'd like to install it too. So how do I tell the build system >> where to find my custom libffi? >> >> Cheers, >> Daniel >> >> >> > -- > https://mail.python.org/mailman/listinfo/python-list > -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- https://mail.python.org/mailman/listinfo/python-list
Re: compiling 3.7.0 from source with custom libffi path
On 2018-09-24 10:48, Fetchinson . via Python-list wrote: > I'm trying to compile python 3.7.0 from source with a custom libffi > path and the compiler/linker doesn't seem to pick up the right > version. The system libffi doesn't have the development files so I've > installed the latest libffi (also from source) to /opt/custom but > still I get > > INFO: Could not locate ffi libs and/or headers Apparently the configure script uses pkg-config to locate libffi.[1] You should be able to get it to find your libffi by setting PKG_CONFIG_PATH appropriately (probably to "/opt/custom/lib/pkgconfig" ?) [1]: https://github.com/python/cpython/blob/v3.7.0/configure.ac#L2936 > > Failed to build these modules: > _ctypes > > Although I compile python with --prefix=/opt/custom because that's the > location I'd like to install it too. So how do I tell the build system > where to find my custom libffi? > > Cheers, > Daniel > > > -- https://mail.python.org/mailman/listinfo/python-list