Last active
January 16, 2017 19:33
-
-
Save kparrish/6064159 to your computer and use it in GitHub Desktop.
Run fresh_install.sh script on a new linux install.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### Fresh install for a new Ubuntu derivative | |
| # Assign user name | |
| read -p "Enter your user name: " UserName | |
| read -p "Enter your full name: " MyName | |
| read -p "Enter your email address: " MyEmail | |
| # update all | |
| apt-get update | |
| apt-get -y upgrade | |
| # usr functions | |
| apt-get -y install vim | |
| apt-get -y install vim-nox-py2 # Python 2.x support for vim | |
| apt-get -y install synapse | |
| apt-get -y install guake | |
| # python | |
| apt-get -y install ipython | |
| apt-get -y install python-dev | |
| apt-get -y install python-numpy | |
| apt-get -y install python-scipy | |
| apt-get -y install python-matplotlib | |
| apt-get -y install dvipng # Required for matplotlib to use latex | |
| apt-get -y install python-ase | |
| apt-get -y install python-gpgme # for dropbox | |
| apt-get -y install python-pip | |
| pip install --upgrade pyflakes | |
| # Pypar | |
| apt-get -y install build-essential openmpi-bin openmpi-doc libopenmpi-dev | |
| sudo -u $UserName wget -P ~/Downloads https://pypar.googlecode.com/files/pypar-2.1.5_108.tgz | |
| cd ~/Downloads | |
| sudo -u $UserName tar xzf pypar-2.1.5_108.tgz | |
| cd pypar_2.1.5_108/source | |
| python setup.py install | |
| cd ~ | |
| # tools | |
| apt-get -y install ssh | |
| apt-get -y install filezilla | |
| apt-get -y install openshot | |
| apt-get -y install skype | |
| apt-get -y install kile | |
| apt-get -y install texlive | |
| apt-get -y install texlive-xetex | |
| apt-get -y install texlive-publishers | |
| apt-get -y install texlive-latex-extra | |
| apt-get -y install texlive-math-extra | |
| apt-get -y install latex-beamer | |
| apt-get -y install sam2p | |
| apt-get -y install git | |
| # git commands | |
| sudo -u $UserName git config --global user.name $MyName | |
| sudo -u $UserName git config --global user.email $MyEmail | |
| sudo -u $UserName git config --global core.editor vim | |
| sudo -u $UserName git config --global core.excludesfile ~/.gitignore_global | |
| sudo -u $UserName git config --global color.ui true | |
| # for looks | |
| apt-get -y install conky | |
| apt-get -y install lsb-release scrot | |
| sudo -u $UserName wget -P ~/Downloads http://github.com/downloads/djmelik/archey/archey-0.2.8.deb | |
| dpkg -i ~/Downloads/archey-0.2.8.deb | |
| rm ~/Downloads/archey-0.2.8.deb | |
| # compilers | |
| apt-get -y install gfortran | |
| ## ## ## Lammps parallel install ## ## ## | |
| apt-get -y install build-essential openmpi-bin openmpi-doc libopenmpi-dev fftw2 fftw-dev | |
| # Check/remove lammps.tar.gz | |
| if [ -f ~/Downloads/lammps.tar.gz ] | |
| then | |
| rm ~/Downloads/lammps.tar.gz | |
| fi | |
| # Downloads lammps.tar.gz | |
| sudo -u $UserName wget -P ~/Downloads http://lammps.sandia.gov/tars/lammps.tar.gz | |
| cd ~/Downloads | |
| sudo -u $UserName tar xzf ~/Downloads/lammps.tar.gz | |
| cd lammps-* | |
| cd src | |
| cd MAKE | |
| sudo -u $UserName cp Makefile.openmpi Makefile.mint | |
| sudo -u $UserName sed -i -e 's/# openmpi/ # mint = Linux Mint, mpic++, OpenMPI-1.1, FFTW2/g' Makefile.mint | |
| sudo -u $UserName sed -i -e 's/-DFFT_FFTW3/-DFFT_FFTW2/g' Makefile.mint | |
| cd .. | |
| make yes-kspace | |
| make yes-user-phonon | |
| make mint | |
| # Make static and shared libraries | |
| # Static library | |
| sudo -u $UserName make makelib | |
| sudo -u $UserName make -f Makefile.lib mint | |
| # Sharded library | |
| sudo -u $UserName make makeshlib | |
| sudo -u $UserName make -f Makefile.shlib mint | |
| # Make python library | |
| make install-python | |
| cd ~ | |
| ## ## ## ATLAS install ## ## ## | |
| # Number of CPUs | |
| CPUNum=$(nproc) | |
| # Install required packages | |
| apt-get -y install build-essential gfortran cpufrequtils | |
| # Turn off CPU throttling | |
| for (( i=0; i<$CPUNum; i++ )) | |
| do | |
| echo "cpufreq-set -c $i -g performance" | |
| cpufreq-set -c $i -g performance | |
| done | |
| cd ~/Downloads | |
| # Check/remove atlas3.10.1.tar.bz2 | |
| if [ -f ~/Downloads/atlas3.10.1.tar.bz2 ] | |
| then | |
| rm ~/Downloads/atlas3.10.1.tar.bz2 | |
| fi | |
| # Check/remove lapack-3.4.2.tgz | |
| if [ -f ~/Downloads/lapack-3.4.2.tgz ] | |
| then | |
| rm ~/Downloads/lapack-3.4.2.tgz | |
| fi | |
| # Download atlas3.10.1.tar.bz2 | |
| sudo -u $UserName wget http://softlayer-dal.dl.sourceforge.net/project/math-atlas/Stable/3.10.1/atlas3.10.1.tar.bz2 | |
| # Download lapack-3.4.2.tgz | |
| sudo -u $UserName wget http://www.netlib.org/lapack/lapack-3.4.2.tgz | |
| # Extract atlas3.10.1.tar.bz2 | |
| sudo -u $UserName tar xjf ~/Downloads/atlas3.10.1.tar.bz2 | |
| # Compile and Install | |
| cd ATLAS | |
| sudo -u $UserName mkdir obj64 | |
| cd obj64 | |
| sudo -u $UserName mkdir ~/Downloads/atlasComp | |
| sudo -u $UserName ../configure -b 64 -D c -DPentiumCPS=3000 --shared --prefix=~/Downloads/atlasComp --with-netlib-lapack-tarfile=~/Downloads/lapack-3.4.2.tgz | |
| sudo -u $UserName make | |
| sudo -u $UserName make check | |
| sudo -u $UserName make ptcheck | |
| sudo -u $UserName make time | |
| sudo -u $UserName make install | |
| cd ~ | |
| # Move files | |
| mkdir /usr/local/include/atlas | |
| cp -r ~/Downloads/atlasComp/include/atlas/* /usr/local/include/atlas/ | |
| cp -r ~/Downloads/atlasComp/include/cblas.h /usr/local/include/atlas/ | |
| cp -r ~/Downloads/atlasComp/include/clapack.h /usr/local/include/atlas/ | |
| cp -r ~/Downloads/atlasComp/lib/* /usr/local/lib/ | |
| # Cleanup | |
| rm ~/Downloads/atlas3.10.1.tar.bz2 | |
| rm ~/Downloads/lapack-3.4.2.tgz | |
| rm -r ~/Downloads/ATLAS | |
| rm -r ~/Downloads/atlasComp | |
| echo "ATLAS Install Complete" | |
| ## ## ## spglib install ## ## ## | |
| # Install required packages | |
| cd ~/Downloads | |
| # Check/remove spglib-1.4.1.tar.gz | |
| if [ -f ~/Downloads/spglib-1.4.1.tar.gz ] | |
| then | |
| rm ~/Downloads/spglib-1.4.1.tar.gz | |
| fi | |
| # Download spglib-1.4.1.tar.gz | |
| sudo -u $UserName wget http://hivelocity.dl.sourceforge.net/project/spglib/spglib/spglib-1.4/spglib-1.4.1.tar.gz | |
| # Extract spglib-1.4.1.tar.gz | |
| sudo -u $UserName tar xzf ~/Downloads/spglib-1.4.1.tar.gz | |
| # Compile and Install | |
| cd spglib-1.4.1 | |
| sudo -u $UserName ./configure | |
| sudo -u $UserName make | |
| cd ~ | |
| # Move files | |
| mkdir /usr/local/include/spglib | |
| cp ~/Downloads/spglib-1.4.1/src/.libs/libsymspg.a /usr/local/lib | |
| cp ~/Downloads/spglib-1.4.1/src/*.h /usr/local/include/spglib | |
| # Cleanup | |
| rm -r ~/Downloads/spglib-1.4.1 ~/Downloads/spglib-1.4.1.tar.gz | |
| echo "spglib Install Complete" | |
| ## ## ## LAPACK install ## ## ## | |
| # Install required packages | |
| apt-get -y install gfortran | |
| cd ~/Downloads | |
| # Check/remove lapack-3.4.2.tgz | |
| if [ -f ~/Downloads/lapack-3.4.2.tgz ] | |
| then | |
| rm ~/Downloads/lapack-3.4.2.tgz | |
| fi | |
| # Download lapack-3.4.2.tgz | |
| sudo -u $UserName wget http://www.netlib.org/lapack/lapack-3.4.2.tgz | |
| # Extract lapack-3.4.2.tgz | |
| sudo -u $UserName tar xzf ~/Downloads/lapack-3.4.2.tgz | |
| # Compile and Install | |
| cd ~/Downloads/lapack-3.4.2 | |
| sudo -u $UserName cp make.inc.example make.inc | |
| sudo -u $UserName sed -i -e 's/..\/..\/librefblas.a/-lf77blas -lcblas -latlas -lgfortran/g' make.inc | |
| sudo -u $UserName make | |
| cd lapacke | |
| sudo -u $UserName make | |
| cd ~ | |
| # Change Change lapacke.h file | |
| sudo -u $UserName sed -i -e 's/\/* Complex types are structures equivalent to the/*\/\n\n#define lapack_complex_float std::complex<float>\n#define lapack_complex_double std::complex<double>\n\n\/* Complex types are structures equivalent to the/g' ~/Downloads/lapack-3.4.2/lapacke/include/lapacke.h | |
| # Move files | |
| mkdir /usr/local/include/lapack/ | |
| cp ~/Downloads/lapack-3.4.2/lapacke/include/* /usr/local/include/lapack/ | |
| cp ~/Downloads/lapack-3.4.2/liblapack.a ~/Downloads/lapack-3.4.2/liblapacke.a ~/Downloads/lapack-3.4.2/libtmglib.a /usr/local/lib/ | |
| # Cleanup | |
| rm ~/Downloads/lapack-3.4.2.tgz | |
| rm -r ~/Downloads/lapack-3.4.2 | |
| echo "LAPACK Install Complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment