您的当前位置:首页正文

vasp安装

2024-03-30 来源:个人技术集锦


1.安装linux

(1) 虚拟机的安装

(2) VMware配置linux,过程如下:

a)选择File菜单下的“New Virtual Machine”出现新虚拟机向导后单击“下一步”

选择“Typical”典型安装。

b)再单击“下一步”,在选择操作系统界面的“Guest Operation System”中选择

“Linux”,然后单击Version对应的下拉菜单选择具体的Linux版本,此处我选择的是“Red

Hat Linux”。

c)单击“下一步”进入安装目录选择界面。该界面上面的文本框是系统的名字,保持默认值即

可,下面的文本框需要选择虚拟机操作系统的安装位置。

(2) VMware下linux的安装

a)安装第一张虚拟光盘

(如果直接用光盘安装,可省去此步及后述的第五步。直接将光盘插入物理光驱即可)

选择VM菜单下的Settings选项,单击比Hardware选项卡下的CD—ROMl,在右边的

“connection”单选按钮组中选择“Use ISO image”然后按“OK”。

b)启动虚拟光驱

点击工具栏上的绿色启动按钮或屏幕显示区的start this virtual machine命令,然后

按“ok”。RED HAT会自动进入安装程序的界面。首先询问的是以图形界面还是以文本界面安

装,依据提示按回车选择图形界面安装,接下来询问是否要测试光驱,这里选择不要即可。

方法是:在VMware窗口上单击一下鼠标(实现从windows切换至VMware),再按键盘上的TAB

键,然后按空格。

注意:光标从Windows切换到VMware只需在VMware窗口上单击鼠标左健,而从VMware回到

Windows,则要按Ctrl十Alt。提醒大家的是,在对虚拟机进行操作前一定要确保光标在

VMware中。

c)设置分区

依提示选择完安装语言、键盘、鼠标、安装类型(与Windows类似,此处不再详述)后进入磁盘

分区界面,此时会出现警告,既然是在虚拟机上进行的操作,此处大胆地选“是”就可以在

接下来的窗口中一路默认连按“下一步”后,弹出“你已选择了要在—F列驱动器内删除所有

分区……”的警告,选择“是”进入引导程序装载界面。

d)设置口令

在引导程序装载界面连按“下一步”。设置完系统语言和时区后进入根口令的设置界面,这

里的根口令相当于Windows 2000的系统管理员密码。设置好口令后连按“下一步”,等待安

装软件包,直到出现更换光盘的提示。

e) 创建个人用户账号和密码

重启后,系统提示你创建一个个人账号和密码,和Windows中创建一个新用户相当。

f) 其它设置

选择日期和试听声卡后问你是否注册,选择“否,我不想注册我的系统”,接下来问

有无附加安装,在此我们先不安装,直接按“前进”。VMware内系统再次重启。

g) 登录系统

启动后。系统询问用户名和密码。

输入在步骤6中设置的户名和密码或输入用户名“root”和第4步中你所设置的根口令

即可。

至此,出现界面,Linux的安装完成了。

登陆root出现鉴定故障,可执行如下操作修改:

(1)以用户账号进入终端,允许root账号登陆:

(2)$ su

(3)输入密码:

(4)#vi /etc/pam.d/gdm

(5)删除其中的一行 auth required pam_succeed_if.souser != root quiet

(6):wq保存并退出。

(7)#vi /etc/pam.d/gdm-passwaord

(8)删除其中的一行 auth required pam_succeed_if.souser != root quiet

(9):wq保存并退出。

(4) VMware下windows和linux共享文件的方法

由于VASP和很多数据库的安装文件是保存在windows下面的,而linux对有些U盘并不容易识别,所以最好能使linux使用windows下面的文件。

用VMware tools 工具

命令yum install gcc*

2.安装ifort编译器

3安装MPI

1、解压文件, mpich2-1.3.1.tar

2、./configure --prefix=/usr/local/mpich2 --with-rsh=ssh

3、make

4、make install

5、新建/etc/mpd.conf文件,内容为secretword=myword

6、命令touch /etc/mpd.conf

7、命令chmod 600 /etc/mpd.conf

8、vi /root/.bash_profile和vi /etc/profile在最后增加

export PATH=$PATH:/usr/local/mpich2/bin

export MPI_USEP4SSPORT=yes

export MPI_P4SSPORT=22

export P4_RSHCOMMAND=ssh

4安装数学库GotoBlas、fftw

1、解压文件,GotoBLAS-1.09.tar

2、修改detect文件如下

rm -f getarch.cmd

make clean

##which g77 > /dev/null 2> /dev/null

##if [ 0 == $? ]; then

##FCOMPILER=G77

##fi

##which g95 > /dev/null 2> /dev/null

##if [ 0 == $? ]; then

##FCOMPILER=G95

##fi

##which gfortran > /dev/null 2> /dev/null

##if [ 0 == $? ]; then

##FCOMPILER=GFORTRAN

##fi

##which ifort > /dev/null 2> /dev/null

##if [ 0 == $? ]; then

##FCOMPILER=INTEL

##fi

which pgf90 > /dev/null 2> /dev/null

if [ 0 == $? ]; then

FCOMPILER=PGI

fi

##which pathf90 > /dev/null 2> /dev/null

##if [ 0 == $? ]; then

##FCOMPILER=PATHSCALE

##fi

##which xlf > /dev/null 2> /dev/null

##if [ 0 == $? ]; then

##FCOMPILER=IBM

##fi

HAS_SMP=0

##NUM_CPU=`cat /proc/cpuinfo | grep -c processor`

##if [ $NUM_CPU -gt 1 ]; then

##HAS_SMP=1

##fi

3、修改Makefile.rule

#

# Beginning of user configuration

#

# This library's version

REVISION = -r1.09

# Which do you prefer to use for C compiler? Default is gcc.

# I recommend you to use GCC because inline assembler is required.

C_COMPILER = GNU

# C_COMPILER = INTEL

# Which do you prefer to use for Fortran compiler? Default is GNU g77.

# F_COMPILER = G77

# F_COMPILER = G95

# F_COMPILER = GFORTRAN

# F_COMPILER = INTEL

F_COMPILER = PGI

# F_COMPILER = PATHSCALE

# F_COMPILER = IBM

# F_COMPILER = COMPAQ

# F_COMPILER = SUN

# F_COMPILER = F2C

# If you need 64bit binary; some architecture can accept both 32bit and

# 64bit binary(EM64T, Opteron, SPARC and Power/PowerPC).

BINARY64 = 1

# If you want to build threaded version.

# You can specify number of threads by environment value

# \"OMP_NUM_THREADS\

SMP = 1

# You may specify Maximum number of threads. It should be minimum.

# For OpenMP users; you have to specify MAX_THREADS even if you don't

# use threaded BLAS(MAX_THREADS >= OMP_NUM_THREADS * GOTO_NUM_THREADS)

MAX_THREADS = 4

# Default setting is using busy wait synchronization instead of

# pthread barrier to improve performance. If you see performance

# decrement, please uncomment this.

# CCOMMON_OPT += -DNOUSE_BUSYWAIT

# If you need Special memory management;

# Using HugeTLB file system(Linux / AIX / Solaris)

# CCOMMON_OPT += -DALLOC_HUGETLB

# Using static allocation instead of dynamic allocation

# You can't use it with ALLOC_HUGETLB

# CCOMMON_OPT += -DALLOC_STATIC

# If you want to use CPU affinity

# CCOMMON_OPT += -DUSE_CPU_AFFINITY

# If you want to use memory affinity (NUMA)

# You can't use it with ALLOC_STATIC

# NUMA_AFFINITY = 1

# If you want to drive whole 64bit region by BLAS. Not all Fortran

# compiler supports this. It's safe to keep comment it out if you

# are not sure.

# INTERFACE64 = 1

# If you want to use pure thread server model.

# Default is only OMP_NUM_THREADS - 1 threads are spawned to reduce

# thread overhead. This is not implemented yet.

# CCOMMON_OPT += -DALL_THREADED

# If you have special compiler to run script to determine architecture.

GETARCH_CC =

GETARCH_FLAGS =

#

# End of user configuration

#

ifdef BINARY32

BINARY64 =

endif

MACHINE := $(shell uname -m | sed -e s/i.86/i386/)

OSNAME := $(shell uname -s | sed -e s/\\-.*//)

ifeq ($(MACHINE), i386)

BINARY64 =

NATIVEARCH = YES

endif

ifeq ($(MACHINE), ia64)

BINARY64 = YES

NATIVEARCH = YES

endif

ifeq ($(MACHINE), alpha)

BINARY64 = YES

NATIVEARCH = YES

endif

ifeq ($(OSNAME), AIX)

NATIVEARCH = YES

GETARCH_FLAGS = -maix64

endif

ifeq ($(OSNAME), Darwin)

ifndef BINARY64

NATIVEARCH = YES

endif

endif

# If you need to access over 4GB chunk on 64bit system.

ifdef BINARY64

CCOMMON_OPT += -D__64BIT__

ifdef INTERFACE64

CCOMMON_OPT += -DUSE64BITINT

endif

endif

# If you need modified GEMV/GEMM to find best parameters;

# CCOMMON_OPT += -DPARAMTEST

# CCOMMON_OPT += -DPREFETCHTEST

# Common Optimization Flag; -O2 is enough.

COMMON_OPT += -O2

# Optimization Flag for C compiler

CCOMMON_OPT += -D_GNU_SOURCE

# Optimization Flag for Fortran Compiler. You don't have add it.

FCOMMON_OPT +=

# Profiling flags

COMMON_PROF = -pg

################## End of Main Configuration #####################

# TO suppress recursive includes

INCLUDED = 1

ifndef C_COMPILER

C_COMPILER = GNU

endif

ifndef F_COMPILER

F_COMPILER = G77

endif

ifeq ($(C_COMPILER), GNU)

COMPILER = gcc

CCOMMON_OPT += -Wall # -m128bit-long-double

ifneq ($(OSNAME), CYGWIN_NT)

CCOMMON_OPT += -fPIC

endif

ifndef NATIVEARCH

ifdef BINARY64

CCOMMON_OPT += -m64

GETARCH_FLAGS = -m64

else

CCOMMON_OPT += -m32

GETARCH_FLAGS = -m32

endif

endif

COMMON_PROF += -fno-inline

endif

ifeq ($(C_COMPILER), INTEL)

COMPILER = icc

CCOMMON_OPT += -fPIC

endif

ifeq ($(F_COMPILER), G77)

COMPILER_F77 = g77

BU = _

CCOMMON_OPT += -DF_INTERFACE_F2C -DNEED_F2CCONV

FCOMMON_OPT += -Wall

ifneq ($(OSNAME), CYGWIN_NT)

FCOMMON_OPT += -fPIC

endif

ifndef NATIVEARCH

ifdef BINARY64

FCOMMON_OPT += -m64

else

FCOMMON_OPT += -m32

endif

endif

endif

ifeq ($(F_COMPILER), G95)

COMPILER_F77 = g95

BU = _

CCOMMON_OPT += -DF_INTERFACE_F2C

FCOMMON_OPT += -Wall

ifneq ($(OSNAME), CYGWIN_NT)

FCOMMON_OPT += -fPIC

endif

ifndef NATIVEARCH

ifdef BINARY64

FCOMMON_OPT += -m64

else

FCOMMON_OPT += -m32

endif

endif

endif

ifeq ($(F_COMPILER), GFORTRAN)

COMPILER_F77 = gfortran

BU = _

CCOMMON_OPT += -DF_INTERFACE_GFORT

FCOMMON_OPT += -Wall

EXTRALIB += -lgfortran

ifneq ($(OSNAME), CYGWIN_NT)

FCOMMON_OPT += -fPIC

endif

ifndef NATIVEARCH

ifdef BINARY64

FCOMMON_OPT += -m64

CCOMMON_OPT += -DAMD_ABI

ifdef INTERFACE64

FCOMMON_OPT += -fdefault-integer-8

endif

else

FCOMMON_OPT += -m32

endif

endif

endif

ifeq ($(F_COMPILER), INTEL)

COMPILER_F77 = ifort

BU = _

CCOMMON_OPT += -DF_INTERFACE_F2C

FCOMMON_OPT += -fPIC

ifdef INTERFACE64

FCOMMON_OPT += -i8

endif

# ifeq ($(MACHINE), i386)

# USE_EXTENDED_DOUBLE = YES

# INTELDIR := $(shell dirname `which ifort` | sed -e 's/bin/lib/')

# EXTRALIB += -L$(INTELDIR) -Wl,-rpath,$(INTELDIR) -lirc -limf

# CCOMMON_OPT += -DUSE_EXTENDED_DOUBLE

# endif

endif

ifeq ($(F_COMPILER), IBM)

COMPILER_F77 = xlf

BU =

# FCOMMON_OPT += -qarch=440

ifdef BINARY64

FCOMMON_OPT += -q64

ifdef INTERFACE64

FCOMMON_OPT += -qintsize=8

endif

else

FCOMMON_OPT += -q32

endif

endif

ifeq ($(F_COMPILER), COMPAQ)

ifeq ($(OSNAME), Linux)

COMPILER_F77 = fort

FCOMMON_OPT += -fPIC

else

COMPILER_F77 = f77

endif

BU = _

endif

ifeq ($(F_COMPILER), PGI)

COMPILER_F77 = pgf77

BU = _

CCOMMON_OPT += -DF_INTERFACE_F2C

FCOMMON_OPT += -fPIC

COMMON_PROF += -DPGICOMPILER

ifndef BINARY64

PGCPATH = $(shell which pgcc | sed -e 's/bin\\/pgcc//;s/linux86-64/linux86/')

EXTRALIB += -L$(PGCPATH)lib -Wl,-rpath,$(PGCPATH) -lpgftnrtl -lpgc

else

PGCPATH = $(shell which pgcc | sed -e 's/bin\\/pgcc//')

EXTRALIB += -L$(PGCPATH)lib -Wl,-rpath,$(PGCPATH) -lpgftnrtl -lpgc

ifdef INTERFACE64

FCOMMON_OPT += -i8

endif

endif

# ifeq ($(MACHINE), i386)

# USE_EXTENDED_DOUBLE = YES

# INTELDIR := $(shell dirname `which ifort` | sed -e 's/bin/lib/')

# EXTRALIB += -L$(INTELDIR) -Wl,-rpath,$(INTELDIR) -lirc -limf

# CCOMMON_OPT += -DUSE_EXTENDED_DOUBLE

# endif

endif

ifneq ($(OSNAME), CYGWIN_NT)

ifdef SMP

PTHREADLIB += -lpthread

endif

endif

ifeq ($(F_COMPILER), PATHSCALE)

COMPILER_F77 = pathf90

BU = _

CCOMMON_OPT += -DAMD_ABI -DF_PATHSCALE

FCOMMON_OPT += -fPIC

ifndef BINARY64

CCOMMON_OPT += -DF_INTERFACE_F2C

FCOMMON_OPT += -m32

else

FCOMMON_OPT += -m64

ifdef INTERFACE64

FCOMMON_OPT += -i8

endif

endif

endif

ifeq ($(F_COMPILER), SUN)

COMPILER_F77 = f90

BU = _

CCOMMON_OPT += -DF_SUN

FCOMMON_OPT += -pic

ifndef BINARY64

CCOMMON_OPT += -DF_INTERFACE_F2C

endif

endif

ifeq ($(F_COMPILER), F2C)

COMPILER_F77 = f2cf77

BU = _

CCOMMON_OPT += -DF_INTERFACE_F2C -DNEED_F2CCONV

FCOMMON_OPT += -Wall -fPIC

endif

ifdef SMP

CCOMMON_OPT += -DSMP_SERVER

ifeq ($(OSNAME), Linux)

CCOMMON_OPT += -pthread

endif

endif

ifndef GETARCH_CC

GETARCH_CC = gcc

endif

ARCH := $(shell (cd $(TOPDIR); ./getarch 0 $(GETARCH_CC) $(GETARCH_FLAGS)))

SUBARCH := $(shell (cd $(TOPDIR); ./getarch 1 $(GETARCH_CC) $(GETARCH_FLAGS)))

ARCHSUBDIR := $(shell (cd $(TOPDIR); ./getarch 2 $(GETARCH_CC) $(GETARCH_FLAGS)))

CONFIG := $(shell (cd $(TOPDIR); ./getarch 3 $(GETARCH_CC) $(GETARCH_FLAGS)))

FU := $(shell (cd $(TOPDIR); ./getarch 4 $(GETARCH_CC) $(GETARCH_FLAGS)))

LIBSUBARCH := $(shell (cd $(TOPDIR); ./getarch 5 $(GETARCH_CC) $(GETARCH_FLAGS)))

CORE := $(shell (cd $(TOPDIR); ./getarch 6 $(GETARCH_CC) $(GETARCH_FLAGS)))

ifndef MAX_THREADS

MAX_THREADS $(GETARCH_FLAGS)))

:= $(shell (cd $(TOPDIR); ./getarch 7 $(GETARCH_CC)

endif

CCOMMON_OPT += -DMAX_CPU_NUMBER=$(MAX_THREADS)

LIBPREFIX = libgoto

ARFLAGS =

CPP = $(CC) -E

AR = $(COMPILER_PREFIX)ar

AS = $(COMPILER_PREFIX)as

LD = $(COMPILER_PREFIX)ld

RANLIB = $(COMPILER_PREFIX)ranlib

include $(TOPDIR)/Makefile.$(ARCHSUBDIR)

CCOMMON_OPT += -DASMNAME=$(FU)$(*F) -DNAME=$(*F)$(BU) -DCNAME=$(*F)

ifeq ($(CORE), PPC440)

CCOMMON_OPT += -DALLOC_QALLOC

endif

ifeq ($(CORE), PPC440FP2)

CCOMMON_OPT += -DALLOC_STATIC

endif

ifdef NUMA_AFFINITY

-DASMFNAME=$(FU)$(*F)$(BU)

CCOMMON_OPT += -DUSE_MEMORY_AFFINITY

MISCLIB += -lnuma

EXTRALIB += -lnuma

endif

ifeq ($(FU), _)

CCOMMON_OPT += -DFUNDERSCORE=$(FU) -DNEEDFUNDERSCORE

endif

ifeq ($(BU), _)

CCOMMON_OPT += -DBUNDERSCORE=$(BU) -DNEEDBUNDERSCORE

endif

CFLAGS = $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR) $(CONFIG)

PFLAGS = $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR) $(CONFIG) -DPROFILE $(COMMON_PROF)

FFLAGS += $(COMMON_OPT) $(FCOMMON_OPT)

FPFLAGS = $(COMMON_OPT) $(FCOMMON_OPT) $(COMMON_PROF)

ifndef SMP

LIBNAME = $(LIBPREFIX)_$(LIBSUBARCH)$(REVISION).a

LIBNAME_P = $(LIBPREFIX)_$(LIBSUBARCH)$(REVISION)_p.a

else

LIBNAME = $(LIBPREFIX)_$(LIBSUBARCH)p$(REVISION).a

LIBNAME_P = $(LIBPREFIX)_$(LIBSUBARCH)p$(REVISION)_p.a

endif

LIBSONAME = $(LIBNAME:.a=.so)

LIBDLLNAME = $(LIBNAME:.a=.dll)

LIBDYNNAME = $(LIBNAME:.a=.dylib)

LIBWIN2KNAME = $(LIBNAME:.a=.lib)

LIBDEFNAME = $(LIBNAME:.a=.def)

LIBEXPNAME = $(LIBNAME:.a=.exp)

LIBZIPNAME = $(LIBNAME:.a=.zip)

LIBS = $(TOPDIR)/$(LIBNAME)

LIBS_P = $(TOPDIR)/$(LIBNAME_P)

CC = $(COMPILER_PREFIX)$(COMPILER)

FC = $(COMPILER_PREFIX)$(COMPILER_F77)

.SUFFIXES: .po .o .f

.f.o:

$(FC) $(FFLAGS) -c $<

.f.po:

$(FC) $(FPFLAGS) -pg -c $<

ACMLPATH = /opt/acml3.5.0

MKLPATH = /opt/intel/mkl/9.0/lib

# MKLPATH = $(HOME)/misc/mkl/9.0/lib

ATLASPATH = /opt/atlas/3.7.8

FLAMEPATH = $(HOME)/flame/lib

4、./quickbuild.32bit 生成libgoto_katmaip-r1.09.so文件

5、cp libgoto_katmaip-r1.09.so /usr/local/lib

6、安装fftw 解压fftw-3.1.2.tar

7、./configure --prefix=/usr/local/fftw

8、make

9、make install

5 安装VASP

1、)解压vasp.5.2和vasp.5.lib:

tar xzvf vasp.5.2.tar.gz

tar xzvf vasp.5.lib.tar.gz

2、进入vasp.5.lib

cp makefile.linux_pg makefile

make

若安装过程中出现libdmy.a is up to date则输入:

rm *.o

然后每次出现询问是否删除×××.o的文件时依次输入y按回车键

最后make

3、进入vasp.5.2目录下,在终端输入:

cp makefile.linux_pg makefile

vi makefile修改

4、修改makefile,把/usr/local/fftw/include/下的fftw3.f文件拷贝到vasp目录下,终端make

Vasp拷贝到usr/bin

因篇幅问题不能全部显示,请点此查看更多更全内容