[pypy-dev] Autotools integration / How to determine .so filename extension

Matti Picus matti.picus at gmail.com
Sat Jul 10 13:51:09 EDT 2021


On 10/7/21 4:44 pm, Roland Lutz wrote:
> How do I determine the correct filename extension for PyPy extension 
> modules?
>

The canonical way is to use sysconfig


pypy -c "import sysconfig;print(sysconfig.get_config_var('EXT_SUFFIX'))"

.pypy37-pp73-x86_64-linux-gnu.so


On python2.7 use 'SO'

~/oss/pypy2.7-HEAD/bin/pypy -c "import 
sysconfig;print(sysconfig.get_config_var('SO'))"

.pypy-73.so


If you wish to cross-compile or do not want to run python to find the 
values, pypy7.3.5+ on linux now ship a CPython compatible file with all 
the values pre-computed. The file is

<pypy-directory>/lib_pypy/_sysconfigdata__linux*.py

Matti



More information about the pypy-dev mailing list