#to remove the old installation
rm -r -f amber12
#to unpack amber files
tar xvjf AmberTools13.tar.bz2
tar xvjf Amber12.tar.bz2

export AMBERHOME=/opt/amber12


#1- SERIAL VERZE AmberTools a Amberu
cd $AMBERHOME
make clean
./configure  -noX11 gnu
make install
make test 
echo "AmberTools and Amber SERIALL (vcetne testu) - DONE" >>$AMBERHOME/progress.txt


#2 - PARALLEL VERZE AmberTools a Amber
cd $AMBERHOME
make clean
./configure -mpi -noX11 gnu
make install
export DO_PARALLEL="mpirun -np 4"
make test
echo "Amber11 PARALLEL - DONE" >>$AMBERHOME/progress.txt


#3 - GPU serial

cd $AMBERHOME
make clean
./configure -cuda -noX11 gnu
make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-5.0/lib64:/usr/local/cuda-5.0/lib:/lib
make test.cuda

echo "Amber11 CUDA - DONE (including tests)" >>$AMBERHOME/progress.txt


#4 - openMP

cd $AMBERHOME
make clean
./configure -openmp -noX11 gnu
make openmp


