|
2 | 2 | # |
3 | 3 | # SPDX-License-Identifier: Apache-2.0 |
4 | 4 |
|
5 | | -# How does the build system for cuquantum-python work? |
6 | | -# |
7 | | -# - When building a wheel ("pip wheel", "pip install .", or "python setup.py |
8 | | -# bdist_wheel" (discouraged!)), we want to build against the cutensor & |
9 | | -# cuquantum wheels that would be installed to site-packages, so we need |
10 | | -# two things: |
11 | | -# 1. make them the *build-time* dependencies |
12 | | -# 2. set up linker flags to modify rpaths |
13 | | -# |
14 | | -# - For 1. we opt in to use PEP-517, as setup_requires is known to not work |
15 | | -# automatically for users. This is the "price" we pay (by design of |
16 | | -# PEP-517), as it creates a new, "isolated" environment (referred to as |
17 | | -# build isolation) to which all build-time dependencies that live on PyPI |
18 | | -# are installed. Another "price" (also by design) is in the non-editable |
19 | | -# mode (without the "-e" flag) it always builds a wheel for installation. |
20 | | -# |
21 | | -# - For 2. the solution is to create our own bdist_wheel (called first) and |
22 | | -# build_ext (called later) commands. The former would inform the latter |
23 | | -# whether we are building a wheel. |
24 | | -# |
25 | | -# - There is an escape hatch for 1. which is to set "--no-build-isolation". |
26 | | -# Then, users are expected to set CUQUANTUM_ROOT (or CUSTATEVEC_ROOT & |
27 | | -# CUTENSORNET_ROOT) and manage all build-time dependencies themselves. |
28 | | -# This, together with "-e", would not produce any wheel, which is the old |
29 | | -# behavior offered by the environment variable CUQUANTUM_IGNORE_SOLVER=1 |
30 | | -# that we removed and no longer works. |
31 | | -# |
32 | | -# - In any case, the custom build_ext command is in use, which would compute |
33 | | -# the needed compiler flags (depending on it's building a wheel or not) |
34 | | -# and overwrite the incoming Extension instances. |
35 | | -# |
36 | | -# - In any case, the dependencies (on PyPI wheels) are set up by default, |
37 | | -# and "--no-deps" can be passed as usual to tell pip to ignore the |
38 | | -# *run-time* dependencies. |
0 commit comments