计算化学公社

 找回密码 Forget password
 注册 Register
Views: 12029|回复 Reply: 2
打印 Print 上一主题 Last thread 下一主题 Next thread

[VASP] vasp 编译好难啊

[复制链接 Copy URL]

21

帖子

0

威望

108

eV
积分
129

Level 2 能力者

跳转到指定楼层 Go to specific reply
楼主
makefile 改来改去 vasp 编译就是没通过。


恳请大神指教啊。

以下是出错信息  以及 makefile 内容
-------------------------------------------------
[wl_903@hpc-login3 vasp.5.3]$ make
./preprocess <xml.F | /usr/bin/cpp -P -C -traditional >xml.f90 -DMPI  -DHOST=\"LinuxIFC\" -DIFC -DCACHE_SIZE=4000 -DPGF90 -Davoidalloc -DNGZhalf -DMPI_BLOCK=8000 -Duse_collective -DRPROMU_DGEMV  -DRACCMU_DGEMV
mpif90 -I//usr/usc/intel/15.0.2/mkl/include /usr/usc/intel/15.0.2/mkl/include/fftw -FR  -O3  -c xml.f90
xml.f90:923.132:

"," name=",1H",A,1H",">",A,"</i>")',ADVANCE="Yes")  blank(1:inden),tag,str(
                                                                           1                                                         
Error: Syntax error in argument list at (1)
xml.f90:923.132:

"," name=",1H",A,1H",">",A,"</i>")',ADVANCE="Yes")  blank(1:inden),tag,str(
                                                                           1                                                         
Warning: Line truncated at (1)
xml.f90:976.132:

"," name=",1H",A,1H",">",A,"</v>")',ADVANCE="Yes")  blank(1:inden),tag,str(
                                                                           1                                                         
Error: Syntax error in argument list at (1)
xml.f90:976.132:

"," name=",1H",A,1H",">",A,"</v>")',ADVANCE="Yes")  blank(1:inden),tag,str(
                                                                           1                                                         
Warning: Line truncated at (1)
make: *** [xml.o] Error 1
--------------------------------------------------------------------------


makefile

# all CPP processed fortran files have the extension .f90
SUFFIX=.f90

#-----------------------------------------------------------------------
# fortran compiler and linker
#-----------------------------------------------------------------------
FC=ifort
# fortran linker
FCL=$(FC)


#-----------------------------------------------------------------------
# whereis CPP ?? (I need CPP, can't use gcc with proper options)
# that's the location of gcc for SUSE 5.3
#
#  CPP_   =  /usr/lib/gcc-lib/i486-linux/2.7.2/cpp -P -C
#
# that's probably the right line for some Red Hat distribution:
#
#  CPP_   =  /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/cpp -P -C
#
#  SUSE X.X, maybe some Red Hat distributions:

CPP_ =  ./preprocess <$*.F | /usr/bin/cpp -P -C -traditional >$*$(SUFFIX)

# this release should be fpp clean
# we now recommend fpp as preprocessor
# if this fails go back to cpp
#CPP_=fpp -f_com=no -free -w0 $*.F $*$(SUFFIX)

#-----------------------------------------------------------------------
# possible options for CPP:
# NGXhalf             charge density   reduced in X direction
# wNGXhalf            gamma point only reduced in X direction
# avoidalloc          avoid ALLOCATE if possible
# PGF90               work around some for some PGF90 / IFC bugs
# CACHE_SIZE          1000 for PII,PIII, 5000 for Athlon, 8000-12000 P4, PD
# RPROMU_DGEMV        use DGEMV instead of DGEMM in RPRO (depends on used BLAS)
# RACCMU_DGEMV        use DGEMV instead of DGEMM in RACC (depends on used BLAS)
# tbdyn                 MD package of Tomas  Bucko
#-----------------------------------------------------------------------

CPP     = $(CPP_)  -DHOST=\"LinuxIFC\" \
          -DCACHE_SIZE=12000 -DPGF90 -Davoidalloc -DNGXhalf \
#          -DRPROMU_DGEMV  -DRACCMU_DGEMV

#-----------------------------------------------------------------------
# general fortran flags  (there must a trailing blank on this line)
# byterecl is strictly required for ifc, since otherwise
# the WAVECAR file becomes huge
#-----------------------------------------------------------------------

FFLAGS =  -I//usr/usc/intel/15.0.2/mkl/include /usr/usc/intel/15.0.2/mkl/include/fftw -FR #-lowercase -assume byterecl
#FFLAGS = -I/usr/usc/intel/2013.1.039/mkl/include/fftw -FR
#-----------------------------------------------------------------------
# optimization
# we have tested whether higher optimisation improves performance
# -axK  SSE1 optimization,  but also generate code executable on all mach.
#       xK improves performance somewhat on XP, and a is required in order
#       to run the code on older Athlons as well
# -xW   SSE2 optimization
# -axW  SSE2 optimization,  but also generate code executable on all mach.
# -tpp6 P3 optimization
# -tpp7 P4 optimization
#-----------------------------------------------------------------------

# ifc.9.1, ifc.10.1 recommended
OFLAG=-O3

OFLAG_HIGH = $(OFLAG)
OBJ_HIGH =
OBJ_NOOPT =
DEBUG  = -FR -O0
INLINE = $(OFLAG)

#-----------------------------------------------------------------------
# the following lines specify the position of BLAS  and LAPACK
# VASP works fastest with the libgoto library
# so that's what we recommend
#-----------------------------------------------------------------------
#IFC_LIB_PATH=/usr/usc/intel/15.0.2/composer_xe_2015.2.164/compiler/lib/intel64/
#MKL_PATH=/usr/usc/intel/15.0.2/composer_xe_2015.2.164/mkl/lib/intel64/
# mkl.10.0
# set -DRPROMU_DGEMV  -DRACCMU_DGEMV in the CPP lines
#BLAS=-L/opt/intel/mkl100/lib/em64t -lmkl -lpthread
#BLAS= -Wl,--start-group $(MKL_PATH)/libmkl_intel_lp64.a $(MKL_PATH)/libmkl_sequential.a $(MKL_PATH)/libmkl_core.a $(MKL_PATH)/libmkl_lapack95_lp64.a $(IFC_LIB_PATH)/libiomp5.a   $(IFC_LIB_PATH)/libimf.a  -Wl,--end-group  -lpthread  -lm

# even faster for VASP Kazushige Goto's BLAS
# http://www.cs.utexas.edu/users/kgoto/signup_first.html
# parallel goto version requires sometimes -libverbs
#BLAS=  /opt/libs/libgoto/libgoto.so

# LAPACK, simplest use vasp.5.lib/lapack_double
LAPACK= ../vasp.5.lib/lapack_double.o

# use the mkl Intel lapack
#LAPACK= -lmkl_lapack

#-----------------------------------------------------------------------

LIB  = -L../vasp.5.lib -ldmy \
     ../vasp.5.lib/linpack_double.o $(LAPACK) \
     $(BLAS)

# options for linking, nothing is required (usually)
LINK    =

#-----------------------------------------------------------------------
# fft libraries:
# VASP.5.2 can use fftw.3.1.X (http://www.fftw.org)
# since this version is faster on P4 machines, we recommend to use it
#-----------------------------------------------------------------------
#FFT3D   = fft3dfurth.o fft3dlib.o

# alternatively: fftw.3.1.X is slighly faster and should be used if available
FFT3D   = fftw3d.o fft3dlib.o   /opt/libs/fftw-3.1.2/lib/libfftw3.a


#=======================================================================
# MPI section, uncomment the following lines until
#    general  rules and compile lines
# presently we recommend OPENMPI, since it seems to offer better
# performance than lam or mpich
#
# !!! Please do not send me any queries on how to install MPI, I will
# certainly not answer them !!!!
#=======================================================================
#-----------------------------------------------------------------------
# fortran linker for mpi
#-----------------------------------------------------------------------

FC=mpif90
FCL=$(FC)

#-----------------------------------------------------------------------
# additional options for CPP in parallel version (see also above):
# NGZhalf               charge density   reduced in Z direction
# wNGZhalf              gamma point only reduced in Z direction
# scaLAPACK             use scaLAPACK (usually slower on 100 Mbit Net)
# avoidalloc          avoid ALLOCATE if possible
# PGF90               work around some for some PGF90 / IFC bugs
# CACHE_SIZE          1000 for PII,PIII, 5000 for Athlon, 8000-12000 P4, PD
# RPROMU_DGEMV        use DGEMV instead of DGEMM in RPRO (depends on used BLAS)
# RACCMU_DGEMV        use DGEMV instead of DGEMM in RACC (depends on used BLAS)
# tbdyn                 MD package of Tomas  Bucko
#-----------------------------------------------------------------------

#-----------------------------------------------------------------------

CPP    = $(CPP_) -DMPI  -DHOST=\"LinuxIFC\" -DIFC \
     -DCACHE_SIZE=4000 -DPGF90 -Davoidalloc -DNGZhalf \
     -DMPI_BLOCK=8000 -Duse_collective \
    -DRPROMU_DGEMV  -DRACCMU_DGEMV
#CPP    = $(CPP_) -DMPI  -DHOST=\"LinuxIFC\" -DIFC \
    -DCACHE_SIZE=5000 -DPGF90 -Davoidalloc -DNGZhalf \
    -DMPI_BLOCK=262144 -Duse_collective -DscaLAPACK  \
    -DRPROMU_DGEMV  -DRACCMU_DGEMV
#-----------------------------------------------------------------------
# location of SCALAPACK
# if you do not use SCALAPACK simply leave that section commented out
#-----------------------------------------------------------------------
BLAS= -L/usr/usc/intel/15.0.2/mkl/lib/ia32 -lmkl_intel -lmkl_blacs_openmpi -liomp5 -lpthread -lmkl_sequential -lmkl_core -lpthread

#BLACS=$(HOME)/archives/SCALAPACK/BLACS/
#SCA_=$(HOME)/archives/SCALAPACK/SCALAPACK

#SCA= $(SCA_)/libscalapack.a  \
# $(BLACS)/LIB/blacsF77init_MPI-LINUX-0.a $(BLACS)/LIB/blacs_MPI-LINUX-0.a $(BLACS)/LIB/blacsF77init_MPI-LINUX-0.a

SCA=

#-----------------------------------------------------------------------
# libraries for mpi
#-----------------------------------------------------------------------

LIB     = -L../vasp.5.lib -ldmy  \
      ../vasp.5.lib/linpack_double.o $(LAPACK) \
      $(SCA) $(BLAS)

# FFT: fftmpi.o with fft3dlib of Juergen Furthmueller
#FFT3D   = fftmpi.o fftmpi_map.o fft3dfurth.o fft3dlib.o

# alternatively: fftw.3.1.X is slighly faster and should be used if available
FFT3D   = fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o  /opt/libs/fftw-3.1.2/lib/libfftw3.a


207

帖子

0

威望

2324

eV
积分
2531

Level 5 (御坂)

2#
发表于 Post on 2015-9-17 11:22:01 | 只看该作者 Only view this author
编译就没法了,只能看自己。

174

帖子

0

威望

5199

eV
积分
5373

Level 6 (一方通行)

3#
发表于 Post on 2015-9-17 19:10:14 | 只看该作者 Only view this author
本帖最后由 bluewhale 于 2015-9-17 19:14 编辑

对于VASP 5.3.5 and Intel® Compilers 15.0, Intel® MKL 11.2 and Intel® MPI 5.0.3:

1) 设好编译环境:
$source /opt/intel/parallel_studio_xe_2015/bin/psxevars.sh intel64

2) Build libdmy.a
Change directory to vasp.x.x.lib
Modify the makefile.linux_ifc_P4 Makefile to point to the correct Intel FORTRAN compiler.
        FC=ifort
Run the following command from vasp.x.x.lib, using the Makefile for linux using the Intel compiler.
        $make –f makefile.linux_ifc_P4

3) Build VASP
Change directory to vasp.x.x
Edit the makefile.linux_ifc_P4 to link with Intel® MKL libraries and change the Fotran compiler
Under FORTRAN and C++ compiler and linker part of the makefile
        FC= mpiifort
        CPP = $(CPP_) -DMPI  -DHOST=\"LinuxIFC\" -DIFC \
             -DCACHE_SIZE=32000 -DPGF90 -Davoidalloc -DNGZhalf \
             -DMPI_BLOCK=64000 -Duse_collective -DscaLAPACK  –DMKL_ILP64
Change the FORTRAN flags section as shown here.
        FFLAGS = -FR -names lowercase -assume byterecl -I$(MKLROOT)/include/fftw
        ........
        ...
        OFLAG=-O3 -xCORE-AVX2
        .......
The -xCORE-AVX2 is for enabling vectorization for a Haswell Architecture.  Please refer the Intel Compiler reference manual for architecture specific compiler flags, or you may use -xhost to enable the highest available SIMD instruction if you are building and running the VASP on the same platform.
Point to use Intel MKL libraries by modifying the MKL section as shown below:  -mkl=cluster is an Intel compiler flag that to include Intel MKL libraries, that will link with Intel MKL BLAS, LAPACK, FFT, ScaLAPACK functions that are used in VASP.
        MKLROOT=/opt/intel/composer_xe_2015/mkl
        MKL_PATH=$(MKLROOT)/lib/intel64
        ....
        .....
         
        BLAS= -mkl=cluster
         
        LAPACK=
        ......
        .....
Comment out the existing FFT3D line, FFTW wrappers are integrated with the Intel MKL 10.2 onwards, and you do not need to specify the wrapper libs in the FFT3D line, and will be taken care of by -mkl=cluster flag mentioned above.
        #FFT3D = fftdfurth.o fftdlib.o
        FFT3D= fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o
        INCS = -I$(MKLROOT)/include/fftw
Since the -mkl=cluster, includes MKL ScaLAPACK libraries also, it is not required to mentioned the ScaLAPACK libs.  Leave it as it is.
        SCA=
Run the following command to build VASP.
        $ make –f makefile.linux_ifc_P4
This will create the VASP executable in the current directory.

对于5.4,则编译过程更为简单,VASP已经为你准备好三个makefile, 对于安装了intel Parastudio 2015的系统,基本不用修改就可编译出三个版本:
vasp_gam, vasp_std, vasp_ncl.

评分 Rate

参与人数
Participants 1
eV +3 收起 理由
Reason
sobereva + 3

查看全部评分 View all ratings

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2025-8-14 21:53 , Processed in 0.192575 second(s), 21 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list