To http://www.open-mpi.org/download Openmpi and unzip, pre-install GCC or g++.
I am openmpi-1.6.5, go to unzip folder, execute
./configure
This step takes longer to execute if configure:error:c++ preprocessor "/lib/cpp" fails sanity check error occurs
This is due to the lack of the corresponding library, find the original text as follows:
Resolution of/lib/cpp fails sanity check
In some software, run the./configure error message:
configure:error:c++ preprocessor "/lib/cpp" fails sanity
Check see ' config.log ' for more details
Workaround: This occurs because the relevant package for the C + + compiler is not installed, logged in as root and executed on the terminal:
# yum Install Glibc-headers
# yum Install gcc-c++
This comrade uses a red Hat version, and for Ubuntu, just change Yum to Apt-get.
Since the build-essential contains many basic libraries, the execution
sudo apt-get install build-essential
When I execute the last command, I have no error, and then I execute it.
Make all
This step is also performed for a longer period before executing
Make install
Complete the installation and go to the examples folder to compile the HELLO_C.C sample program
Mpicc-o Hello_c HELLO_C.C
If this step appears mpicc:error while loading shared libraries:libopen-pal.so.4:cannot open Shared object file:no such file or direct Ory Error
Can find Libopen-pal.so.4 added to Ld_library_path, you can perform apt-file search libopen-pal.so.4 located in the home, do not install Apt-file system should
It is possible to prompt you to install, after installation, and when you are prompted to perform an update after the execution, the lookup should be done.
If you do not want to add libopen-pal.so.4 directly, it is common to find out which folder you will install Openmpi
$ export Ld_library_path+=:/dir/where/is/openmpi/lib, if the following command is executed by default
Export Ld_library_path+=:/usr/lib/openmpi/lib
I'm just going to execute this command and then execute MPICC to finish the compilation, and finally execute
Mpirun-n 4./hello_c
Where 4 is the number of processes, you will see the program executed successfully.
Openmpi Configuration in Linux