Setup for MPI Tools within the Parallel Language Development Tools

 

This section describes how to set up a C/C++ project for MPI. There are at several ways to do this:

You should see A Word about Include Paths and MPI Preferences for a discussion about the different ways you can set up your project, including the MPI Preferences, to find the include paths for build as well as for other Eclipse tools.

Terminology of CDT projects: Managed Build vs. Makefile Projects

Note: the older versions of CDT (4.0 and earlier) refer to a C project in which it manages the makefile as a "Managed Make Project" or a "Managed Build Project." They refer to a project which you supply the makefile is a "Standard Make project".

The current version of CDT that works with PTP 5.0 is CDT 8.0. CDT 5.0 and later refers to a C project in which it manages the makefile as just a "C Project" and a project which you supply the makefile is a "Makefile project."

Both terminologies are sometimes used in these instructions.

Use the PLDT new project wizards

One way to create a new MPI C project is to use the menu: File->New->C project (if you are already in the C/C++ perspective this may be the simplest). There are several other ways to get to this wizard (including context menu in the Project Explorer view).

In the first wizard dialog page, "C Project," enter a project name; under Project types, expand 'executable' and select, e.g. "MPI Hello World C project"

Note: be sure to select a valid toolchain on the right side of this dialog. Your system may provide different toolchains, and the selection may be different from what is shown here.

 

 

After specifying the include files in the preferences, or if it wasn't required, select Next to go to the next page of the New Project Wizard.
On the Basic Settings page of the wizard, fill in any project template values, e.g. your name in the Author field. The Author is simply used in a comment in the file. The "Hello World greeting" is used in the sample statement in the code that is generated. The "Source" field indicates the name of the source folder that is generated in the project.
Then select Next.

On the next page, "MPI Project Settings" page, the "Add MPI project settings to this project" should be checked. If you want to change any of the default values for this project, you can do so here by unchecking the "Use default information" and altering the values. The default values were chosen based on your input to the PLDT MPI Preferences above.

Select Finish.

The project is created and should build automatically. The Eclipse workbench is shown below after creating the new "MPI hello world" project. The project explorer view on the left shows the project contents. The source file is under the 'src' directory; expand this to see it. Double-click on the source file name to edit the source file. The outline view on the right shows the outline of the file currently shown in the editor. The Console view at the bottom shows the results of the project build.

Now continue to set up to run the MPI tools

Add the Build Information Manually

If the new project wizard isn't used as described above to set the MPI information for a project, the MPI information can be added to the project manually as follows.

  1. Create a C project
  2. Set up the include paths etc:
    To bring up the Project Properties, rightMouse on the project name, and select "Properties" (at the bottom of the context menu list)
    Project Properties, C/C++ Build, Configuration Settings, Tool Settings tab, Directories
    --> Add include path for mpi header files etc. - path to the 'include' dir

     

    Project Properties, C/C++ Build, Configuration Settings, Tool Settings tab, GCC C Linker, Libraries

    1. Under "Libraries (-l)" add the symbol "mpi"
    2. Under "Library search path (-L)" add the path to the 'lib' dir in MPI dir.

       

    3. MPI Build Command: Note: If you have an MPI installed that requires a different build command, such as 'mpicc' instead of 'gcc', specify it here as well. Select the compiler tool on the left and modify the 'Command:' value. You probably also need to do the same for the linker tool.

Note that the above instructions describe how to add information to C projects in which the makefile is generated for you, previously known as "Managed Build" projects. If you provide your own makefile, you will create a "Makefile project" and create the makefile within that project. See Setting up project properties for a Makefile project.

Now continue to set up to run the MPI tools

 

 

 

 

Back to Top | Back to Table of Contents