Difference between revisions of "Getting And Building MPICH"

From Mpich
Jump to: navigation, search
Line 13: Line 13:
 
To build these, run
 
To build these, run
  
  ./maint/updatefiles
+
  ./autogen.sh
  
Occasionally changes are made to the autoconf macros that are not detected by the dependency tests for the configure scripts. It is always correct to delete all of the configure scripts before running maint/updatefiles:
+
Occasionally changes are made to the autoconf macros that are not detected by the dependency tests for the configure scripts. It is always correct to delete all of the configure scripts before running autogen.sh:
  
 
  find . -name configure -print | xargs rm
 
  find . -name configure -print | xargs rm
  ./maint/updatefiles
+
  ./autogen.sh
  
 
The autoconf macros and the configure.in scripts now require the following:
 
The autoconf macros and the configure.in scripts now require the following:
Line 28: Line 28:
 
This was done because there are incompatible differences between each minor release of autoconf (e.g. the allowed command line arguments has changed between 2.50 and 2.58).
 
This was done because there are incompatible differences between each minor release of autoconf (e.g. the allowed command line arguments has changed between 2.50 and 2.58).
  
You can select a particular version of autoconf and autoheader by using the environment variables AUTOCONF and AUTOHEADER respectively. maint/updatefiles will use these if they are set.  However, note that for these tools to work properly, both they and  
+
You can select a particular version of autoconf and autoheader by using the environment variables AUTOCONF and AUTOHEADER respectively. autogen.sh will use these if they are set.  However, note that for these tools to work properly, both they and  
 
all of there data files must be installed in the same set of directories.  The easiest way to ensure this is to use ''exactly'' the same configure arguments when you configure and install these tools.  For example, if you set the '''prefix''', set the prefix to exactly the same path for all three tools.   
 
all of there data files must be installed in the same set of directories.  The easiest way to ensure this is to use ''exactly'' the same configure arguments when you configure and install these tools.  For example, if you set the '''prefix''', set the prefix to exactly the same path for all three tools.   
  
Line 36: Line 36:
  
 
* The C compiler is gcc, and
 
* The C compiler is gcc, and
* Dependencies are enabled when simplemake was run by maint/updatefiles (this is the default for the development version but not the a release distribution).
+
* Dependencies are enabled when simplemake was run by autogen.sh (this is the default for the development version but not the a release distribution).
  
 
To enable the dependencies, simply run
 
To enable the dependencies, simply run
Line 46: Line 46:
 
== Updated derived files such as configure ==
 
== Updated derived files such as configure ==
  
If you change one of the files that is the source for a derived file, such as a configure.in file, you will need to rebuild the derived file (e.g., the corresponding configure file). The safest way to do this is to rerun updatefiles:
+
If you change one of the files that is the source for a derived file, such as a configure.in file, you will need to rebuild the derived file (e.g., the corresponding configure file). The safest way to do this is to rerun autogen.sh:
  
  ./maint/updatefiles
+
  ./autogen.sh
  
(from the top-level MPICH2 directory). However, this can take a fair amount of time. You can direct updatefiles to only update certain classes of files. For example, to update all configure files, use
+
(from the top-level MPICH2 directory). However, this can take a fair amount of time. You can direct autogen.sh to only update certain classes of files. For example, to update all configure files, use
  
  ./maint/updatefiles -do=build_configure
+
  ./autogen.sh -do=build_configure
  
 
You can use multiple -do arguments. For example, to rebuild the Makefile.in files and the configure files, use
 
You can use multiple -do arguments. For example, to rebuild the Makefile.in files and the configure files, use
  
  ./maint/updatefiles -do=build_configure -do=makefiles
+
  ./autogen.sh -do=build_configure -do=makefiles
  
Check the source of maint/updatefiles to see what other options are available for -do.
+
Check the source of autogen.sh to see what other options are available for -do.
  
 
<!-- vim: set ft=wikipedia : -->
 
<!-- vim: set ft=wikipedia : -->

Revision as of 20:01, 29 February 2012

Checking out the MPICH2 source

To checkout a new copy of the MPICH2 source, use

svn co https://svn.mcs.anl.gov/repos/mpi/mpich2/trunk mpich2

Setting up the build environment

The SVN repository does not contain any of the "derived" files, including the configure scripts and the C++ and Fortran 77 language bindings.

To build these, run

./autogen.sh

Occasionally changes are made to the autoconf macros that are not detected by the dependency tests for the configure scripts. It is always correct to delete all of the configure scripts before running autogen.sh:

find . -name configure -print | xargs rm
./autogen.sh

The autoconf macros and the configure.in scripts now require the following:

  • autoconf version 2.67 (or higher)
  • automake version 1.11 (or higher)
  • GNU libtool version 2.2.6 (or higher)

This was done because there are incompatible differences between each minor release of autoconf (e.g. the allowed command line arguments has changed between 2.50 and 2.58).

You can select a particular version of autoconf and autoheader by using the environment variables AUTOCONF and AUTOHEADER respectively. autogen.sh will use these if they are set. However, note that for these tools to work properly, both they and all of there data files must be installed in the same set of directories. The easiest way to ensure this is to use exactly the same configure arguments when you configure and install these tools. For example, if you set the prefix, set the prefix to exactly the same path for all three tools.

Enabling automatic handling of file dependencies

Under certain circumstances, the build system will automatically maintain dependency information, ensuring that changes to a header file, for example, forces the recompilation of all files that include that header file. The requirements are

  • The C compiler is gcc, and
  • Dependencies are enabled when simplemake was run by autogen.sh (this is the default for the development version but not the a release distribution).

To enable the dependencies, simply run

make dependencies

after the configure step. This will enable dependency handling for the parts of MPICH2 that use simplemake (e.g., src/mpi, src/mpid, and some parts of src/util). Other parts of MPICH2, such as ROMIO, do not currently support automatic dependency handling.

Updated derived files such as configure

If you change one of the files that is the source for a derived file, such as a configure.in file, you will need to rebuild the derived file (e.g., the corresponding configure file). The safest way to do this is to rerun autogen.sh:

./autogen.sh

(from the top-level MPICH2 directory). However, this can take a fair amount of time. You can direct autogen.sh to only update certain classes of files. For example, to update all configure files, use

./autogen.sh -do=build_configure

You can use multiple -do arguments. For example, to rebuild the Makefile.in files and the configure files, use

./autogen.sh -do=build_configure -do=makefiles

Check the source of autogen.sh to see what other options are available for -do.