Rice University logo
 
Top blue bar image Kiran Thyagaraja
Brain Dump
 

Compiling GCC 4.3.2 and MPICH2 1.1 on Blue Gene/P

Compiling GCC 4.3.2 and MPICH2 1.1 for the Blue Gene/P

GCC 4.3.2

1. First install GMP and MPFR

GMP

wget ftp://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.bz2
tar xf gmp-6.0.0a.tar.bz2
cd gmp-6.0.0a
./configure CFLAGS="-O3" CC=powerpc-bgp-linux-gcc --prefix=/opt/apps/gcc/4.3.2/ --host=powerpc-bgp-linux --with-gmp=/opt/apps/gcc/4.3.2/

Note: While running “make”, several files are generated using newly compiled binaries. Since these binaries are cross-compiled, the build process fails, so you have to manually build this one binary and then generate the necessary file like so:

gcc -m32 -o gen-psqr gen-psqr.c
gen-psqr 32 0 >mpn/perfsqr.h
make install

MPFR

wget ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.bz2
tar xf mpfr-3.1.2.tar.bz2 
cd mpfr-3.1.2/
./configure CFLAGS="-O3" CC=powerpc-bgp-linux-gcc --prefix=/opt/apps/gcc/4.3.2/ --host=powerpc-bgp-linux --with-gmp=/opt/apps/gcc/4.3.2/
make install

* Add /opt/apps/gcc/4.3.2/lib into /etc/ld.so.conf.d/gcc.conf and run ldconfig. This is needed for the temp gcc to compile glibc in the toolchain.

cat /bgsys/drivers//ppcfloor/toolchain/README.toolchain.gomp 
cp /bgsys/drivers//ppcfloor/toolchain/buildGompToolChain.sh .
./buildGompToolChain.sh /bgsys/drivers/ppcfloor /home/kkt3863/src/gcc-4.3.2-toolchain /opt/apps/gcc/4.3.2 /opt/apps/gcc/4.3.2 /bgsys/linux/1.4.220110323/usr/src/linux/include

MPICH2 1.1

1. First fetch the dmcf source repo from ANL

git clone http://dcmf.anl-external.org/dcmf.git

2. cd dmcf/lib/mpich2

This directory contains the patches to mpich2 source directory

3. Fetch mpich2 1.1 (This version only) and untar

wget http://www.mcs.anl.gov/research/projects/mpich2staging/goodell/downloads/tarballs/1.1/mpich2-1.1.tar.gz
tar xf mpich2-1.1.tar.gz

3. Apply the patches from DMCF into MPICH2

zcat ~/src/dcmf/lib/mpich2/patch.gz | patch -p0 --force --directory=~/src/mpich2-1.1
zcat ~/src/dcmf/lib/mpich2/patch.gz | ~/src/dcmf/tools/patch-delete --directory=~/src/mpich2-1.1

4. The autoconf tool on BGP is old. So tar up the newly patched mpich2 directory and then run maint/updatefiles on Davinci
(On BGP)

tar cf mpich2-1.1.tar mpich2-1.1

(On davinci)

tar xf mpich2-1.1.tar
cd mpich2-1.1
./maint/updatefiles

Repackage the mpich2 directory and scp it back to BGP

cd src/mpich2-1.1
touch --no-create Makefile.in

5. In the mpich2-1.1 source directory mkdir a build directory and cd into it. Use the following configure line to configure the source

GCC="/opt/apps/gcc/4.3.2/gnu-linux/bin/powerpc-bgp-linux-gcc" \
CC="/opt/apps/gcc/4.3.2/gnu-linux/bin/powerpc-bgp-linux-gcc" \
CXX="/opt/apps/gcc/4.3.2/gnu-linux/bin/powerpc-bgp-linux-g++" \
F77="/opt/apps/gcc/4.3.2/gnu-linux/bin/powerpc-bgp-linux-gfortran -fno-underscoring" \
F90="/opt/apps/gcc/4.3.2/gnu-linux/bin/powerpc-bgp-linux-gfortran -fno-underscoring" \
AR="/opt/apps/gcc/4.3.2/gnu-linux/bin/powerpc-bgp-linux-ar" \
LD="/opt/apps/gcc/4.3.2/gnu-linux/bin/powerpc-bgp-linux-ld" \
MPICH2LIB_CFLAGS="-g -Wall -O3 -mcpu=450fp2 -mstrict-align -fno-strict-aliasing" \
MPICH2LIB_CXXFLAGS="-g -Wall -O3 -mcpu=450fp2 -mstrict-align -fno-strict-aliasing" \
MPICH2LIB_FFLAGS="-g -Wall -O3 -mcpu=450fp2 -mstrict-align -fno-strict-aliasing" \
MPICH2LIB_F90FLAGS="-g -Wall -O3 -mcpu=450fp2 -mstrict-align -fno-strict-aliasing" \
CFLAGS="-I/bgsys/drivers/ppcfloor/comm/sys/include" \
CXXFLAGS="-I/bgsys/drivers/ppcfloor/comm/sys/include" \
FFLAGS="-I/bgsys/drivers/ppcfloor/comm/sys/include" \
F90FLAGS="-I/bgsys/drivers/ppcfloor/comm/sys/include" \
LDFLAGS="" \
MPILIBNAME="mpich.cnk" \
MPICXXLIBNAME="cxxmpich.cnk" \
MSGLAYER_INCLUDE="-I/bgsys/drivers/ppcfloor/comm/sys/include" \
MSGLAYER_LIB="-L/bgsys/drivers/ppcfloor/comm/sys/lib -Wl,-rpath,/bgsys/drivers/ppcfloor/comm/sys/lib -ldcmf.cnk      -ldcmfcoll.cnk      -lpthread -L/bgsys/drivers/ppcfloor/runtime/SPI -Wl,-rpath,/bgsys/drivers/ppcfloor/runtime/SPI -lSPI.cna -lrt" \
../configure \
--enable-cache \
--prefix=/opt/apps/gcc/4.3.2/comm/default \
--mandir=/opt/apps/gcc/4.3.2/comm/default/man \
--htmldir=/opt/apps/gcc/4.3.2/comm/default/www \
--host=powerpc-bgp-linux \
--target=powerpc-bgp-linux \
--build=powerpc64-linux-gnu \
--enable-dependencies \
--enable-debuginfo \
--enable-g=none \
--enable-sharedlibs=gcc \
--with-device=dcmfd:BGP \
--enable-romio=yes \
--enable-f77=yes \
--enable-f90=yes \
--with-file-system=bgl+bglockless \
--enable-timer-type=device \
--enable-threads=multiple \
--with-fwrapname=fmpich.cnk \
--with-cross=../src/mpid/dcmfd/cross8 \
--with-mpe=no \
--enable-wrappers \
--disable-fast \
--enable-timing=no \
--disable-collchk \
--disable-graphics \
--disable-rlog \
--disable-sample \
--with-assert-level=2 \
--with-aint-size=8 \

make && make install

VOILA. You have a new MPICH installed in /opt/apps/gcc/4.3.2/comm/default

Comments are closed.