#! /bin/bash #What I will do after a fresh copy of CENTOS 7 system is up ========================================================== #Preliminary #========== # specify user here. Modify as deemed neccesary for your case user=tlyoon #! /bin/bash # Alert sound effect off (done manually, optional) su - cd / mkdir share mkdir state chmod -R 777 share chmod -R 777 state useradd $user usermod -g users $user passwd $user su - $user mkdir ~/share mkdir ~/share/apps mkdir ~/share/apps/configrepo mkdir ~/share/apps/local mkdir ~/share/apps/local/bin mkdir ~/share/apps/local/lib mkdir ~/state mkdir ~/state/partition1 cd /share ln -s /home/$user/share/apps/ . cd /share/apps/local/bin/ cd /state ln -s /home/$user/state/partition1/ . su - echo 'export PATH=/share/apps/local/bin:$PATH'>> ~/.bashrc echo 'export LD_LIBRARY_PATH=/share/apps/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc cd /share/apps/local/bin/ scp comsics.usm.my:/share/apps/local/bin/check_pbs . chmod +x check_pbs yum install -y epel-release yum install -y python-devel.x86_64 ##needed by lammps yum install -y seamonkey yum install -y libjpeg-turbo-devel.x86_64 yum groups mark convert yum groupinstall "Development Tools" yum install -y glib.x86_64 yum install -y vim yum install -y zlib-devel.x86_64 yum install -y openmpi.x86_64 openmpi-devel.x86_64 echo 'export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH' >> ~/.bashrc echo 'export PATH=/usr/lib64/openmpi/bin:$PATH' >> ~/.bashrc #1 ### Install Intel Paralell studio ## 1. Obtain the file (huge, ~ 4 GB) parallel_studio_xe_2017_update2.tgz cd /share/apps/configrepo; wget https://staffusm-my.sharepoint.com/personal/tlyoon_usm_my/_layouts/15/guestaccess.aspx?docid=15eb9f5ebb18e4cbba413143f88e799a9&authkey=AZ6iimEVoqEgLFnpm7b6oa8 ## this links to parallel_studio_xe_2017_update2.tgz; tar -xzvf parallel_studio_xe_2017_update2.tgz; cd parallel_studio_xe_2017_update2; ./install_GUI.sh ### Need to obtain the license and activation manually. The license is MAC address dependent. You can check your MAC address of current hardware by issuing ifconfig # After finish installation, echo '# sourcing INTEL compilers' >> ~/.bashrc echo 'source $PROD_DIR/bin/compilervars.sh intel64' >> ~/.bashrc #2 ### Install google chrome ### cd /share/apps/configrepo; wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm; yum -y install redhat-lsb libXScrnSaver; rpm -Uvh google-chrome-stable_current_x86_64.rpm #3 ### Tunned ATLAS library cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/BLAS_and_LAPACK/inst_atlas; sh inst_atlas #4 ### yummed lapack and blas lib yum install -y lapack.x86_64 lapack-devel.x86_64 lapack-static.x86_64 lapack64.x86_64 lapack64-devel.x86_64 lapack64-static.x86_64 #5 ## Install ptmbhga cd /share/apps/configrepo; wget https://staffusm-my.sharepoint.com/personal/tlyoon_usm_my/Documents/Downloads/ptmbhga_v2.1.tar ; mv ptmbhga_v2.1.tar ../ ; mkdir ptmbhga ; cd ptmbhga; mv ../ptmbhga_v2.1.tar . ; tar -zxvf ptmbhga_v2.1.tgz ; cd template; ./config.make; cd ../VER2.1/; make #6 ## Install pev6.0 ## Note that pev6.0 is equivalent to p0 ### cd /share/apps; scp root@comsics.usm.my:/share/apps/pe/VER6.0.tar.gz . ; mkdir pe; cd pe; mv ../VER6.0.tar.gz . ; tar -zxvf VER6.0.tar.gz; cd VER6.0/ ; make -f Makefile.centos7 ; ln -s /share/apps/pe/VER6.0/pev6.0 /share/apps/local/bin ; ./config.make #7 ## Install gaussian 09 cd /share/apps/configrepo; wget http://comsics.usm.my/tlyoon/configrepo/howto/gaussian/inst_g09 ; ./inst_g09 ## Add an exsiting user as gaussian 09 user cd /share/apps/configrepo ; wget http://comsics.usm.my/tlyoon/configrepo/howto/gaussian/add_g09_user.sh ; ./add_g09_user.sh ; ## Install pg9v6.0.2 mkdir /share/apps/pe ; cd /share/apps/pe ; scp -r comsics.usm.my:/share/apps/pe/pg9v6.0.2.SN_CENTOS.tar.gz . ; tar -zxvf pg9v6.0.2.SN_CENTOS.tar.gz ; #8 ## Install fftw3 gnu version cd /share/apps/configrepo; wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/fftw/inst_fftw334_sa_openmpi ; sh inst_fftw334_sa_openmpi #9 ## Install Quantum Expresso version 6.1 cd /share/apps/; wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/inst_qe_6.1 ; sh inst_qe_6.1 #10 ## Install lammps gnu version cd /share/apps/configrepo; wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/inst_lammps_31Mar17_gnu.txt ; sh inst_lammps_31Mar17_gnu.txt #11 ## Install plmpv6.0.1 ## First, create the directory /share/apps/mylammps/potentials, in which all potential files from lammps are copied there. mkdir /share/apps/mylammps/; ln -s /share/apps/lammps-31Mar17/potentials /share/apps/mylammps/ ; cd /share/apps/pe ; scp comsics.usm.my:/share/apps/pe/plmpv6.0.1.tar.gz . ; tar -xzvf plmpv6.0.1.tar.gz #12 ## Install dftb+ (version 1.3.0) cd /share/apps/configrepo; wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/inst_dftb+; sh inst_dftb+ #13 ## Install template_pd+v6.0.1 cd /share/apps/configrepo; wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/inst_template_pd+v6.0.1; sh inst_template_pd+v6.0.1 #14 ## Install p0 (original ptmbhga without USM cut & splice, equivalent to pev6.0) cd /share/apps; scp root@comsics.usm.my:/share/apps/configrepo/p0.tar.gz . ; tar -zxvf p0.tar.gz; cd p0/ ; make -f Makefile ; ln -s /share/apps/p0/p0 /share/apps/local/bin ; ./config.make #15 ## Install p1 (ptmbhga USM cut & splice) cd /share/apps; scp root@comsics.usm.my:/share/apps/configrepo/p1.tar.gz . ; tar -zxvf p1.tar.gz; cd p1/ ; make -f Makefile ; ln -s /share/apps/p1/p1 /share/apps/local/bin; ./config.make #16 Install template_p1d+ cd /share/apps; scp -r root@comsics.usm.my:/share/apps/template_p1d+ . #17 Install p2 (ptmbhga USM cut & splice, by default it is to be used by Gaussian 09 to implement EMBH. p2 is equivalent to EMBH); Based on /home/mhlian/embh_amended_from_tw_mbh/EMBH/EMBH@comsics cd /share/apps; scp -r root@comsics.usm.my:/share/apps/p2 . ; cd p2/ ; make clean; make -f Makefile ; ln -s /share/apps/p2/p2 /share/apps/local/bin; ./config.make #18 Install template_p2g (it uses p2 as global optimizer.) cd /share/apps; scp -r root@comsics.usm.my:/share/apps/template_p2g . #19. Install netcdf version 4.3.2 cd /share/apps/configrepo; wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/inst_netcdf_4.3.2; sh inst_netcdf_4.3.2 # yum -y install netcdf.x86_64 #20. Install abinit 7.6.4 cd /share/apps/configrepo; wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/inst_abinit_7.6.4; sh inst_abinit_7.6.4 #21. Install wien2k 14.2 cd /share/apps/configrepo; wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/inst_wien2k_14.2_intel; sh inst_wien2k_14.2_intel ##### the following may be obsolete ######################## ######################################################################################### #20. Install etsf gnu version 1.0.4 ### not working. to fix cd /share/apps/configrepo; wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/inst_etsf_104_gnu; sh inst_etsf_104_gnu #27. Install scalapack gnu version 2.0.2 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/BLAS_and_LAPACK/inst_scalapack sh inst_scalapack #28. Install libxc-2.1.2 gnu cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/inst_libxc212 sh inst_libxc212 29. Install bigdft gnu 1.7.1 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/abinit/inst_bigdft sh inst_bigdft #29. Install abinit gnu ver 7.10.5 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/abinit/inst_abinit_7105_gnu sh inst_abinit_7105_gnu 2. Install nux repo yum localinstall --nogpgcheck http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm 3. Install EL repo, refer to http://www.certdepot.net/rhel7-install-elrepo-repository/ yum install -y "http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm" 4. Install rpmforge repo, refer to http://www.tecmint.com/enable-rpmforge-repository/ cd /share/apps/configrepo wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.i686.rpm 6. Prioritized installation: yum install perl-devel.i686 perl-core.x86_64 ## needed by openmpi Software installation (Must proceed in order, or else you dependence issue may occur) ===================================================================================== 1. Install intel icc into /share/apps cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/intel/inst_icc_11.0.081_sa 2. Install intel ifort into /share/apps cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/intel/inst_ifort_111072_sa 3. Install intel ifftw into /share/apps cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/intel/inst_ifftw_111072_sa 9. Install impi into /share/apps cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/intel/inst_impi_410024_sa 10. Install ATLAS library: cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/BLAS_and_LAPACK/inst_atlas 11. Install openmpi based on gnu cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/openmpi/inst_openmp185_gcc 12. Install mpich2 based on gnu cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/mpich2/inst_mpich2_314_gcc_sa 13. Install openmpi based on intel cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/openmpi/inst_openmp185_intel 14. Install mpich2 based on intel cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/mpich2/inst_mpich2_314_intel_sa 15. Install fftw3 based on gnu cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/fftw/inst_fftw334_gnu 16. Install fftw3 based on intel cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/fftw/inst_fftw334_intel 17. yum install mpich.x86_64 mpich-devel.x86_64 Since somehow /usr/lib64 (where mpich2 is sitting) is not in the PATH and LD_LIBRARY_PATH, these path have to be added manually into ~/.bashrc export PATH=/share/apps/local/bin:/usr/lib64/mpich/bin:$PATH export LD_LIBRARY_PATH=/share/apps/local/lib:/usr/lib64/mpich/lib:$LD_LIBRARY_PATH 18. cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/BLAS_and_LAPACK/inst_atlas; sh inst_atlas 19. Lammps gnu cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/inst_lammps_gnu_sa 20. Lammps intel cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/inst_lammps_intel_sa 21. Install pev6.0 cd /share/apps/configrepo; mkdir pe; cd pe; scp $user@comsics.usm.my:/share/apps/pe/VER6.0.tar.gz . ; tar -zxvf VER6.0.tar.gz; cd /share/apps/configrepo/pe/VER6.0/ makefile -f Makefile.ptmbhga ln -s /share/apps/pe/VER6.0/pev6.0 /share/apps/local/bin ./config.make 22. Install gaussian 09 cd /share/apps/ scp root@comsics.usm.my:/share/apps/configrepo/g09.tar.gz . tar -zxvf g09.tar.gz mv g09.tar.gz configrepo a. As su, create a new group "g09group". Do it only once. groupadd g09group b. Configure permission for /share/apps/g09 chown -R root:g09group /share/apps/g09 chmod -R 750 /share/apps/g09 c. Add an user with suffix "c", e.g., $userc, who will use gaussian 09. adduser $userc passwd $userc d. Add the user $userc to existing group g09group usermod -a -G g09group $userc e. Change the user $userc ssh environment. Replace the last string from bash to csh in file /etc/passwd as example below. The ? shows the sequence number of user or group creation in operating system. From $userc:x:5??:1??::/home/$userc:/bin/bash To $userc:x:5??:1??::/home/$userc:/bin/csh f. Copy cshrc_sample from http://www2.fizik.usm.my/configrepo/howto/customise_centos/cshrc_sample to replace all user's ~/.cshrc cd ~/home/$userc wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/cshrc_sample cp ~/.cshrc ~/.cshrc.orig mv cshrc_sample ~/.cshrc You should find the following lines in /home/$userc/.cshrc: if (! -e /state/partition1/$user) mkdir /state/partition1/$user setenv GAUSS_SCRDIR /state/partition1/$user setenv g09root /share/apps source $g09root/g09/bsd/g09.login setenv PATH ${PATH}:/share/apps/local/bin:/usr/lib64/mpich/bin: setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/share/apps/local/lib:/usr/lib64/mpich/lib:/share/apps/atlas-3-10-2/gnu/lib: If not, then, add it yourself manually, as user $userc. Try re-loging in as $userc. You should not see any 'permission denied' warning from /share/apps/g09/bsd/g09.login. Type in which g09 You should see /share/apps/g09/g09 23. Install pg9v6.0.1 mkdir /share/apps/pe cd /share/apps/pe scp -r comsics.usm.my:/share/apps/pe/pg9v6.0.1.tar.gz . tar -zxvf pg9v6.0.1.tar.gz 24. Install plmpv6.0.1 Assure that the directory /share/apps/mylammps/potentials exists, where all potential files from lammps have been copied there. If not, creat the directory and copy all forcefields from the latest lammps package into it. cd /share/apps/pe scp comsics.usm.my:/share/apps/pe/plmpv6.0.1.tar.gz . tar -xzvf plmpv6.0.1.tar.gz 25. Install netcdf gnu version 4.3.3.1 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/netcdf/inst_netcdf_4331_gnu sh inst_netcdf_4331_gnu 26. Install netcdf_fortran gnu version 4.3.3.1 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/netcdf/inst_netcdf_4331_gnu_fortran sh inst_netcdf_4331_gnu_fortran 27. Install netcdf_parallel gnu version 4.3.3.1 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/netcdf/inst_netcdf_4331_gnu_parallel sh inst_netcdf_4331_gnu_parallel 26. Install etsf gnu version 1.0.4 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/etsf/inst_etsf_104_gnu sh inst_etsf_104_gnu 27. Install scalapack gnu version 2.0.2 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/BLAS_and_LAPACK/inst_scalapack sh inst_scalapack 28. Install libxc-2.1.2 gnu cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/inst_libxc212 sh inst_libxc212 29. Install bigdft gnu 1.7.1 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/abinit/inst_bigdft sh inst_bigdft 29. Install abinit gnu ver 7.10.5 cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/abinit/inst_abinit_7105_gnu sh inst_abinit_7105_gnu 30. Install ptmbhga_abinit (pab version 6.0.1) cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/inst_pab_v6.0.1 sh inst_pab_v6.0.1 30. Install ptmbhga_dftb+ (pd+ version 6.0.1) cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/pd+/inst_pd+_v6.0.1 sh inst_pd+_v6.0.1 ### failed. 30. dftb+ cd /share/apps/configrepo; wget http://www2.fizik.usm.my/configrepo/howto/customise_centos/inst_dftb+ Software installation (less troublesome ones) ============================================ 1. Install Mathematica 2. install vlc (after nux repo is installed) yum install vlc 3. gftp cd /share/apps/configrepo wget http://pkgs.repoforge.org/gftp/gftp-2.0.19-4.el6.rf.x86_64.rpm rpm -ivh gftp-2.0.19-4.el6.rf.x86_64.rpm 4. Install chrome. Refer to http://www.tecmint.com/install-google-chrome-on-redhat-centos-fedora-linux/ cat << EOF > /etc/yum.repos.d/google-chrome.repo [google-chrome] name=google-chrome baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub EOF yum install google-chrome-stable 5. Install virtual box. Refer to http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-virtualbox-4-3-on-centos-7-rhel-7.html yum list VirtualBox* or yum install VirtualBox-5.0.x86_64 service vboxdrv setup usermod -a -G vboxusers $user 5. Move w7_32.vdi from www2 into ~/ 6. yum install lapack64-devel.x86_64 7. Install dropbox for centos 7. Refer to http://computechtips.com/790/install-dropbox-centos-7 yum install libgnome.x86_64 cd /share/apps/configrepo Download from https://www.dropbox.com/install?os=lnx rpm for Fedora 64 bit for Dropbox installation, or use the version from www2 wget http://www2.fizik.usm.my/$user/Downloads/nautilus-dropbox-2015.10.28-1.fedora.x86_64.rpm yum install nautilus-dropbox-2015.10.28-1.fedora.x86_64.rpm yum-config-manager --disable Dropbox 8. Install flash plugin player for adobe in firefox. Refer to http://grokbase.com/t/centos/centos/1498emabyc/flash-plugin-for-centos-7 rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm yum install flash-plugin yum-config-manager --disable Adobe Some useful command: ==================== 1. To verify the repo installed: yum repolist 2. To clean up repo # yum clean all 3. Assuming you have a dual-boot hardisk with windows installed prior to the centos. To detect windows right after installation of fresh centos, refer: http://unix.stackexchange.com/questions/169787/windows-boot-option-is-missing-after-installing-centos-7-how-can-i-get-it-back yum install ntfs-3g grub2-mkconfig > /dev/null #check if see windows loader. If yes, proceed: cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.old grub2-mkconfig -o /boot/grub2/grub.cfg This will allow the windows and other OS installed to appear in the grub when rebooting. 4. Change host name: Refer to http://www.cyberciti.biz/faq/rhel-redhat-centos-7-change-hostname-command/ hostnamectl #to check host name hostnamectl set-hostname $user hostnamectl status 5. To compare running kernel with installed source: uname -r against rpm -q kernel-devel if not, update the kernel via # yum upgrade kernel kernel-devel ##not recommended unless ulmost necessary