Openmpi Configuration in Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.