24小时热门版块排行榜    

查看: 1162  |  回复: 2

ymquan

新虫 (正式写手)

[求助] vasp.5.2.11编译出错,跪求解决办法

我的系统是linux UBUNTU14.04  已经安装了Intel ifort 编译器 2013版本 和 fftw. 最后编译Vasp5.2.11时预处理总是出错. 提示的错误是:



./preprocess <base.F | /usr/bin/cpp -P -C -traditional >base.f90  -DHOST=\"LinuxIFC\" -DCACHE_SIZE=12000 -DPGF90 -Davoidalloc -DNGXhalf
/opt/intel/composer_xe_2013.2.146/bin/ia32/ifort -FR -lowercase -assume byterecl  -O2 -ip -ftz   -c base.f90
ifort: command line remark #10010: option '-lowercase' is deprecated and will be removed in a future release. See '-help deprecated'
base.f90(1): error #5082: Syntax error, found '/' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM MODULE TYPE INTEGER REAL ...
/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
^
base.f90(16): error #5145: Invalid blank/tab
   <http://www.gnu.org/licenses/>.  */
----------------------------------^
base.f90(20): error #5145: Invalid blank/tab
   include it implicitly at the start of every compilation.  It must
-----------------------------------------------------------^
base.f90(27): error #5120: Unterminated character constant
/* glibc's intent is to support the IEC 559 math functionality, real

...........................


base.f90(39): error #5145: Invalid blank/tab
/* We do not support C11 <threads.h>.  */
-------------------------------------^
base.f90(1): catastrophic error: Could not recover from previous syntax error
compilation aborted for base.f90 (code 1)
make: *** [base.o] 错误 1






经过查找发现把makefile文件删简到如下简单情况:




.SUFFIXES: .inc .f .f90 .F

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

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




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



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



#-----------------------------------------------------------------------
# general rules and compile lines
#-----------------------------------------------------------------------



SOURCE=  base.o     mpi.o      smart_allocate.o      xml.o  \





vasp: $(SOURCE) $(FFT3D) $(INC) main.o
        rm -f vasp
        $(FCL) -o vasp main.o  $(SOURCE)   $(FFT3D) $(LIB) $(LINK)









clean:       
        -rm -f *.g *.f *.o *.L *.mod ; touch *.F





#
# MIND: I do not have a full dependency list for the include
# and MODULES: here are only the minimal basic dependencies
# if one strucuture is changed then touch_dep must be called
# with the corresponding name of the structure
#
base.o: base.inc base.F







.F.o:
        $(CPP)
        $(FC) $(FFLAGS) $(OFLAG) $(INCS) -c $*$(SUFFIX)





make时还是出现同样的错误.
仔细查看发现是程序写的base.f90文件前面有很多说明文档,但是只是按C++格式标注,所以Fortran 无法识别,base.f90文件前面文档内容如下:

/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   <http://www.gnu.org/licenses/>.  */


/* This header is separate from features.h so that the compiler can
   include it implicitly at the start of every compilation.  It must
   not itself include <features.h> or any other header that includes
   <features.h> because the implicit include comes before any feature
   test macros that may be defined in a source file before it first
   explicitly includes a system header.  GCC knows the name of this
   header in order to preinclude it.  */

/* glibc's intent is to support the IEC 559 math functionality, real
   and complex.  If the GCC (4.9 and later) predefined macros
   specifying compiler intent are available, use them to determine
   whether the overall intent is to support these features; otherwise,
   presume an older compiler has intent to support these features and
   define these macros by default.  */



/* wchar_t uses ISO/IEC 10646 (2nd ed., published 2011-03-15) /
   Unicode 6.0.  */

/* We do not support C11 <threads.h>.  */



小木虫上似乎也有人遇到同样的问题,但是没有看到具体的解决说明,在这里跪求高人指点.
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

ymquan

新虫 (正式写手)

问题解决了,原来是安装了高版本的CPP, 换为4.6版本的CPP就可以了。
2楼2014-10-15 19:50:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nx_2003

新虫 (初入文坛)

楼主,你好,我也遇到了相同的问题。请问怎么换成低版本的CPP?
3楼2017-03-22 10:30:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 ymquan 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[教师之家] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +5 ASdOkHsho7FD 2026-08-28 8/400 2026-08-30 05:48 by ZPa0EcMwuECS
[硕博家园] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 G6APbkg8SA6w 2026-08-29 3/150 2026-08-30 02:18 by ZPa0EcMwuECS
[博后之家] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +5 gy1nBQXYQJqL 2026-08-29 6/300 2026-08-30 01:47 by ZPa0EcMwuECS
[公派出国] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +4 gy1nBQXYQJqL 2026-08-29 7/350 2026-08-30 01:36 by ZPa0EcMwuECS
[考博] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 gy1nBQXYQJqL 2026-08-29 4/200 2026-08-30 01:34 by ZPa0EcMwuECS
[公派出国] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +5 ASdOkHsho7FD 2026-08-28 7/350 2026-08-30 01:12 by ZPa0EcMwuECS
[考研] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +5 ASdOkHsho7FD 2026-08-28 7/350 2026-08-30 01:03 by ZPa0EcMwuECS
[论文投稿] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +4 ASdOkHsho7FD 2026-08-28 5/250 2026-08-30 01:03 by ZPa0EcMwuECS
[基金申请] 中青基了要发朋友圈吗? +4 349506619 2026-08-28 4/200 2026-08-29 22:41 by alongwaytogo
[基金申请] 面上意见出来了 +8 黄鸟于飞Chao 2026-08-29 16/800 2026-08-29 20:45 by 黄鸟于飞Chao
[基金申请] 有没有仍没收到信息的 +5 德尚中行 2026-08-27 6/300 2026-08-29 18:10 by manplx
[基金申请] 我就是申请一个面上项目而已,这评审意见是按照杰青的条件评的吧? +6 gouxfjh 2026-08-28 9/450 2026-08-29 09:59 by jklily
[基金申请] 怎么查啊 +6 huang1991js 2026-08-26 6/300 2026-08-28 08:42 by winsaint
[基金申请] 申请删除本帖 +6 lyz123lyz 2026-08-27 7/350 2026-08-27 17:31 by 宁静致远sy
[基金申请] 为什么 国际(地区)合作与交流项目 没有放榜? 10+3 majunge000 2026-08-26 11/550 2026-08-27 08:42 by 北京莱茵编辑
[基金申请] 我不理解! +15 Edward_pc 2026-08-26 23/1150 2026-08-26 20:34 by zzuzxg
[基金申请] 2026年8月25日国自然放榜前突然收到列入评审专家邮件,有关系吗? +25 木水思豆 2026-08-25 28/1400 2026-08-26 14:53 by draco1987
[基金申请] 系统进不去 +4 yanglien 2026-08-26 5/250 2026-08-26 11:10 by wenfengw83
[基金申请] 国合可查了 +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
[基金申请] 某些机构,以效率低为荣,以效率低作为存在感 +9 yuleib84 2026-08-25 10/500 2026-08-25 17:14 by alexon
信息提示
请填处理意见