使用gfortran安装fortran包



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

在我的Mac笔记本电脑上,当我使用Makefile.inc.时。x86作为我的Makefile。公司,并做一个制作,它工作直接没有任何问题。但是在另一台机器上,当我使用相同的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机器。我能做些什么把它安装到另一台机器上吗?

您的gfortran可能太旧了。2008年增加了-cpp选项。换一个新的,或者试试-x f95-cpp-input或者-x f77-cpp-input

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

最新更新