Installation Procedure (SLES 12.5)
- Log in to the server as the root user and check whether dependencies, such as Python and GCC, are installed.
Run the following commands to check whether the dependencies such as GCC, Make, and Python are installed:
rpm -qa | grep gcc rpm -qa | grep make rpm -qa | grep unzip rpm -qa | grep zlib-devel rpm -qa | grep openssl-devel rpm -qa | grep pciutils rpm -qa | grep net-tools rpm -qa | grep gdbm-devel rpm -qa | grep libffi-devel
If the following information is displayed, the dependencies have been installed. Go to the next step. (The following information shows an example.)
gcc48-4.8.5-31.20.1.x86_64 libgcc_s1-8.2.1+r264010-1.3.3.x86_64 gcc-4.8-6.189.x86_64 libgcc_s1-32bit-8.2.1+r264010-1.3.3.x86_64 gcc-c++-4.8-6.189.x86_64 gcc48-c++-4.8.5-31.20.1.x86_64 cmake-3.5.2-20.6.1.x86_64 makedumpfile-1.6.5-1.19.x86_64 automake-1.13.4-6.2.noarch make-4.0-4.1.x86_64 unzip-6.00-33.8.1.x86_64 zlib-devel-1.2.11-3.21.1.x86_64 zlib-devel-32bit-1.2.11-3.21.1.x86_64 zlib-devel-static-1.2.11-3.21.1.x86_64 zlib-devel-1.2.11-9.42.x86_64 zlib-devel-static-32bit-1.2.11-3.21.1.x86_64 libopenssl-devel-1.0.2p-1.13.noarch pciutils-3.2.1-11.3.1.x86_64 pciutils-ids-2018.02.08-12.3.1.noarch net-tools-1.60-765.5.4.x86_64 gdbm-devel-1.10-9.70.x86_64 libffi-devel-3.2.1.git259-10.8.x86_64
Otherwise, run the following command to install the software. You can change the following command to install only some of them as required.
sudo zypper install -y gcc gcc-c++ make cmake unzip zlib-devel openssl-devel pciutils net-tools gdbm-devel
The local source does not have the libffi-devel dependency. You can download the libffi-devel-3.2.1.git259-10.8.x86_64.rpm, libffi7-3.2.1.git259-10.8.x86_64.rpm, and libffi7-32bit-3.2.1.git259-10.8.x86_64.rpm packages from the openSUSE image source and upload them to a directory (for example, /home/test) on the server. (The software packages are updated periodically. Use the actual RPM package name.)
Go to the directory (for example, /home/test) where the RPM packages are stored and run the following command to install the dependencies:
sudo rpm -ivh *.rpm --nodeps
- Check whether the Python development environment that meets the version requirements is installed. For details, see Dependency List. This step uses Python 3.7.x as an example.
Run the python3 --version command. If the returned Python version meets the requirements (3.7.0 to 3.7.11), go to 3.
Otherwise, install Python (Python 3.7.5 is used as an example).
- Run the following command to download the source package of Python 3.7.5 to any directory of the installation environment:
wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
- Run the following command to go to the download directory and decompress the source package:
tar -zxvf Python-3.7.5.tgz
- Go to the decompressed folder, create an installation directory, and run the configuration, build, and installation commands.
cd Python-3.7.5 ./configure --prefix=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared make sudo make install
--prefix specifies the Python installation path. You can modify it as required. --enable-shared is used to build the libpython3.7m.so.1.0 dynamic library. --enable-loadable-sqlite-extensions is used to load the sqlite-devel dependency.
This document uses --prefix=/usr/local/python3.7.5 as an example. After the configuration, compilation, and installation commands are executed, the installation package is stored in the /usr/local/python3.7.5 directory, and the libpython3.7m.so.1.0 dynamic library is stored in the /usr/local/python3.7.5/lib/libpython3.7m.so.1.0 directory.
- Set the Python 3.7.5 environment variables.
# Set the Python 3.7.5 library path. export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, use Python 3.7.5. export PATH=/usr/local/python3.7.5/bin:$PATH
Set environment variables in the preceding export mode. In this mode, the environment variables take effect only in the current window. You can also write the preceding commands to the ~/.bashrc file and run the source ~/.bashrc command for the environment variables to take effect permanently. If you need to use other Python versions in the environment or the default Python version is 3.7.x before Python 3.7.5 is installed, do not write the preceding commands to the ~/.bashrc file.
- After the installation is complete, run the following commands to check the installation version. If the required version information is displayed, the installation is successful.
python3 --version pip3 --version
- Run the following command to download the source package of Python 3.7.5 to any directory of the installation environment:
- Before installating the CANN, run the pip3 list command to check whether the dependencies have been installed. If yes, skip this step. If not, run the following command to install the dependencies. If only some of the software is not installed, modify the following command to install selected software only.
- Configure the pip source before the installation. For details, see Configuring the PIP Source.
- Before the installation, you are advised to run the pip3 install --upgrade pip command to perform the upgrade to prevent the installation failure caused by an earlier pip version.
- If you run the following commands as a non-root user, add --user at the end of each installation command, for example, pip3 install attrs --user. The installation command can be run in any path.
pip3 install attrs pip3 install cython pip3 install numpy pip3 install decorator pip3 install sympy pip3 install cffi pip3 install pyyaml pip3 install pathlib2 pip3 install psutil pip3 install protobuf pip3 install scipy pip3 install requests pip3 install gnureadline pip3 install absl-py