| <html> |
| <head> |
| <title> |
| Setup for MPI Tools within the Parallel Language Development Tools |
| </title> |
| <link rel="stylesheet" type="text/css" href="help.css"> |
| <script type="text/javascript" src="thumb.js"> </script> |
| <body> |
| <h1 id="top">Setup for MPI Tools within the Parallel Language Development Tools</h1> |
| <p> |
| <!-- ============= --> |
| <p>This section describes how to set up a simple <i>local</i> C/C++ project for MPI. |
| A local project exists on the local machine (same machine on which Eclipse is installed). |
| See also the information about creating synchronized projects, where source code etc. is mirrored on the |
| local machine as well as a remote target on which you can build and run the program. |
| For another sample project creation example using synchronized projects, see |
| <a href="PLUGINS_ROOT/org.eclipse.ptp.doc.user/html/01buildMPIprog.html">Introduction to MPI projects (synchronized and local)</a> |
| <p> |
| There are several ways to set up the MPI information in an Eclipse C/C++/Fortran project: |
| <ul><li>Managed Build Projects |
| <ul> |
| <li><a href="#wizard">Use the PLDT new project wizards</a> |
| </li> |
| <li><a href="#manual">Add the MPI build information manually</a> |
| </ul> |
| |
| <li>Makefile projects |
| <ul> |
| <li><a href="setupMakefileProject.html">Set up MPI information in a Makefile project</a> |
| </ul> |
| </ul> |
| <p>You should see <a href="includes.html">A Word about Include Paths and MPI Preferences</a> 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. |
| |
| <!-- ============= --> |
| <h2>Terminology of CDT projects: Managed Build vs. Makefile Projects</h2> |
| <p>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". |
| <p>The current version of CDT that works with PTP 7.0 is CDT 8.2. |
| 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 <a href="setupMakefileProject.html">"Makefile project."</a> |
| <p>Both terminologies are sometimes used in these instructions. |
| |
| <h2 id="wizard">Use the PLDT new project wizards</h2> |
| |
| <p>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). |
| <p>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" |
| <p>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. |
| <br> |
| <img src="images/mpiWizard.png"> |
| <!-- ========================================== --> |
| <p> |
| |
| <!-- ========================================== --> |
| <p> |
| <p>Select Next to go to the next page of the New Project Wizard. |
| |
| <br>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. |
| <br>Then select Next. |
| <br><img src="images/mpiWizard2.gif"> |
| <p>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 input to the PLDT MPI Preferences page. |
| To have a specific include path added to all new MPI projects, see <a href="#reco">below</a> |
| for how to specify the MPI Include path in the Preferences. |
| |
| <br><img src="images/mpiWizard3.gif"> |
| <p>Select Finish. |
| <p>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. |
| |
| <br><img src="images/mpiNewProjectWorkbench.gif"> |
| <p> |
| <p><p>Now continue to set up to <a href="run.html">run the MPI tools</a> |
| <p> |
| <h2 id="manual">Add the Build Information Manually</h2> |
| <p>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. |
| <ol> |
| <li>Create a C project |
| <ul> |
| |
| <li>Note: the following description is for a regular C project (also known as a "Managed Build" CDT project). |
| For information about Makefile projects, in which you provide the makefile yourself, |
| see <a href="setupMakefileProject.html">Setup for Makefile projects</a>. |
| </li> |
| </ul> |
| <li>Set up the include paths etc: |
| <br>To bring up the Project Properties, rightMouse on the project name, and select "Properties" (at the bottom of the context menu list) |
| <br>Project Properties, C/C++ Build, Configuration Settings, |
| Tool Settings tab, Directories |
| <br>--> Add include path for mpi header files etc. - path to the 'include' dir |
| <br><img src="images/include.png"> |
| <p> |
| <p> |
| Project Properties, C/C++ Build, Configuration Settings, |
| Tool Settings tab, GCC C Linker, Libraries |
| <ol> |
| <li>Under "Libraries (-l)" add the symbol "mpi" |
| <li> Under "Library search path (-L)" add the path to the 'lib' dir in MPI dir. |
| <br><img src="images/lib.png"> |
| <p> |
| <li><b>MPI Build Command:</b> 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. |
| <br><img src="images/mpiBuildCommand.png"> |
| </ol> |
| <p> |
| |
| </ol> |
| <p>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 <a href="setupMakefileProject.html">Setting up project properties for a Makefile project</a>. |
| |
| |
| <p> |
| <h3 id="reco">Recognizing Artifacts by prefix, vs Include path</h3> |
| <p><b>Note:</b> if you have modified the MPI Preferences to <b>Uncheck</b> "Recognize MPI Artifacts by prefix (MPI) alone?" |
| then the header file must be located for MPI artifacts to be recognized. |
| <p><img src="images/recognize-mpi-prefix.png"> |
| <p> |
| <p>So if |
| you are <i>not</i> recognizing MPI artifacts by prefix alone, then PLDT will have to use include files to |
| identify MPI artifacts. If you have not set the MPI includes on the MPI Preferences page yet, |
| you'll be prompted after the first page in the new project wizard dialog: |
| <br><img src="images/mpiPrefsHaveNotBeenSet.png"> |
| <p> |
| <p>See <a href="includes.html">A word about includes and MPI preferences</a> |
| for more information and how to fill this in. |
| |
| |
| <p> |
| <p>Now continue to set up to <a href="run.html">run the MPI tools</a> |
| |
| <p> |
| <p> <p> <p> |
| <p><a href="#top">Back to Top</a> | <a href="toc.html">Back to Table of Contents</a> |
| |
| </body> |
| </html> |