3cc5b7adc7
Python extensions use CC and LDSHARED from the sysconfig module to build. When Spack installs Python, it replaces the Spack compiler wrappers in these values with the underlying compilers (since these wrappers are not useful outside of the context of running Spack). In order to use the Spack compiler wrappers when building Python extensions with Spack, Spack sets the LDSHARED environment variable when running `Python.setup_py` (which overrides sysconfig). However, many Python extensions use an alternative method to build (namely PythonPackage.setup_py), which meant that LDSHARED was not set (and RPATHs were not inserted for dependencies). This commit makes the following changes: * Sets LDSHARED in the environment: this applies to all commands executed during the build, rather than for a single command invocation * Updates the logic to set LDSHARED: this replaces the compiler executable in LDSHARED with the Spack compiler wrapper. This means that for some externally-built instances of Python, Spack will now switch to using the Spack wrappers when building extensions. The behavior is expected to be the same for Spack- built instances of Python. * Performs similar modifications for LDCXXSHARED (to ensure RPATHs are included for C++ codes) |
||
---|---|---|
.. | ||
spack |