Files
tldr/pages.zh/common/gfortran.md

24 lines
786 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# gfortran
> 预处理并编译Fortran源文件然后将它们汇编和链接在一起。
> 更多信息:<https://gcc.gnu.org/wiki/GFortran>。
- 将多个源文件编译成可执行文件:
`gfortran {{path/to/source1.f90 path/to/source2.f90 ...}} -o {{path/to/output_executable}}`
- 显示常见警告,输出调试符号,并优化而不影响调试:
`gfortran {{path/to/source.f90}} -Wall -g -Og -o {{path/to/output_executable}}`
- 从不同路径包含库:
`gfortran {{path/to/source.f90}} -o {{path/to/output_executable}} -I{{path/to/mod_and_include}} -L{{path/to/library}} -l{{library_name}}`
- 将源代码编译为汇编指令:
`gfortran -S {{path/to/source.f90}}`
- 将源代码编译为目标文件而不链接:
`gfortran -c {{path/to/source.f90}}`