#! /bin/bash

yum install -y openmpi.x86_64

cd /share/apps/configrepo
rm -rf fftw-3.3.4.tar.gz
wget http://www2.fizik.usm.my/configrepo/howto/fftw/fftw-3.3.4.tar.gz
gunzip fftw-3.3.4.tar.gz
tar -xvf fftw-3.3.4.tar
cd fftw-3.3.4

./configure --with-g77-wrappers --enable-mpi --enable-threads --enable-openmp CXX="/usr/lib64/openmpi/bin/mpicxx" CC="/usr/lib64/openmpi/bin/mpicc" CPP="/usr/lib64/openmpi/bin/mpic++ -E" CXXCPP="/usr/lib64/openmpi/bin/mpicxx -E" FC='gfortran' --prefix=/share/apps/fftw-3.3.4/gnu

#./configure --with-g77-wrappers --enable-mpi --enable-threads --enable-openmp CXX="icc" CC="icc" CPP="icc -E" CXXCPP="icc-E" FC='ifortran' --prefix=/share/apps/fftw-3.3.4/intel

 make
 make check  # as user
 make install  #exectute this as su
 make installcheck  #execute this as user



