Ubuntu 16.04 LTS (64bit)

   Ubuntu 16.04 LTS amd64 (64 bit版)をインストールし、第一原理計算コードをセットアップするまでを解説する
------------------------------------------------------------------------------
■ sudo apt-get install

# Update
sudo apt-get update

# Compiler (Intel compiler need g++)
sudo apt-get -y install build-essential
sudo apt-get -y install g++
sudo apt-get -y install gfortran

# Script (WIEN2k use csh and tcsh)
sudo apt-get -y install csh
sudo apt-get -y install tcsh

# XcrySDen
sudo apt-get -y install tk tcl tclx

# Plot soft (WIEN2k use gnuplot)
sudo apt-get -y install gnuplot
sudo apt-get -y install grace
sudo apt-get -y install rasmol
sudo apt-get -y install xterm

# phonopy
sudo apt-get -y install python-dev python-numpy python-matplotlib python-yaml python-h5py

# phono3py
sudo apt-get -y install libgomp1 liblapack-dev liblapacke-dev

# BoltzTraP (for VASP)
sudo apt-get install python-ase

# SPR-KKR
sudo apt-get -y install imagemagick graphicsmagick-imagemagick-compat iwidgets4

# python
sudo apt-get -y install python-tk
sudo apt-get -y install python-lxml
sudo apt-get -y install python-scipy
sudo apt-get -y install python-setuptools
sudo apt-get -y install texlive

# Patch
sudo apt-get -y install patch

other method: Ubuntu Software Center > gfortran
-----------------------------------------------------------------------------
■ Intel compiler (parallel_studio_xe_2016_update4)
Rough process
1. tar zxvf $HOME/Downloads/parallel_studio_xe_2016_update4.tgz
2. cd par*
3. sudo ./install.sh
4. Please type a selection or press "Enter" to accept default choice [1]: Enter
5. space
6. accept
7. Please type a selection or press "Enter" to accept default choice [1]: Enter
8. Serial number
9. Press "Enter" key to continue: Enter
10. Please type a selection: 1
11. Please type a selection or press "Enter" to accept default choice [1]:
12. space
13. accept
14. all enter

15. gedit $HOME/.bashrc
#--------------------
# Intel Compiler ( Fortran & C++ ) environmental setting
export PATH=$PATH:/opt/intel/vtune_amplifier_xe
export PATH=$PATH:/opt/intel/inspector_xe
source /opt/intel/bin/compilervars.sh intel64
# mpiifort (intel mpi)
source /opt/intel/impi/5.1.3.258/bin64/mpivars.sh
#--------------------

# FFT
1. bash
2. sudo bash
3. cd /opt/intel/composer_xe_2013/mkl/interfaces/fftw3xf/
4. make libintel64 compiler=intel

[1] https://software.intel.com/en-us/articles/how-to-run-intel-mpi-on-xeon-phi
-----------------------------------------------------------------------------
■ FFTW3 (FFTW3 for WIEN2k)
1) tar zxvf $HOME/Downloads/fftw-3.3.5.tar.gz
2) cd ff*
3) ./configure MPICC=mpiicc CC=icc F77=ifort --enable-avx2 --enable-mpi
4) make
5) sudo make install
My PC: Intel(R) Core(TM) i7-4770S (can use SSE4.1/4.2, AVX 2.0), see cpuinfo and web
-----------------------------------------------------------------------------
OpenMPI (skip this procedure for intelmpi, home case)

1. download: http://www.open-mpi.org/

2. tar zxvf $HOME/Downloads/openmpi-1.8.8.tar.gz
3. cd openmpi*
4. ./configure -prefix=$HOME/openmpi CXX=icpc CC=icc FC=ifort F90=ifort F77=ifort
5. make
6. make install
----------
7. gedit ~/.bashrc
#--------------------
# OpenMPI environmental setting
export MPIROOT=$HOME/openmpi
export PATH=$MPIROOT/bin:$PATH
export LD_LIBRARY_PATH=$MPIROOT/lib:$LD_LIBRARY_PATH
export MANPATH=$MPIROOT/share/man:$MANPATH
#--------------------
-----------------------------------------------------------------------------
OpenMPI (skip this procedure for intelmpi, root case)

1. download: http://www.open-mpi.org/
2. tar zxvf $HOME/Downloads/openmpi-1.8.8.tar.gz
3. cd op*
4. ./configure CXX=g++ CC=gcc FC=ifort F90=ifort F77=ifort
  or
  ./configure CXX=icpc CC=icc FC=ifort F90=ifort F77=ifort
  or
  ./configure -prefix=/usr/local/openmpi CXX=icpc CC=icc FC=ifort F90=ifort F77=ifort
5. make
   or
   sudo make
6. sudo make install
----------
7. gedit ~/.bashrc
#--------------------
# OpenMPI environmental setting
export MPIROOT=/usr/local/openmpi
export PATH=$MPIROOT/bin:$PATH
export LD_LIBRARY_PATH=$MPIROOT/lib:$LD_LIBRARY_PATH
export MANPATH=$MPIROOT/share/man:$MANPATH
#--------------------
------------------------------------------------------------------------------
■ cif2cell
1. tar zxvf cif2cell-1.2.10.tar.gz
2. cd cif2cell-1.2.10
3. gedit cif2cell
----------
before-----line 1608 (shortcut command: Ctrl + I )
incarfile = INCARFile(cd,docstring=docstring,vca=options.vca,prioritylist=prioritylist,encutfac=encutfac)

after-------line 1608
incarfile = INCARFile(cd,docstring=docstring,potcardir=lib,vca=options.vca,prioritylist=prioritylist,encutfac=encutfac)
----------
4. sudo python setup.py install
------------------------------------------------------------------------------
■ XcrySDen
1) download: http://www.xcrysden.org/Download.html
2) tar zxvf $HOME/Downloads/xc-1.5.23-linux_x86_64-semishared.tar.gz
3) cd XCr*
4) ./xcConfigure
5) Do you have a CRYSTAL package ([y]es/[n]o): n
6) Is this correct ([y]es/[n]o): y
7) Would you like to add xcrysden icon to the desktop ([y]es/[n]o): n
8) bash
* command: xcrysden
------------------------------------------------------------------------------
■ XcrySDen
1) download: http://www.xcrysden.org/Download.html
2) tar zxvf $HOME/Downloads/xcrysden-1.5.60-linux_x86_64-semishared.tar.gz
3) cd xcr*
4) gedit $HOME/.bashrc
#--------------------
# xcrysden
XCRYSDEN_TOPDIR=$HOME/xcrysden-1.5.60-bin-semishared
XCRYSDEN_SCRATCH=$HOME/xcrys_tmp
export XCRYSDEN_TOPDIR XCRYSDEN_SCRATCH
PATH="$XCRYSDEN_TOPDIR:$PATH:$XCRYSDEN_TOPDIR/scripts:$XCRYSDEN_TOPDIR/util"
#--------------------
------------------------------------------------------------------------------
■ VESTA
1. download: http://jp-minerals.org/vesta/jp/
2. tar xvf $HOME/Downloads/VESTA-x86_64.tar.bz2
3. ./VESTA
------------------------------------------------------------------------------
■ WIEN2k
1) mkdir WIEN2k_14
2) cd WIEN2k_14
3) cp $HOME/Downloads/WIEN2k_14.2.tar ./
4) tar -xvf WIEN2k_14.2.tar
5) gunzip *.gz
6) chmod +x ./expand_lapw
----------
7) ./expand_lapw
  WARNING: This will expand all WIEN.tar files !!!
It will overwrite all changes you have made previously in the WIEN subdirectories
continue (y/n)
y
-----------
8) ./siteconfig_lapw
  Press RETURN to continue
  Enter
----------
9) I    Linux (Intel ifort compiler (12.0 and later) + mkl )
  i
  Press RETURN to continue
  Enter
----------
10) Your compiler: ifort
  Your compiler: icc
  Press RETURN to continue
  Enter
  Hit Enter to continue
  Enter
----------
11) Current settings:
  O   Compiler options: -FR -mp1 -w -prec_div -pc80 -pad -ip -DINTEL_VML -traceback -assume buffered_io -axAVX2
  F   FFTW options: -DFFTW3 -I/usr/local/lib/include
  FL  FFTW_LIBS: -lfftw3_mpi -lfftw3 -L/usr/local/lib/lib
----------
12) Shared Memory Architecture? (y/n): y
  Do you know/need a command to bind your jobs to specific nodes ?
  (like taskset -c). Enter N / your_specific_command: N
----------
13)    Do you have MPI, Scalapack and FFTW installed and intend to run finegrained parallel?
   This is useful only for BIG cases (50 atoms and more / unit cell)
   and your HARDWARE has at least 16 cores (or is a cluster with Infiniband)
   You need to KNOW details about your installed  MPI and FFTW )
   (y/n) y
     Recommended setting for parallel f90 compiler: mpiifort
     Current selection:  
     Your compiler: mpiifort
 Finding the required fftw2/3 mpi-files in /usr and /opt ..../usr/local/lib/libfftw3_mpi.a
could not find fftw ....
Your present FFTW choice is: FFTW3
Please specify whether you want to use FFTW3 (default) or FFTW2  (FFTW3 / FFTW2):
Present FFTWpath is: /usr/local/lib
Please specify the ROOT-path of your FFTW installation (like /opt/fftw3): /usr/local/lib
Your FFTW_LIBS are: -lfftw3_mpi -lfftw3 -L/usr/local/lib/lib
Your FFTW_OPT are : -DFFTW3 -I/usr/local/lib/include
is this correct? enter Y (default) or n: y
FP  FPOPT(par.comp.options): -FR -mp1 -w -prec_div -pc80 -pad -ip -DINTEL_VML -traceback -assume buffered_io -axAVX2
----------
14) A   Compile all programs (suggested)
  a
----------
15) ./userconfig_lapw
----------
16) .bashrc
  export OMP_NUM_THREADS=4
----------
17) bash
18) w2web
My PC: Intel(R) Core(TM) i7-4770S (can use SSE4.1/4.2, AVX 2.0), see cpuinfo and web
------------------------------------------------------------------------------
■ boltztrap
1. tar xvf BoltzTraP.tar.bz2
2. cd boltztrap-*/src
3. gedit Makefile
   FC=ifort
   FOPT = -FR -mp1 -w -prec_div -pc80 -pad -align -DINTEL_VML -traceback -axAVX,SSE4.2,SSE4.1,SSSE3,SSE3
   LDFLAGS = $(FOPT) -L$(MKLROOT)/lib/$(MKL_TARGET_ARCH) -pthread
   LIBS = -lmkl_lapack95_lp64 -lmkl_blas95_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -openmp -lpthread
4. make
------------------------------------------------------------------------------
■ spglib
1. download: https://sourceforge.net/projects/spglib/
2. tar zxvf spglib*
3. cd spg*
4. ./configure
5. make
6. sudo make install
------------------------------------------------------------------------------
■ pyspglib-1.8.3.1 (BoltzTraP for VASP)
1. download: https://pypi.python.org/pypi/pyspglib
2. tar zxvf pyspglib*
3. cd spg*
4. sudo python setup.py install
------------------------------------------------------------------------------
■ vasp.5.lib
1. tar zxvf vasp.5.lib.tar.gz
2. cd vasp.5.lib
3. cp makefile.linux_ifc_P4 makefile
4. gedit makefile
  -----(Note: CC=cc)
  CPP     = gcc -E -P -C $*.F >$*.f
  FC=ifort

  CFLAGS = -O
  FFLAGS = -O0 -FI -axAVX2,AVX,SSE4.2,SSE4.1,SSE3,SSSE3,SSE2
  -----
5. make
------------------------------------------------------------------------------
■ vasp.5.3 (OpenMPI)
1. tar zxvf vasp.5.3.3.tar.gz
2. cd vasp.5.3
3. cp makefile.linux_ifc_P4 makefile
4. gedit makefile
  -----
  FC=ifort
  FCL=$(FC)
  CPP_ =  ./preprocess <$*.F | /usr/bin/cpp -P -C -traditional >$*$(SUFFIX)
  CPP_=fpp -f_com=no -free -w0 $*.F $*$(SUFFIX)
  CPP     = $(CPP_)  -DHOST=\"LinuxIFC\" \
          -DCACHE_SIZE=12000 -DPGF90 -Davoidalloc -DNGXhalf \
  FFLAGS =  -FR -names lowercase -assume byterecl
  OFLAG=-O2 -ip -axAVX2,AVX,SSE4.2,SSE4.1,SSE3,SSSE3,SSE2
  OFLAG_HIGH = $(OFLAG)
  OBJ_HIGH =
  OBJ_NOOPT =
  DEBUG  = -FR -O0
  INLINE = $(OFLAG)
  MKL_PATH=$(MKLROOT)/lib/intel64
  MKL_FFTW_PATH=$(MKLROOT)/interfaces/fftw3xf/
  BLAS=
  LAPACK=
  LIB  = -L../vasp.5.lib -ldmy \
     ../vasp.5.lib/linpack_double.o $(LAPACK) \
     $(BLAS)
  FFT3D   = fft3dfurth.o fft3dlib.o
  FC=mpif90
  FCL=$(FC) -mkl
  CPP    = $(CPP_) -DMPI  -DHOST=\"LinuxIFC\" -DIFC \
     -DCACHE_SIZE=4000 -DPGF90 -Davoidalloc -DNGZhalf \
     -DMPI_BLOCK=8000 -Duse_collective -DscaLAPACK
  BLACS= -lmkl_blacs_openmpi_lp64
  SCA= $(MKL_PATH)/libmkl_scalapack_lp64.a $(BLACS)
  LIB     = -L../vasp.5.lib -ldmy  \
      ../vasp.5.lib/linpack_double.o \
      $(SCA) $(LAPACK) $(BLAS)
  FFT3D   = fftmpi.o fftmpi_map.o fft3dfurth.o fft3dlib.o
  -----
5. make
Retry case: gedit makefile > make clean > make
------------------------------------------------------------------------------
■ vasp.5.3 (IntelMPI)
1. tar zxvf vasp.5.3.3.tar.gz
2. cd vasp.5.3
3. cp makefile.linux_ifc_P4 makefile
4. gedit makefile
  -----
  FC=ifort
  FCL=$(FC)
  CPP_ =  ./preprocess <$*.F | /usr/bin/cpp -P -C -traditional >$*$(SUFFIX)
  CPP_=fpp -f_com=no -free -w0 $*.F $*$(SUFFIX)
  CPP     = $(CPP_)  -DHOST=\"LinuxIFC\" \
          -DCACHE_SIZE=12000 -DPGF90 -Davoidalloc -DNGXhalf \
  FFLAGS =  -FR -names lowercase -assume byterecl
  OFLAG=-O2 -ip -axAVX2,AVX,SSE4.2,SSE4.1,SSE3,SSSE3,SSE2
  OFLAG_HIGH = $(OFLAG)
  OBJ_HIGH =
  OBJ_NOOPT =
  DEBUG  = -FR -O0
  INLINE = $(OFLAG)
  MKL_PATH=$(MKLROOT)/lib/intel64
  MKL_FFTW_PATH=$(MKLROOT)/interfaces/fftw3xf/
  BLAS=
  LAPACK=
  LIB  = -L../vasp.5.lib -ldmy \
     ../vasp.5.lib/linpack_double.o $(LAPACK) \
     $(BLAS)
  FFT3D   = fft3dfurth.o fft3dlib.o
  FC=mpiifort
  FCL=$(FC) -mkl
  CPP    = $(CPP_) -DMPI  -DHOST=\"LinuxIFC\" -DIFC \
     -DCACHE_SIZE=4000 -DPGF90 -Davoidalloc -DNGZhalf \
     -DMPI_BLOCK=8000 -Duse_collective -DscaLAPACK -Duse_collective \
     -DnoAugXCmeta -Duse_bse_te \
     -Duse_shmem -Dtbdyn
  BLACS= -lmkl_blacs_intelmpi_lp64
  SCA= $(MKL_PATH)/libmkl_scalapack_lp64.a $(BLACS)
  LIB     = -L../vasp.5.lib -ldmy  \
      ../vasp.5.lib/linpack_double.o \
      $(SCA) $(LAPACK) $(BLAS)
  FFT3D   = fftmpiw.o fftmpi_map.o  fftw3d.o  fft3dlib.o   $(MKL_FFTW_PATH)/libfftw3xf_intel.a
  INCS = -I$(MKLROOT)/include/fftw
  -----
5. make
Retry case: gedit makefile > make clean > make
------------------------------------------------------------------------------
■ recompile
Phonon calculation error case
---------
    internal error in SETUP_DEG_CLUSTERS: NB_TOT exceeds NMAX_DEG
    increase NMAX_DEG to         144
---------

1. cd $HOME/vasp.5.3
2. grep NMAX_DEG *.f90
 You get "subrot_cluster.f90:    INTEGER, PARAMETER :: NMAX_DEG=48"
-----
3. gedit subrot_cluster.F
-----before-----
    INTEGER, PARAMETER :: NMAX_DEG=48
-----after-----
    INTEGER, PARAMETER :: NMAX_DEG=168
-----
4. make

※ VASPはCとFortranのプリプロセッサ(cppとfpp)を用いて、.Fの拡張子がついたファイルをコンパイルするPCの環境に合わせたものに書き換えて.f90の拡張子がついたものとして出力する。
 上記のようにコードを書き換える場合には、.Fの拡張子を書き換えておくと安心できる。
(VASP makefile copy subrot_cluster.F to subrot_cluster.f90)
------------------------------------------------------------------------------
■ potpaw_PBE
1. mkdir potpaw_PBE
2. cd potpaw_PBE
3. tar zxvf potpaw_PBE.tgz
------------------------------------------------------------------------------
■ Phonopy
1) download phonopy: http://atztogo.github.io/phonopy/
to http://atztogo.github.io/phonopy/inst...
2) download phonopy-1.11.2.25.tar.gz
3) tar zxvf phonopy-1.11.2.25.tar.gz
4) cd phonopy*
5) sudo python setup.py install
------------------------------------------------------------------------------
■ Phono3py
1) download phono3py: http://atztogo.github.io/phono3py/
to http://atztogo.github.io/phono3py/ins...
2) tar zxvf phono3py-1.11.3.29.tar.gz
3) cd phono3py*
4) sudo python setup.py install
------------------------------------------------------------------------------
■ intelmpi environmental settings (skip this procedure for OpenMPI)
# ssh
1. sudo apt-get install openssh-server
2. sudo apt-get install ssh
3. mkdir .ssh
4. ssh-keygen
  All enter
5. cd .ssh
6. cat id_rsa.pub > authorized_keys
7. sudo gedit /etc/ssh/sshd_config
8. service ssh restart

# MPD
1. gedit $HOME/.mpd.conf
  secretword=<mpd secret word>
2. chmod 600 $HOME/.mpd.conf
3. gedit $HOME/mpd.hosts
  127.0.0.1
4. gedit $HOME/machinefile
  127.0.0.1:4
5. mpdallexit
6. mpdboot -f $HOME/mpd.hosts -n 4 -r ssh
7. mpdtrace
8. mpiexec -machinefile $HOME/machinefile -n 2 python -V

# Usage
mpiexec -machinefile $HOME/machinefile -env I_MPI_DEVICE sock -n 4 /home/student/vasp/vasp.5.3/vasp -r ssh
mpirun -machinefile $HOME/machinefile -env I_MPI_DEVICE sock -np 4 /home/student/vasp/vasp.5.3/vasp -r ssh
mpirun -machinefile $HOME/machinefile -genv I_MPI_DEVICE sock -n 4 /home/student/vasp/vasp.5.3/vasp -r ssh
------------------------------------------------------------------------------
■ hyperthreading OFF
[1] https://monostudio.jp/1178
------------------------------------------------------------------------------
■ Abinit

◇ intel MPI + intel compiler + MKL + intel FFT
1. tar zxvf $HOME/Downloads/abinit-7.10.5.tar.gz
2. cd abinit-7.10.5
3. ./configure FC=mpiifort CC=mpiicc CXX=mpiicpc --with-linalg-flavor="mkl" --with-linalg-incs="-I/opt/intel/compilers_and_libraries/linux/mkl/include/intel64/lp64 -I/opt/intel/compilers_and_libraries/linux/mkl/include" --with-linalg-libs="-L/opt/intel/compilers_and_libraries/linux/mkl/lib/intel64 -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl" --with-fft-flavor=fftw3-mkl --with-fft-libs="-L/opt/intel/compilers_and_libraries/linux/mkl/interfaces/fftw3xf -lfftw3xf_intel" --enable-64bit-flags FCFLAGS_EXTRA="-O2 -axAVX2,AVX,SSE4.2" CFLAGS_EXTRA="-O2 -axAVX2,AVX,SSE4.2" CXXFLAGS_EXTRA="-O2 -axAVX2,AVX,SSE4.2"
4. make mj4
5. cd tests
6. mpirun -machinefile $HOME/machinefile -env I_MPI_DEVICE sock -r ssh ./runtests.py -j4 fast
7. cd ..
8. sudo make install

◇ Usage
mpirun -machinefile $HOME/machinefile -env I_MPI_DEVICE sock -r ssh -np 4 abinit < case.in > case.out
------------------------------------------------------------------------------
■ PWscf

◇ intel MPI + intel compiler + MKL + intel FFT
1. tar zxvf $HOME/Downloads/qe-6.0.tar.gz
2. cd qe-6.0
3. ./configure MPIF90=mpiifort CXX=g++ CC=gcc FC=ifort F77=ifort F90=ifort BLAS_LIBS="${MKLROOT}/lib/intel64/libmkl_blas95_lp64.a ${MKLROOT}/lib/intel64/libmkl_lapack95_lp64.a -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -lpthread -lm -ldl" LAPACK_LIBS="${MKLROOT}/lib/intel64/libmkl_blas95_lp64.a ${MKLROOT}/lib/intel64/libmkl_lapack95_lp64.a -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -lpthread -lm -ldl" FFT_LIBS="${MKLROOT}/interfaces/fftw3xf/libfftw3xf_intel.a" --enable-openmp
4. make all

◇ Usage
mpirun -machinefile $HOME/machinefile -env I_MPI_DEVICE sock -r ssh -np 4 $HOME/qe-6.0/bin/pw.x < case.in > case.out
------------------------------------------------------------------------------
 
QRコード
携帯用QRコード
アクセス数
ページビュー数
[無料でホームページを作成] [通報・削除依頼]