24小时热门版块排行榜    

查看: 1132  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 关于豆爷回答的JTJC与%2F数量 +5 yang182083 2026-08-06 7/350 2026-08-08 18:29 by zhanghaozhu
[基金申请] 国基金的申报应该改成非等额制,评价高的钱多评价低的钱少,但是增加资助率 +7 a089 2026-08-07 7/350 2026-08-08 18:05 by gltch
[考研] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +3 qTvzQBRAHjCi 2026-08-07 5/250 2026-08-08 16:47 by oEVWOejN9taj
[基金申请] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +3 Vi50GxzrFcSG 2026-08-07 5/250 2026-08-08 16:27 by oEVWOejN9taj
[基金申请] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 Vi50GxzrFcSG 2026-08-07 4/200 2026-08-08 16:19 by oEVWOejN9taj
[博后之家] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +3 Vi50GxzrFcSG 2026-08-07 4/200 2026-08-08 16:02 by oEVWOejN9taj
[基金申请] fileCode有新解读? +9 Tide man 2026-08-08 17/850 2026-08-08 14:56 by archvillain
[基金申请] 这样的filecode谁见过 +5 布布和一二 2026-08-08 8/400 2026-08-08 14:54 by archvillain
[硕博家园] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +4 HEQlVqMTIA7d 2026-08-07 6/300 2026-08-08 14:47 by oEVWOejN9taj
[基金申请] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 HEQlVqMTIA7d 2026-08-07 4/200 2026-08-08 14:27 by oEVWOejN9taj
[论文投稿] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 HEQlVqMTIA7d 2026-08-07 5/250 2026-08-08 14:22 by oEVWOejN9taj
[基金申请] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +4 KXLV3nuBVBY7 2026-08-07 5/250 2026-08-08 14:07 by oEVWOejN9taj
[论文投稿] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +3 KXLV3nuBVBY7 2026-08-07 6/300 2026-08-08 14:01 by oEVWOejN9taj
[基金申请] 关于代码变化问题,想知道的进来 +11 且听虎啸 2026-08-07 14/700 2026-08-08 12:50 by 布布和一二
[基金申请] 娱乐 +6 Tide man 2026-08-03 6/300 2026-08-07 22:40 by 铁帽子农民
[基金申请] 化学口download_prp&amp;fileCode的固定段好像这几天一直没变,有变的大神么? +3 Tide man 2026-08-07 4/200 2026-08-07 22:39 by Tide man
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
[基金申请] 有没有H口的?有收到消息的吗? +3 超级海虾 2026-08-04 3/150 2026-08-04 17:26 by 学教育滴
[基金申请] 纯娱乐,不喜欢勿喷 +7 Tide man 2026-08-04 10/500 2026-08-04 15:10 by loufangrui
[基金申请] 面上提前没消息,有中的吗 +14 archvillain 2026-08-02 18/900 2026-08-04 14:42 by archvillain
信息提示
请填处理意见