#! /bin/bash

# This script installs some essential numerical packages, including mpich2.
# Proven to work for Fedora 13, 15. 
# to avoid possible conflicting isses don't run this script on Rocks Linux.

# yum groupinstall "Chinese Support" -y

yum install git-svn.x86_64 -y #proven worked for rocks cluster 5.4.3

yum install --disablerepo=rpmforge {lapack,blas,libstdc++,tcl,tk,mysql,glibc,zlib,libXpm,libxml2,g2clib}-devel.{i386,x86_64} gcc-* compat-gcc* cernlib* geant* geany 

yum install -y cernlib-g77.x86_64 cernlib-g77-devel.x86_64 cernlib-g77-static.x86_64 cernlib-g77-utils.x86_64 cernlib-packlib-g77.x86_64 patchy-g77.x86_64 paw-g77.x86_64 compat-gcc-34-g77.x86_64 perl-OpenGL.x86_64 pygtk2-codegen.x86_64 pygtk2-devel.x86_64 numpy.x86_64 python-matplotlib-tk.x86_64 python-matplotlib.x86_64 scipy.x86_64 

#yum install -y mpich2-devel.x86_64 mpich2.x86_64 mpich2-doc.noarch
yum install fftw2-devel.x86_64 fftw-static.x86_64 -y
yum install -y gcc-c++.x86_64
yum install -y scalapack-common.x86_64 
yum install -y scalapack-openmpi.x86_64
yum install -y lapack-devel.x86_64
yum install -y lapack.x86_64
yum install -y blas-devel.x86_64
yum install -y blas.x86_64 
yum install -y atlas.x86_64
yum install -y atlas-c++.x86_64
yum install -y atlas-devel.x86_64
yum install -y scalapack.x86_64
yum install -y scalapack-devel.x86_64
yum install -y fftw3-static.x86_64
yum install -y fftw2.x86_64
yum install -y fftw3-devel.x86_64
yum install -y fftw2-devel.x86_64
yum install -y fftw3.x86_64
yum install -y libgfortran.x86_64
yum install -y gcc-gfortran.x86_64
yum install -y gcc44-gfortran.x86_64
yum install -y gnuplot.x86_64
yum install -y fftw2-devel.x86_64 fftw2.x86_64 fftw-static.x86_64 fftw-devel.x86_64
yum install -y libstdc++.x86_64 libstdc++.i686 libstdc++-devel.x86_64 libstdc++.x86_64 libstdc++-devel.i686 libstdc++devel.x86_64
yum install -y compat-libstdc++-33 compat-libstdc++-33.i686 
yum install -y compat-gcc-34-c++.x86_64 compat-libstdc++-296.i686 compat-libgfortran-41.i686 compat-libgfortran-41.x86_64 compat-libstdc++-33.x86_6
yum install -y compat-libstdc++-33

wget http://www2.fizik.usm.my/configrepo/howto/mpich2/inst_mpich2
chmod +x inst_mpich2
./inst_mpich2

echo '/usr/lib64/' >> /etc/ld.so.conf
echo '/usr/lib64/mpich2/lib/' >> /etc/ld.so.conf
ldconfig
