我要评分
获取效率
正确性
完整性
易理解

Source Code Compilation and Build

Obtain the NumPy source code, build a wheel from the source code, and install the local build product.

  1. Obtain the NumPy 2.4.4 source code.
    1
    2
    3
    mkdir -p /tmp/numpy-build/dist
    python3 -m pip download --no-build-isolation --no-binary=:all: --no-deps \   
      --dest /tmp/numpy-build numpy==2.4.4
    

    --no-binary=:all is used to disable the download of the precompiled wheel and ensure that the source package is obtained and local build is performed.

  2. Build the wheel from the source package.
    1
    2
    python3 -m pip wheel --no-build-isolation --no-binary=:all: --no-deps \   
      --wheel-dir /tmp/numpy-build/dist /tmp/numpy-build/numpy-2.4.4.tar.gz
    

    The following is an example of the build product.

    1
    numpy-2.4.4-cp311-cp311-linux_aarch64.whl
    
  3. Install the local build product.
    1
    python3 -m pip install --no-index --find-links /tmp/numpy-build/dist numpy==2.4.4