I’m building a Python module that I’d like to distribute to multiple linux distributions, some of which will have less recent versions of gcc than I am building with, hence I am using manylinux. In particular, I’m using manylinux_2_28, which is alma (Red Hat family) based and provides gcc12.
Having downloaded the image, I’ve cloned my repo, and have almost gotten CMake configure to work. The problem starts with
find_package(Python3 ${REQUESTED_PYTHON_VERSION} COMPONENTS Interpreter Development)
which gives
Could NOT find Python3 (missing: Python3_LIBRARIES Development Development.Embed) (found version "3.12.3")
and subsequently the configuration errors out when bringing in pybind11.
The image provides Python
CPython 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and PyPy 3.7, 3.8, 3.9, 3.10 installed in /opt/python/-. The directories are named after the PEP 425 tags for each environment –e.g. /opt/python/cp37-cp37m contains a CPython 3.7 build, and can be used to produce wheels named like –cp37-cp37m-.whl.
hence before my configuration I prefix my PATH
with /opt/python/cp312-cp312/bin
so that which python3
=> /opt/python/cp312-cp312/bin/python3
.
How can I fix this problem? I’d hope that Python development is already available for each provided version, and I’m just missing some configuration (ls /opt/python/cp312-cp312
=> bin include lib share
). I’m not familiar with Alma / Red Hat, and while I tried, and failed, to find the equivalent of python3-dev
on Alma, I’m not sure I should be installing some additional o/s package which might be specific to a particular Python minor version.