FindPython: pyconfig.h may be a compatibility header on Debian.
Hello,
I have encountered an issue with FindPython on Ubuntu 16.04 with the libpython3.5-dbg package installed and CMake 3.18.2.
The python-config tool is located at /usr/bin/x86_64-linux-gnu-python3.5dm-config
, and the output of --includes
is the following:
> /usr/bin/x86_64-linux-gnu-python3.5dm-config --includes
-I/usr/include/python3.5dm -I/usr/include/python3.5dm
But the pyconfig.h
file located at that path (/usr/include/python3.5dm/pyconfig.h)
is a compatibility header that pretty much only includes another depending on the platform. For instance for me, it does the following:
# if defined(__x86_64__) && defined(__LP64__)
# include <x86_64-linux-gnu/python3.5dm/pyconfig.h>
That header (/usr/include/x86_64-linux-gnu/python3.5dm/pyconfig.h
) contains all the variable definitions for the python configuration.
The FindPython module uses the output of the python-config tool and tries to parse (at line 604) the /usr/include/python3.5dm/pyconfig.h
file (which is the redirection header).
The parsing fails and _Python_INC_ABI
is set to an empty string. This makes the condition at line 2810 fail if _Python_FIND_ABI
is set, which is my case (I'm trying to force the use of the debug interpreter by setting Python_FIND_ABI
to "ON;ANY;ANY") and it results in the Development component not found.
Thank you for your help.