Wednesday, July 06, 2011

compile mpich2

If you are using gcc version >= 4.3 to compile mpich2-1.3, which can be downloaded from http://www.mcs.anl.gov/research/projects/mpich2, you are likely to get tons of multiple definition errors. It took me quite a while to figure out the reason and the solution. This is caused by the --std=gnu99 used in hwloc. But using gnu99 will change the meaning of "extern inline" used in many c header files as explained in http://gcc.gnu.org/gcc-4.3/porting_to.html. Knowing this, the solution is quite simple: using the following command to configure:

CFLAGS=-fgnu89-inline ./configure