use cases for "python-config" versus "pkg-config python"
Hello! Stumbling over problems on AIX (Modules/python.exp not found) building libxml2 as python module let me wonder about the intended use-cases for 'python-config' and 'pkg-config python'. FWIW, I can see these distinct use cases here, and I'm kindly asking if I got them right: * Build an application containing a python interpreter (like python$EXE itself): + link against libpython.so + re-export symbols from libpython.so for python-modules (platform-specific) + This is similar to build against any other library, thus = 'python.pc' is installed (for 'pkg-config python'). * Build a python-module (like build/lib.<platform>-<pyver>/*.so): + no need to link against libpython.so, instead + expect symbols from libpython.so to be available at runtime, platform-specific either as + undefined symbols at build-time (Linux, others), or + a list of symbols to import from "the main executable" (AIX) + This is specific to python-modules, thus = 'python-config' is installed. Thank you! /haubi/
Hi, following up myself with a patch proposal: On 05/28/2014 04:51 PM, Michael Haubenwallner wrote:
Stumbling over problems on AIX (Modules/python.exp not found) building libxml2 as python module let me wonder about the intended use-cases for 'python-config' and 'pkg-config python'.
FWIW, I can see these distinct use cases here, and I'm kindly asking if I got them right:
* Build an application containing a python interpreter (like python$EXE itself): + link against libpython.so + re-export symbols from libpython.so for python-modules (platform-specific) + This is similar to build against any other library, thus = 'python.pc' is installed (for 'pkg-config python').
* Build a python-module (like build/lib.<platform>-<pyver>/*.so): + no need to link against libpython.so, instead + expect symbols from libpython.so to be available at runtime, platform-specific either as + undefined symbols at build-time (Linux, others), or + a list of symbols to import from "the main executable" (AIX) + This is specific to python-modules, thus = 'python-config' is installed.
Based on these use-cases, I'm on a trip towards a patch improving AIX support here, where the attached one is a draft against python-tip (next step is to have python-config not print $LIBS, but $LINKFORMODULE only). Thoughts? Thank you! /haubi/
Patches sent to python-dev are typically ignored. Could you open an issue on bugs.python.org and upload it there? On Mon Jun 02 2014 at 2:20:43 PM, Michael Haubenwallner < michael.haubenwallner@ssi-schaefer.com> wrote:
Hi,
following up myself with a patch proposal:
Stumbling over problems on AIX (Modules/python.exp not found) building
let me wonder about the intended use-cases for 'python-config' and 'pkg-config python'.
FWIW, I can see these distinct use cases here, and I'm kindly asking if I got them right:
* Build an application containing a python interpreter (like python$EXE itself): + link against libpython.so + re-export symbols from libpython.so for python-modules (platform-specific) + This is similar to build against any other library, thus = 'python.pc' is installed (for 'pkg-config python').
* Build a python-module (like build/lib.<platform>-<pyver>/*.so): + no need to link against libpython.so, instead + expect symbols from libpython.so to be available at runtime,
On 05/28/2014 04:51 PM, Michael Haubenwallner wrote: libxml2 as python module platform-specific either as
+ undefined symbols at build-time (Linux, others), or + a list of symbols to import from "the main executable" (AIX) + This is specific to python-modules, thus = 'python-config' is installed.
Based on these use-cases, I'm on a trip towards a patch improving AIX support here, where the attached one is a draft against python-tip (next step is to have python-config not print $LIBS, but $LINKFORMODULE only).
Thoughts?
Thank you! /haubi/
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/ brett%40python.org
Am 02.06.2014 20:11, schrieb Michael Haubenwallner:
Hi,
following up myself with a patch proposal:
On 05/28/2014 04:51 PM, Michael Haubenwallner wrote:
Stumbling over problems on AIX (Modules/python.exp not found) building libxml2 as python module let me wonder about the intended use-cases for 'python-config' and 'pkg-config python'.
FWIW, I can see these distinct use cases here, and I'm kindly asking if I got them right:
* Build an application containing a python interpreter (like python$EXE itself): + link against libpython.so + re-export symbols from libpython.so for python-modules (platform-specific) + This is similar to build against any other library, thus = 'python.pc' is installed (for 'pkg-config python').
* Build a python-module (like build/lib.<platform>-<pyver>/*.so): + no need to link against libpython.so, instead + expect symbols from libpython.so to be available at runtime, platform-specific either as + undefined symbols at build-time (Linux, others), or + a list of symbols to import from "the main executable" (AIX) + This is specific to python-modules, thus = 'python-config' is installed.
Based on these use-cases, I'm on a trip towards a patch improving AIX support here, where the attached one is a draft against python-tip (next step is to have python-config not print $LIBS, but $LINKFORMODULE only).
Thoughts?
there is http://bugs.python.org/issue15590 I think it is worth improving, together with adding documentation, and maybe distinguishing the two use cases linking for a module or an embedded interpreter. Matthias
participants (3)
-
Brett Cannon
-
Matthias Klose
-
Michael Haubenwallner