Install and configure openmpi
The main installation steps are as follows.
Download and decompress openmpi
Download the latest version from the official website and decompress it.
Tar-xvf openmpi-xxxcd openmpi-xxx
Configuration, the-prefix option indicates the installation directory
./Configure -- prefix = "/opt/openmpi"
Build installation. The-j option indicates the number of Cores Used for compilation.
Make-j 4 all
There are a lot of output, wait a few minutes
Make install
Usage. Either of the following two methods
Add Environment Variables
Add the following lines to the. bashrc file:
Export PATH = "$ PATH:/opt/openmpi/bin" export LD_LIBRARY_PATH = "$ LD_LIBRARY_PATH:/opt/openmpi/lib /"
Use the configuration file
Vim openmpi-gcc # Add the following statement export PATH = "$ PATH:/opt/openmpi/bin" export LD_LIBRARY_PATH = "$ LD_LIBRARY_PATH:/opt/openmpi/lib /"
Run source/opt/openmpi-gcc to use
Check whether the installation is successful
Which mpirun
Or
Mpirun
Since then, openmpi has been installed.