24小时热门版块排行榜    

CyRhmU.jpeg
查看: 2592  |  回复: 11
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

gleerat

木虫 (正式写手)

[求助] 使用ifort+MKL编译VASP,出错信息却是gfortran

CODE:
mts@unity-ubuntu:~/vasp.5.2$ make -f makefile.linux_ifc_P4
./preprocess base.f90  -DHOST=\"LinuxIFC\" -Dkind8 -DCACHE_SIZE=12000 -DPGF90 -Davoidalloc -DNGXhalf -DRPROMU_DGEMV  -DRACCMU_DGEMV
mpif90 -I/opt/intel/mkl/include/fftw -FR -lowercase -assume byterecl -O3  -c base.f90
gfortran: error: byterecl: No such file or directory
gfortran: error: unrecognized option '-assume'
make: *** [base.o] Error 1
mts@unity-ubuntu:~/vasp.5.2$ which ifort
/opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort

我在makefile中指定了编译器为ifort和mpif90,编译提示出错信息为gfortran。
这是makefile,省去了一些注释,只有修改的部分使用黑体标识。
引用回帖:
.SUFFIXES: .inc .f .f90 .F
# all CPP processed fortran files have the extension .f90
SUFFIX=.f90
#-----------------------------------------------------------------------
# fortran compiler and linker
#-----------------------------------------------------------------------
FC=ifort
#修改fortran编译器为ifort
# fortran linker
FCL=$(FC)

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

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

#取消对CPP的注释

#-----------------------------------------------------------------------
# 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/opt/intel/mkl/include/fftw -FR -lowercase -assume byterecl
#指定fftw

# 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
#-----------------------------------------------------------------------

# mkl.10.0
# set -DRPROMU_DGEMV  -DRACCMU_DGEMV in the CPP lines
BLAS=-L/opt/intel/mkl/lib/intel64 -lmkl_em64t -lmkl_intel_thread -lguide -lmkl_intel_lp64 -lmkl_blacs_lp64 -lmkl_core -liomp5 -lpthread

# use the mkl Intel lapack
LAPACK= -L/opt/intel/mkl/lib/intel64 -lmkl_em64t -lmkl_intel_thread -lguide -lmkl_intel_lp64 -lmkl_blacs_lp64 -lmkl_core -liomp5 -lpthread
#修改数学库
#-----------------------------------------------------------------------

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

#注释掉vasp的库,以及下面紧接着的FFT3D,在MPI部分重新指定FFT3D

# 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
#=======================================================================
#-----------------------------------------------------------------------
# fortran linker for mpi
#-----------------------------------------------------------------------

FC=mpif90
#指定编译器为mpif90
FCL=$(FC)

#CPP    = $(CPP_) -DMPI  -DHOST=\"LinuxIFC\" -DIFC \
#     -Dkind8 -DCACHE_SIZE=4000 -DPGF90 -Davoidalloc -DNGZhalf \
#     -DMPI_BLOCK=8000
##    -DRPROMU_DGEMV  -DRACCMU_DGEMV
#注释CPP,使用前面的CPP

#-----------------------------------------------------------------------
# location of SCALAPACK
# if you do not use SCALAPACK simply leave that section commented out
#-----------------------------------------------------------------------
SCA= /opt/intel/mkl/lib/intel64/libmkl_scalapack_lp64.a /opt/intel/mkl/lib/intel64/libmkl_blacs_openmpi_lp64.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/intel/mkl/lib/intel64/libfftw3xf_intel.a
#使用指定的fftw3xf

回复此楼
明察、慎思、笃行
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

aylixmut

铜虫 (小有名气)


fzx2008: 金币+1, 谢谢回帖! 2012-07-25 11:41:23
我曾经编译也遇到跟您一样的问题,就是因为mpif90没找到,后来设置一下即可。如果这个没问题,那接下来应该就考虑库的问题,是否存在,有无问题。
6楼2012-07-24 21:13:10
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 12 个回答

aylixmut

铜虫 (小有名气)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
fzx2008: 金币+1, 谢谢回帖! 2012-07-25 11:40:47
gleerat: 金币+10, ★★★很有帮助 2012-07-25 14:19:23
gleerat: 金币+10, ★★★很有帮助 2012-07-25 14:20:30
是mpif90命令没找到。
在命令行打入:mpif90 看看是什么提示。
2楼2012-07-24 15:45:23
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

gleerat

木虫 (正式写手)

引用回帖:
2楼: Originally posted by aylixmut at 2012-07-24 15:45:23
是mpif90命令没找到。
在命令行打入:mpif90 看看是什么提示。

CODE:
mts@unity-ubuntu:~$ which mpif90
/usr/bin/mpif90
mts@unity-ubuntu:~$

明察、慎思、笃行
3楼2012-07-24 16:23:54
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

souledge

专家顾问 (著名写手)

★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
fzx2008: 金币+3, 专家考核, 谢谢指教! 2012-07-24 17:28:35
fzx2008: 金币+20, 代发金币 2012-07-25 16:57:36
引用回帖:
3楼: Originally posted by gleerat at 2012-07-24 16:23:54
mts@unity-ubuntu:~$ which mpif90
/usr/bin/mpif90
mts@unity-ubuntu:~$
...

你的MPI不是用ifort编译的,而是用gfortran编译的。用
CODE:
mpif90 --version

就可以看到了。
建议下载MPI重新编译,编译时加上FC=ifort一句~
思想重于技巧,内涵重于表象
4楼2012-07-24 16:28:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
信息提示
请填处理意见