---
title: 环境配置
description: "在进行源码编译构建前需要安装对应版本的依赖组件。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengai/ecosystemEnable/paddleInference/kunpengpaddleinference_16_0004.html
sourcePath: /source/zh/kunpengai/ecosystemEnable/paddleInference/kunpengpaddleinference_16_0004.html
indexId: ab1dbe56ffa3a2ec9d23f14871ecc3e960ea94cd4596d15c1e375d937214e16788
---
# 环境配置

在进行源码编译构建前需要安装对应版本的依赖组件。

1. 安装系统依赖。
  1 2 3 4 5 6 7 8 dnf install -y \ --setopt=install_weak_deps=False \ --setopt=tsflags=nodocs \ git gcc gcc-c++ gfortran make cmake ninja-build \ python3 python3-pip python3-devel \ openssl-devel bzip2-devel zlib-devel xz-devel libffi-devel \ sqlite-devel readline-devel patchelf tar xz wget curl \ findutils diffutils patch which file openblas-devel lapack-devel

2. 安装Python构建依赖。
  1 2 3 4 python3 -m pip install --upgrade pip setuptools wheel python3 -m pip install \ numpy pybind11 Cython pyyaml packaging requests six protobuf \ typing_extensions decorator opt_einsum networkx astor gast Pillow ninja

3. 安装CUDA Toolkit和cuDNN后，设置编译环境变量。以下路径以CUDA 13.0的默认安装路径为例。
  1 2 3 4 5 6 export CUDA_HOME=/usr/local/cuda-13.0 export PATH=${CUDA_HOME}/bin:${PATH} export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-} nvcc --version test -f ${CUDA_HOME}/include/cudnn_version.h
