24小时热门版块排行榜    

查看: 958  |  回复: 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 的主题更新
信息提示
请填处理意见