用gfortran安装fortran包

时间:2013-04-05 06:26:08

标签: fortran gfortran intel-fortran

我想在两台不同的机器上安装此软件包。 http://www.2decomp.org/download.html

在我的Mac笔记本电脑上,当我使用Makefile.inc.x86作为我的Makefile.inc并做一个make时,它可以直接使用而没有任何问题。但是当我使用相同的Makefile.inc文件时,在另一台机器上,我收到以下错误:

[k00603@fe01p05 src]$make
mpif90 -DDOUBLE_PREC -O3 -fcray-pointer -cpp  -c decomp_2d.f90
gfortran: unrecognized option '-cpp'
Warning: decomp_2d.f90:20: Illegal preprocessor directive
Warning: decomp_2d.f90:21: Illegal preprocessor directive
Warning: decomp_2d.f90:22: Illegal preprocessor directive
Warning: decomp_2d.f90:23: Illegal preprocessor directive
-------------------------------------------------------
--- around 50 more lines with the same warning --------
-------------------------------------------------------
In file decomp_2d.f90:32

integer, parameter, public :: ga_real_type = MT_F_DBL
                                                  1
Error: Symbol 'mt_f_dbl' at (1) has no IMPLICIT type
In file decomp_2d.f90:33

integer, parameter, public :: ga_complex_type = MT_F_DCPL
                                                      1
Error: Symbol 'mt_f_dcpl' at (1) has no IMPLICIT type
In file decomp_2d.f90:36
-------------------------------------------------------
------------ a lot of other errors --------------------
-------------------------------------------------------

它们都是Linux x86_64机器。任何想法我可以做什么来安装在另一台机器上?

2 个答案:

答案 0 :(得分:0)

你的gfortran可能太老了。 2008中添加了-cpp选项。获取一个新的,或尝试-x f95-cpp-input-x f77-cpp-input istead。

答案 1 :(得分:0)

为了保证预处理,您可以将decomp_2d.f90重命名为decomp_2d.F90。我知道-cpp应该已经保证了它,但它可能值得一试,因为我们不一定知道底层编译器是什么。