24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 1001  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 296求调剂 +3 汪!?! 2026-04-05 4/200 2026-04-05 20:13 by 啵啵啵0119
[考研] 生物与医药调剂 +4 十七sa 2026-04-05 4/200 2026-04-05 20:05 by lys0704
[考研] 304求调剂 +3 luoye0105 2026-04-05 3/150 2026-04-05 18:16 by 土木硕士招生
[考研] 080200学硕,机械工程专业277分,求带走! +7 瓶子PZ 2026-03-31 7/350 2026-04-05 17:49 by liucky
[考研] 288求调剂 一志愿哈工大 材料与化工 +13 洛神哥哥 2026-04-03 13/650 2026-04-05 17:27 by zzx2138
[考研] 271分求调剂学校 +12 zph158488! 2026-04-02 13/650 2026-04-05 10:13 by lqwchd
[考研] 男生,一志愿沪9生物学071000,初试308求调剂 +3 刘墨墨 2026-04-04 3/150 2026-04-05 08:26 by barlinike
[考研] 325求调剂 +4 春风不借意 2026-04-04 4/200 2026-04-04 22:08 by 啵啵啵0119
[考研] 085600调剂 +4 1amJJ 2026-04-02 4/200 2026-04-04 21:53 by hemengdong
[考研] 化工求调剂 +11 荔香芝士椰奶 2026-04-03 11/550 2026-04-03 22:06 by 啵啵啵0119
[考研] 338求调剂 +7 晟功? 2026-04-03 7/350 2026-04-03 16:46 by wxiongid
[考研] 英一数一408,总分284,二战真诚求调剂 +13 12.27 2026-03-30 15/750 2026-04-03 14:41 by 氮气气气
[考研] 316求调剂 +14 舟自梗 2026-04-01 18/900 2026-04-03 10:28 by linyelide
[考研] 325分化学调剂 +5 15771691647 2026-04-02 5/250 2026-04-03 09:58 by ChemPharm
[考研] 调剂 +7 祉岷. 2026-04-02 7/350 2026-04-03 09:11 by 花呗还欠600
[考研] 272求调剂,接受跨专业调剂! +4 闲鱼卢 2026-03-31 4/200 2026-04-02 11:18 by guyan1000
[考研] 材料专硕322分 +11 哈哈哈吼吼吼哈 2026-04-01 11/550 2026-04-02 10:52 by lnilvy
[考研] 349求调剂 +6 吃的不少 2026-04-01 6/300 2026-04-01 17:55 by JYD2011
[考研] 本2一志愿C9-333分,材料科学与工程,求调剂 +9 升升不降 2026-03-31 9/450 2026-03-31 18:01 by 无际的草原
[考研] 抱歉 +3 田洪有 2026-03-30 3/150 2026-03-30 19:11 by 迷糊CCPs
信息提示
请填处理意见