FindPythonLibs and pypy

I’m somewhat out of my depth here, but trying to get a auto-generated conda PR https://github.com/conda-forge/stir-feedstock/pull/16 to work with pypy.

Our CMakeLists.txt uses simply

  find_package(PythonInterp)
  FIND_PACKAGE(PythonLibs REQUIRED)

but this fails on the find PythonLibs. Checking with (command line) find I get

$PREFIX/bin/python
$PREFIX/include/Python.h
$PREFIX/include/Python.h
$PREFIX/bin/libpypy3-c.so.debug
$PREFIX/lib/libpypy3-c.so

anyone any suggestions for handling pypy (portably?)

I suggest using the new find_package(Python) (or Python3 if you don’t need 2). That probably behaves better with other implementations.

thanks Ben. I haven’t tried yet, but I had quick a look at the FindPython.cmake and FindPython/Support.cmake source and can’t find any mention of pypy. Although I guess that doesn’t mean it won’t work of course… Anyone any experience with that?

pypy is not yet supported but you can specify manually the library by setting variable Python3_LIBRARY before calling find_package(Python3 ...). Note the support of input variables was introduced in v3.16.