Open MPI logo

Open MPI Developer's Workshop: Prerequisites

  |   Home   |   Support   |   FAQ   |  

Back to main Workshop page

Before you arrive

We intend the tutorial to be a fast paced interactive session, with attendees actively using the Open MPI code base throughout the week. Building Open MPI from the Subversion repository requires a fairly specific toolchain and the first build can take a significant amount. Therefore, we ask that everyone please try to build Open MPI from a Subversion checkout before coming to the tutorial. If something doesn't succeed, please contact us and we'll do our best to walk you through the process.

Required Tools

First, you need a supported operating system. Linux and Mac OS X work well. Cygwin using gcc should work well enough for the tutorial. We do not recommend attempting to use any other Windows compiler/environment for development during the tutorial. Working C and C++ compilers are required and a Fortran compiler is optional. Open MPI uses Subversion for source code management and the GNU Autotools for build system, so both will be required.

Subversion

You will need a version of the Subversion client that supports the https repository access module. Any version of Subversion should work. The client has improved drastically over the last couple of releases, so you might want to grab the latest release available for your platform. The output below is from a Subversion client with https access.

shell ~% svn --version
svn, version 1.3.0 (r17949)
   compiled Feb  5 2006, 14:16:35

Copyright (C) 2000-2005 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

Releases of Subversion are available from the Subversion web site, with binaries (including https support) available for most common platforms. We won't go into building the subversion client from source, other than to mention that the flag to configure for enabling https access is --with-ssl.

Autotools

Open MPI uses GNU Autoconf, Automake, and Libtool (together commonly refered to as the GNU Autotools) to provide a build system which works on a large number of platforms. Due to the use of some advanced features of Automake and Libtool, recent versions of the tools are required with Open MPI. The required versions of the Autotools are listed in the table below.

ToolRequired Version
Autoconf2.59
Automake1.9.6
Libtool1.5.16

All three tools provide a --version switch for checking version numbers (below). If any of your tools are not recent enough, you will have to upgrade. All three tools should be installed into the same location (while not strictly required, there are some extra steps required to avoid this). The source for the tools can be downloaded from: Autoconf, Automake, and Libtool. Each project contains its own installation instructions, but generally ./configure --prefix=DIR ; make ; make install is all that is required. Don't forget to make sure that your new installation of the autotools appears in your $PATH before any other installed version of the tools.

shell ~% autoconf --version
autoconf (GNU Autoconf) 2.59
Written by David J. MacKenzie and Akim Demaille.

Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
shell ~% automake --version
automake (GNU automake) 1.9.6
Written by Tom Tromey .

Copyright 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
shell ~% libtool --version
ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)

Copyright (C) 2005  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Note: For those not familiar with the autotools system, the autotools requirement is only for developers working from Subversion checkouts. Users of Open MPI who build from release tarballs do not need to "build the build system", as it is included in the release tarball.

Obtaining Open MPI

Subversion provides extensive usage documentation. We'll go through the basic steps needed to obtain and update a copy of the Open MPI source code, but you might want to become familiar with the more advanced features as time goes on. The svn co command (below) is used to check out the source code. The first time you attempt to check out Open MPI, you will see a warning about an invalid certificate. Our certificate is self-signed, which is why Subversion believes it is invalid. It is safe to permenantly except the certificate.

shell ~% svn co https://svn.open-mpi.org/svn/ompi/trunk ompi-trunk
Error validating server certificate for 'https://svn.open-mpi.org:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: svn.open-mpi.org
 - Valid: from Apr  4 13:52:48 2005 GMT until Apr  2 13:52:48 2015 GMT
 - Issuer: Computer Science Department, Indiana University, Bloomington, Indiana, US
 - Fingerprint: 92:dd:79:e4:43:6f:d1:a3:11:68:7f:81:38:ab:39:c1:be:c2:fd:1c
(R)eject, accept (t)emporarily or accept (p)ermanently? p
Authentication realm:  Open MPI Subversion Access
Password for 'brbarret': 
A  ompi-trunk/test
A  ompi-trunk/test/mca
A  ompi-trunk/test/mca/oob

(Lots and lots of output skipped)

 U ompi-trunk
Checked out revision 9226.

The version number checked out will most likely be different when you check out the code, and will change over time as more commits are made to the Open MPI repository.

Building the Build System

The Autotools have a complex set of commands that must be run in a very specific order in order for them to operate correctly. Open MPI also requires some files to be generated before the Autotools are run in order to generate the list of frameworks and components included in the source tree. There is a single script autogen.sh at the root level of the Open MPI source tree does all the work for you. The last step (running Automake at the top level) can take a considerable amount of time to complete. In the end, you should see output like that below:

shell ompi-trunk% ./autogen.sh 
[Checking] command line parameters
[Checking] prerequisites
Configuring projects: opal orte ompi
/Users/bbarrett/ompi-trunk

(Lots and lots of output skipped)

*** Found configure.(in|ac)
***   /Users/bbarrett/ompi-trunk

*** Running GNU tools
[Running] autom4te --language=m4sh ompi_get_version.m4sh -o ompi_get_version.sh
[Running] aclocal
[Running] autoheader
[Running] autoconf
[Running] libtoolize --automake --copy --ltdl
Adjusting libltdl for OMPI :-(
  -- patching for argz bugfix in libtool 1.5
     ==> your libtool doesn't need this! yay!
  -- patching configure for broken -c/-o compiler test
[Running] automake --foreign -a --copy --include-deps
configure.ac: installing `./config/install-sh'
configure.ac: installing `./config/missing'
ompi/Makefile.am: installing `./config/compile'
ompi/Makefile.am: installing `./config/depcomp'
shell ompi-trunk%

Configuring Open MPI

Once autogen.sh completes, it is time to configure Open MPI. We'll talk about the various build options and the meaning of most of the non-standard output from the script during the tutorial. For the short term, there are only a couple of options that you need to be familiar with (note: all capital words after an equal sign (=) should be replaced by a value appropriate for your setup):

ArgumentMeaning
--help Print out a listing of supported arguments and their usage
--prefix=DIR Prefix where Open MPI should be installed
--disable-mpi-profile Disable the MPI profiling layer. This can greatly decrease build times on Windows and Mac OS X, but will result in a lack of the profiling layer and the MPI-2 I/O interface
--config-cache Use a cache file to store configuration options between runs of configure. This needs to be used with some care on file systems shared between machines, which we will talk about during the turorial. But it can drastically speed up the time configure takes to run on slower machines.

For example, on my Mac OS X laptop, I usually run configure as seen below:

shell ompi-trunk% ./configure --prefix=$HOME/local --disable-mpi-profile --config-cache
configure: loading cache config.cache
checking for a BSD-compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... (cached) awk
checking whether make sets $(MAKE)... (cached) yes

============================================================================
== Configuring Open MPI
============================================================================

(lots and lots and lots of output skipped)

config.status: executing depfiles commands
config.status: executing pml-direct commands
config.status: creating ompi/mca/pml/pml_direct_call.h
shell ompi-trunk%

The configure script will abort if it determines that a feature necessary to building Open MPI is unavailable on your platform. If you run into such an issue, information on what happened and what you need to do to correct it is generally available in either the abort message or the file config.log in the current directory.

Building and Installing Open MPI

This is by far the easiest step in the whole process, but one of the longest running steps. The first time Open MPI is built, it will take a long time to compile and is definitely a coffee-break step. The Autotools provide a very thorough dependency analysis system, so (with very few exceptions) subsequent builds will cause significantly fewer files to be recompiled.

shell ompi-trunk% make all install

(lots and lots of output)

shell ompi-trunk% 

If the last line from make is not an error message, your build is complete and ready for testing.

Testing Your Installation

For now, we can just use a simple Hello, World example to make sure that Open MPI is operating correctly (hello.c). Make sure Open MPI is in your path according to the FAQ item on shell configuation. The compile and execution output should look like that below.

shell ompi-trunk% mpicc hello.c -o hello
shell ompi-trunk% mpirun -np 4 ./hello
Hello, World.  I am 1 of 4
Hello, World.  I am 4 of 4
Hello, World.  I am 2 of 4
Hello, World.  I am 0 of 4
shell ompi-trunk% 

Don't worry if the output is in a slightly different order, since the ordering of output from different processes is not deterministic. It will likely change from run to run.

That's All, Folks!

You now have a working Open MPI installation and build tree. It would be a good idea to update your Subversion checkout and re-run the "Building the Build System", "Configuring Open MPI", "Building and Installing Open MPI", and "Testing your Installation" steps a day or two before the tutorial starts to make sure you have the latest changes to the source code.

See you at the tutorial!

Back to main Workshop page