环境:
- ubuntu 20.04
- gfortran 9.3.0
- gcc 9.3.0
使用程序包自带的Makefile
编译,报错如下:
22 | REAL vps(2,max_num_lay),den(max_num_lay),thk(max_num_lay),q(2,max_num_lay)
...
25 | COMMON/model/num_lay,vps,den,thk,q,src_lay,src,nCom,
| 1
Error: Symbol ‘vps’ at (1) has no IMPLICIT type
make: *** [<builtin>: trav.o] Error 1
Makefile
使用系统默认的C和Fortran编译器,在Makefile
前两行加上以下两行,指定编译器,并增加解决以上报错的选项-ffixed-line-length-none
:
FC=gfortran -ffixed-line-length-none
CC=gcc
如果在编译fk
之前已经安装了SAC
,可以取消以下两行的注释:
# CFLAGS=$(optimize) -DSAC_LIB
# SACLIB=-L$(SACHOME)/lib -lsac -lsacio
网友评论