diff --git a/faster_install/for_1.7x.0.0/README.md b/faster_install/for_1.7x.0.0/README.md index 6c832a1..e04b6e3 100755 --- a/faster_install/for_1.7x.0.0/README.md +++ b/faster_install/for_1.7x.0.0/README.md @@ -1,12 +1,14 @@ # Ubuntu18.04开发环境快速安装脚本 #### 介绍 -该脚本适用于Ubuntu18.04操作系统,可以快速安装C7x的开发环境,包括Python3.7.5环境与MindStudio。 + 该脚本适用于Ubuntu18.04操作系统,可以快速安装C7x的开发环境,包括Python环境与MindStudio。 #### 使用前准备 1、Ubuntu18.04版本的虚拟机。 2、到网站(https://www.huaweicloud.com/ascend/resource/Software )下载用于安装MindStudio的Toolkit包,名字为Ascend-Toolkit-[version]-x86_64-linux_gcc7.3.0.run、Ascend-Toolkit-[version]-arm-linux_gcc7.3.0.run,将两个包放于$HOME目录下。 +​ 由于有些样例需要用到以下包(看个人需求):Ascend310-driver-1.73.5.1.b050-ubuntu18.04.aarch64-minirc.tar.gz,故也可以下载下来并自行解压即可(在上面的网站链接中即可下载)。 + 3、自行配置下载源。(以下给出一种配置源的方法) (1)点击左边如下图“步骤1”中的图标。 @@ -24,26 +26,30 @@ #### 使用方法 1、下载快速安装脚本。Ubuntu服务器的命令行中执行以下命令进入$HOME目录。 - **cd $HOME** +cd $HOME 命令行中使用以下命令下载faster-install脚本。 - **git clone https://gitee.com/ascend/tools.git** +git clone -将faster-install目录下的faster-install.sh脚本拷贝到$HOME目录下。 +将faster-install目录下的faster_install.sh脚本拷贝到$HOME目录下。 - **cp ~/tools/faster_install/for_1.7x.0.0/faster_install.sh .** +cp ~/faster-install/faster_install.sh . 执行脚本。 - **bash faster-install.sh** +bash faster-install.sh -2、安装完成之后会显示以下界面。点击界面中的红色框内的选项。 +2、安装完成之后会显示以下界面。选择下图中红框选项(第三行)并点击OK。 -![](img/pic5.png "界面1") +![](img/pic7.png "界面1") -3、选择下图中的选项,点OK即可。 +3、点击界面中的红色框内的选项。 -![](img/pic6.png "界面2") +![](img/pic5.png "界面2") -4、此时会自动关闭MindStudio,重新启动MindStudio即可。到此C7x开发环境安装完成。 +4、选择下图中的选项,点OK即可。 + +![](img/pic6.png "界面3") + +5、此时会自动关闭MindStudio,重新启动MindStudio即可。到此C7x开发环境安装完成。 \ No newline at end of file diff --git a/faster_install/for_1.7x.0.0/faster_install.sh b/faster_install/for_1.7x.0.0/faster_install.sh index f954a78..1a74496 100755 --- a/faster_install/for_1.7x.0.0/faster_install.sh +++ b/faster_install/for_1.7x.0.0/faster_install.sh @@ -71,22 +71,23 @@ main() fi fi + find ~/Ascend/ascend-toolkit/ -name "20.0.*" -exec rm -rf {} \; TOOLKIT_flag=`find ~/Ascend/ascend-toolkit/ -name "20.0.*" 2> /dev/null` if [[ ! $TOOLKIT_flag ]];then - TOOLKIT_flag_arm64=`find $HOME -maxdepth 1 -name "Ascend-Toolkit-*-arm64-linux_gcc7.3.0.run" 2> /dev/null` + TOOLKIT_flag_arm64=`find $HOME -maxdepth 1 -name "Ascend-*-arm64-*.run" 2> /dev/null` if [[ ! $TOOLKIT_flag_arm64 ]];then echo "[Error]:Can not find the Ascend-Toolkit-[version]-arm64-linux_gcc7.3.0.run package, please go to the official website to download the Toolkit installation package you need." echo "Exit installation." - return 1 + return 1 else TOOLKIT_arm64="YES" fi - TOOLKIT_flag_x86_64=`find $HOME -maxdepth 1 -name "Ascend-Toolkit-*-x86_64-linux_gcc7.3.0.run" 2> /dev/null` + TOOLKIT_flag_x86_64=`find $HOME -maxdepth 1 -name "Ascend-*-x86_64-*.run" 2> /dev/null` if [[ ! $TOOLKIT_flag_x86_64 ]];then echo "[Error]:Can not find the Ascend-Toolkit-[version]-x86_64-linux_gcc7.3.0.run package, please go to the official website to download the Toolkit installation package you need." echo "Exit installation." - return 1 + return 1 else TOOLKIT_x86_64="YES" fi @@ -105,30 +106,10 @@ main() echo "ERROR: download failed, please check Network." rm -rf $HOME/mindstudio.tar.gz return 1 - fi - fi - - if [[ $TOOLKIT_arm64 ]];then - find Ascend-Toolkit-*-arm64-linux_gcc7.3.0.run -exec chmod 777 {} \; - find Ascend-Toolkit-*-arm64-linux_gcc7.3.0.run -exec ./{} --install \; - if [ $? -ne 0 ];then - echo "ERROR: install failed, please verify that the toolkit-arm64 package is installed." - rm -rf $HOME/Ascend-Toolkit-20.0.RC1-arm64-linux_gcc7.3.0.run - return 1 - fi - fi - - if [[ $TOOLKIT_x86_64 ]];then - find Ascend-Toolkit-*-x86_64-linux_gcc7.3.0.run -exec chmod 777 {} \; - find Ascend-Toolkit-*-x86_64-linux_gcc7.3.0.run -exec ./{} --install \; - if [ $? -ne 0 ];then - echo "ERROR: install failed, please verify that the toolkit-x86_64 package is installed." - rm -rf $HOME/Ascend-Toolkit-20.0.RC1-x86_64-linux_gcc7.3.0.run - return 1 else - Toolkit_bashrc_flag="YES" + Min_bashrc_flag="YES" fi - fi + fi sudo apt-get install -y gcc g++ make cmake unzip zlib1g zlib1g-dev libsqlite3-dev openssl libssl-dev libffi-dev pciutils net-tools if [ $? -ne 0 ];then @@ -208,7 +189,30 @@ main() Pip_bashrc_flag="YES" fi - cd ~ + cd $HOME + if [[ $TOOLKIT_arm64 ]];then + find Ascend-*-arm64-*.run -exec chmod 777 {} \; + find Ascend-*-arm64-*.run -exec ./{} --install \; + if [ $? -ne 0 ];then + echo "ERROR: install failed, please verify that the toolkit-arm64 package is installed." + return 1 + else + Toolkit_bashrc_flag1="YES" + fi + fi + + if [[ $TOOLKIT_x86_64 ]];then + find Ascend-*-x86_64-*.run -exec chmod 777 {} \; + find Ascend-*-x86_64-*.run -exec ./{} --install \; + if [ $? -ne 0 ];then + echo "ERROR: install failed, please verify that the toolkit-x86_64 package is installed." + return 1 + else + Toolkit_bashrc_flag2="YES" + fi + fi + + cd $HOME tar zxvf mindstudio.tar.gz if [[ $Min_bashrc_flag ]];then @@ -216,7 +220,7 @@ main() echo "export ASCEND_OPP_PATH=${install_path}/opp" >> ~/.bashrc fi - if [[ $Toolkit_bashrc_flag ]];then + if [[ $Toolkit_bashrc_flag1 ]] && [[ $Toolkit_bashrc_flag2 ]];then find ~/Ascend/ascend-toolkit/ -name "20.0.*" -exec echo "export install_path={}" >> ~/.bashrc \; fi diff --git a/faster_install/for_1.7x.0.0/img/pic7.png b/faster_install/for_1.7x.0.0/img/pic7.png new file mode 100755 index 0000000..0753a06 Binary files /dev/null and b/faster_install/for_1.7x.0.0/img/pic7.png differ