FT_DSP.gitlink.net/master/html/_sources/quickstart/installation.md.txt

146 lines
5.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 环境安装
## 安装MindSpore Radar 与依赖软件
|软件名称|版本|作用|
|-|-|-|
|Windows|7/10/11|编译和运行MindSpore的操作系统|
|{ref}`Python <install-python>`|3.8|MindSpore的使用依赖Python环境|
|{ref}`MindSpore <install-mindspore>`|2.3.1|MindRadar依赖的底层框架|
|{ref}`MindRadar <install-mindradar>`|0.0.0|数字信号处理套件|
|{ref}`arm-linux-gnueabihf <toolchain>`|7.5.0|用于编译MindSpore Signal+ C++ 应用的编译器|
|{ref}`YHFT-IDE <install-yhft-ide>`|0.0.1|集成开发环境|
|{ref}`CMake <install-cmake>`|3.30.5|强大的软件构建系统|
|{ref}`Netron <install-netron>`|6.2.0|模型可视化工具|
上述所有软件包可以通过在线链接提取:[软件资源包](https://)
(install-python)=
### 安装Python
本文提供两种不同的安装方式,自行选择合适的方式安装。
#### 1.安装包方式安装
##### 1.1 下载安装包
根据机器的操作系统版本在官网下载32位或64位windows版本的python3.8安装包:
64位[https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe)
32位[https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe](https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe)
##### 1.2 开始安装
双击打开python安装包选择Customize installation方式安装并勾选`Add python3.8 to PATH`。如下图:
<img src="../_static/python_install_step1.png" alt="python_install_step1" width="auto"/>
接着按默认选项点击下一步,可以根据需求选择安装路径,以及是否安装给所有用户。如下图:
<img src="../_static/python_install_step2.png" alt="python_install_step2" width="auto"/>
安装成功界面如下:
<img src="../_static/python_install_success.png" alt="python_install_success" width="auto"/>
##### 1.3 验证安装
可以在cmd命令窗口通过以下命令查看Python版本。
```bash
python --version
```
#### 2.Conda方式安装
[Conda](https://docs.conda.io/en/latest/)是一个开源跨平台语言无关的包管理与环境管理系统,允许用户方便地安装不同版本的二进制软件包,以及该计算平台需要的所有库。
- 确认安装Windows是x86架构64位操作系统。
- 确认安装与当前系统兼容的Conda版本。
- 如果您喜欢Conda提供的完整能力可以选择下载[Anaconda3](https://repo.anaconda.com/archive/)。
- 如果您需要节省磁盘空间或者喜欢自定义安装Conda软件包可以选择下载[Miniconda3](https://repo.anaconda.com/miniconda/)。
##### 创建并进入Conda虚拟环境
在Windows上使用Anaconda请通过`开始 | Anaconda3 | Anaconda Promt`打开Anaconda命令行。
根据您希望使用的Python版本创建对应的Conda虚拟环境并进入虚拟环境。
如果您希望使用Python3.8.10版本:
```bash
conda create -c conda-forge -n mindspore_py38 -c conda-forge python=3.8.10
conda activate mindspore_py38
```
(install-mindspore)=
### 安装MindSpore
通过`pip install mindspore-xxx-win_amd64.whl`命令安装MindSpore。验证是否成功安装执行以下命令
```bash
python -c "import mindspore;mindspore.set_context(device_target='CPU');mindspore.run_check()"
```
如果输出:
```text
MindSpore version: 版本号
The result of multiplication calculation is correct, MindSpore has been installed on platform [CPU] successfully!
```
说明MindSpore安装成功了。
```{note}
在安装mindspore过程中会自动下载依赖库如果下载失败可以尝试手动安装依赖库。提供的软件资源包中包含了依赖库进入`third-party`文件夹,通过`pip install -r requirements.txt`命令批量安装所有的依赖包。
```
(install-mindradar)=
### 安装MindRadar
通过`pip install mindradar-xxx-py3-none-any.whl`命令安装MindRadar。验证是否成功安装执行以下命令
```bash
python -c "import mindspore;import mindradar;from mindradar import ComplexAbs;"
```
如果没有报错说明MindRadar安装成功了。
(toolchain)=
### 配置交叉编译工具链
官网下载windows版本的交叉编译工具
[https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf.tar.xz](https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf.tar.xz)
将下载好的交叉编译工具包解压到一个全英文的文件夹即可后续编译MindSpore Signal+ C++ 应用时需要填写交叉编译工具包的绝对路径。
(install-yhft-ide)=
### 安装YHFT-IDE
找到软件安装包,双击打开安装,同意条款;选择安装目录,点击下一步:
<img src="../_static/yhft-ide_install.png" alt="yhft-ide_install" width="auto"/>
然后一直按默认选项点下一步,直到点击安装。安装完成如下:
<img src="../_static/yhft-ide_install_success.png" alt="yhft-ide_install_success" width="auto"/>
(install-cmake)=
### 安装CMake
CMake官网选择合适版本下载CMake安装包:[https://cmake.org/download/](https://cmake.org/download/)
双击打开安装包,会弹出如下界面,点击`Next`,进入下一步:
<img src="../_static/cmake_install_step1.png" alt="cmake_install_step1" width="auto"/>
同意CMake的条款点`Next`按钮,进入下一步;
选中`Add CMake to the system PATH for the current user`,点击`Next`按钮:
<img src="../_static/cmake_install_step2.png" alt="cmake_install_step2" width="auto"/>
选择安装目录:
<img src="../_static/cmake_install_step3.png" alt="cmake_install_step3" width="auto"/>
点击`install`安装CMake安装完成后点击`Finish`按钮。
<img src="../_static/cmake_install_success.png" alt="cmake_install_step3" width="auto"/>
(install-netron)=
### 安装Netron
找到软件安装包,双击打开安装即可。