Here, you can select an appropriate openmpi installation package. Here, I select keystore (hs is my user name ). 1. First extract the tarzxvf/home/hs/download/openmpi-1.6.2.tar.gz file. 2. Then execute
Here you can choose a suitable openmpi installation package, here I choose http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.2.tar.gz
The default value is/home/hs/download (hs is my user name ).
1. First extract the file tar zxvf/home/hs/download/openmpi-1.6.2.tar.gz.
2. then execute the cd openmpi-1.6.2
3. Execute./configure. After a while, the g ++ compiler is missing, so run sudo apt-get install g ++.
4. Run the command again after execution./configure to complete the configuration,
5. Run sudo make all install to install all the files to be installed,
6. Add the library sharing path for the/etc/profile file. (by default, the library file of MPI is in the/usr/local/lib directory ). Run sudo geidt/etc/profile and add an export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/local/lib
7. Make the configuration file take effect: source/etc/profile and then you can perform the test.
8. cd openmpi-1.6.2/examples
9. make
10. mpirun-np 4 hello_c
The running result is as follows:
It indicates that MPI is successfully installed!
However, there was an episode later. After I restarted, I ran mpirun-np 4 hello_c again and encountered the following problems:
Run source/etc/profile again and then run mpirun-np 4 hello_c. The program runs successfully!
I finally completed the MPI Environment in Ubuntu and started to write the program!