主题:f77+mpi编译出错
FFLAGS = -O2 -w -I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib
CFLAGS = -O2 -w
CODE = p2d3t.e
XDIR = run
SG21:$(SRC) $(SG21SRC)
mpif77 $(FFLAGS) -o $(CODE) $(SRC) $(SG21SRC)
cp $(CODE) $(XDIR)/run1
别人的f77+mpi程序,在我的虚拟机ubuntu系统下编译出错,上面是部分makefile代码,我将FFLAGS路径修改后还是有问题,具体问题如下:
l****@ubuntu:~/Downloads/soft3$ make
f77 -O2 -w -I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib -c -o e2d3ts.o e2d3ts.f
e2d3ts:
Error on line 138: Declaration error for t0: adjustable dimension on non-argument
Error on line 138: wr_ardecls: nonconstant array size
Error on line 138: wr_ardecls: nonconstant array size
/usr/bin/f77: aborting compilation
make: *** [e2d3ts.o] Error 25
我自己感觉应该是可调数组维数的问题,提示错误的源程序如下:
c
subroutine e2d3ts(nconv,redf,linear_niter,
1 iter_method_sles,npreconditioner)
implicit real*8 (a-h,o-z)
include "mpi2d3t.i"
include "snesf.h"
c
dimension t0(n,0:imcell+1,0:jmcell+1)
dimension linear_niter(1)
但是不知道怎么修改,我查看相关介绍,f77是支持可调数组维数的啊,望高人指点,多谢。我刚刚接触fortran希望能回答的详细些。
CFLAGS = -O2 -w
CODE = p2d3t.e
XDIR = run
SG21:$(SRC) $(SG21SRC)
mpif77 $(FFLAGS) -o $(CODE) $(SRC) $(SG21SRC)
cp $(CODE) $(XDIR)/run1
别人的f77+mpi程序,在我的虚拟机ubuntu系统下编译出错,上面是部分makefile代码,我将FFLAGS路径修改后还是有问题,具体问题如下:
l****@ubuntu:~/Downloads/soft3$ make
f77 -O2 -w -I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib -c -o e2d3ts.o e2d3ts.f
e2d3ts:
Error on line 138: Declaration error for t0: adjustable dimension on non-argument
Error on line 138: wr_ardecls: nonconstant array size
Error on line 138: wr_ardecls: nonconstant array size
/usr/bin/f77: aborting compilation
make: *** [e2d3ts.o] Error 25
我自己感觉应该是可调数组维数的问题,提示错误的源程序如下:
c
subroutine e2d3ts(nconv,redf,linear_niter,
1 iter_method_sles,npreconditioner)
implicit real*8 (a-h,o-z)
include "mpi2d3t.i"
include "snesf.h"
c
dimension t0(n,0:imcell+1,0:jmcell+1)
dimension linear_niter(1)
但是不知道怎么修改,我查看相关介绍,f77是支持可调数组维数的啊,望高人指点,多谢。我刚刚接触fortran希望能回答的详细些。