seismo-learn / software

Tutorials for popular seismological software
https://seismo-learn.org/software
10 stars 3 forks source link

FK不能通过NAG fortran的编译 #216

Closed wangliang1989 closed 3 years ago

wangliang1989 commented 3 years ago

按照教程的内容安装FK,makefile 的相关修改为:

- FC=gfortran
+ FC=nagfor
- FFLAGS=$(optimize) -ffixed-line-length-none
+ FFLAGS=$(optimize)

输出为:

nagfor -O  -c -o fk.o fk.f
NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Evaluation trial version of NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Extension: constants.h, line 10: TAB format input
Extension: constants.h, line 11: TAB format input
Extension: constants.h, line 12: TAB format input
Extension: constants.h, line 12: Byte count on numeric data type
           detected at *@8
Extension: constants.h, line 13: TAB format input
Extension: fk.f, line 82: TAB format input
Extension: fk.f, line 83: TAB format input
Extension: fk.f, line 92: TAB format input
Extension: fk.f, line 93: TAB format input
Extension: fk.f, line 100: TAB format input
Extension: fk.f, line 101: TAB format input (further warnings suppressed)
Obsolescent: fk.f, line 60: Fixed source form
[NAG Fortran Compiler normal termination, 12 warnings]
nagfor -O  -c -o kernel.o kernel.f
NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Evaluation trial version of NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Extension: constants.h, line 10: TAB format input
Extension: constants.h, line 11: TAB format input
Extension: constants.h, line 12: TAB format input
Extension: constants.h, line 12: Byte count on numeric data type
           detected at *@8
Extension: constants.h, line 13: TAB format input
Extension: layer.h, line 11: Byte count on numeric data type
           detected at *@8
Extension: layer.h, line 12: Byte count on numeric data type
           detected at *@16
Extension: kernel.f, line 38: Byte count on numeric data type
           detected at *@16
Extension: kernel.f, line 39: Byte count on numeric data type
           detected at *@16
Extension: kernel.f, line 54: TAB format input
Extension: kernel.f, line 55: TAB format input
Extension: kernel.f, line 58: TAB format input
Extension: kernel.f, line 59: TAB format input
Extension: kernel.f, line 61: TAB format input
Extension: kernel.f, line 62: TAB format input (further warnings suppressed)
Extension: constants.h, line 12: Byte count on numeric data type
           detected at *@8
Extension: layer.h, line 11: Byte count on numeric data type
           detected at *@8
Extension: layer.h, line 12: Byte count on numeric data type
           detected at *@16
Extension: kernel.f, line 115: Byte count on numeric data type
           detected at *@16
Obsolescent: kernel.f, line 31: Fixed source form
[NAG Fortran Compiler normal termination, 20 warnings]
nagfor -O  -c -o prop.o prop.f
NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Evaluation trial version of NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Extension: constants.h, line 10: TAB format input
Extension: constants.h, line 11: TAB format input
Extension: constants.h, line 12: TAB format input
Extension: constants.h, line 12: Byte count on numeric data type
           detected at *@8
Extension: constants.h, line 13: TAB format input
Extension: prop.f, line 26: Byte count on numeric data type
           detected at *@16
Extension: prop.f, line 66: Byte count on numeric data type
           detected at *@16
Extension: prop.f, line 69: TAB format input
Extension: prop.f, line 70: TAB format input
Extension: prop.f, line 71: TAB format input
Extension: prop.f, line 72: TAB format input
Extension: prop.f, line 74: TAB format input
Extension: constants.h, line 10: TAB format input (further warnings suppressed)
Extension: constants.h, line 12: Byte count on numeric data type
           detected at *@8
Extension: prop.f, line 88: Byte count on numeric data type
           detected at *@16
Extension: constants.h, line 12: Byte count on numeric data type
           detected at *@8
Extension: prop.f, line 116: Byte count on numeric data type
           detected at *@16
Extension: constants.h, line 12: Byte count on numeric data type
           detected at *@8
Extension: prop.f, line 140: Byte count on numeric data type
           detected at *@16
Obsolescent: prop.f, line 16: Fixed source form
[NAG Fortran Compiler normal termination, 20 warnings]
nagfor -O  -c -o source.o source.f
NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Evaluation trial version of NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Extension: source.f, line 34: TAB format input
Extension: source.f, line 35: TAB format input
Extension: source.f, line 53: TAB format input
Extension: source.f, line 54: TAB format input
Obsolescent: source.f, line 27: Fixed source form
[NAG Fortran Compiler normal termination, 5 warnings]
cpp -traditional-cpp bessel.FF > bessel.f
nagfor -O  -c -o bessel.o bessel.f
NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Evaluation trial version of NAG Fortran Compiler Release 7.0(Yurakucho) Build 7048
Extension: bessel.FF, line 7: TAB format input
Extension: bessel.FF, line 17: TAB format input
Extension: bessel.FF, line 18: TAB format input
Extension: bessel.FF, line 19: TAB format input
Error: bessel.FF, line 31: Implicit type for BESJ0
Error: bessel.FF, line 31: Implicit type for BESJ1
Error: bessel.FF, line 31: Implicit type for BESJN
[NAG Fortran Compiler pass 1 error termination, 3 errors, 4 warnings]
make: *** [bessel.o] Error 2

问题:

  1. 上述警告和报错是否紧要?
  2. FK不能通过NAG fortran编译,至少说明FK的代码并不严谨
  3. FK这类重要,而原作者更新慢的软件,要不要写一个社区版?把它的维护实际接手过来?如果要做,如何做?
seisman commented 3 years ago
  • 上述警告和报错是否紧要?

警告很忽略,报错不可以。报错是因为你使用了 cpp 对 bessel.FF 做预处理,所以生成的 bessel.f 是针对 GNU C 编译器的,所以 NAG Fortran 不得识别。

  • FK不能通过NAG fortran编译,至少说明FK的代码并不严谨

正常。

  • FK这类重要,而原作者更新慢的软件,要不要写一个社区版?把它的维护实际接手过来?如果要做,如何做?

没兴趣也没能力。

wangliang1989 commented 3 years ago

警告很忽略,报错不可以。报错是因为你使用了 cpp 对 bessel.FF 做预处理,所以生成的 bessel.f 是针对 GNU C 编译器的,所以 NAG Fortran 不得识别。

CPP 是什么

哦,是C++

那算了吧