From 65a4592a6fd8786cedbad3bb3af2984fc97a9e54 Mon Sep 17 00:00:00 2001 From: Carl Date: Fri, 17 Feb 2023 08:24:44 +0100 Subject: [PATCH] gfortran: add page (#9854) --- pages/common/gfortran.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pages/common/gfortran.md diff --git a/pages/common/gfortran.md b/pages/common/gfortran.md new file mode 100644 index 0000000000..465149c528 --- /dev/null +++ b/pages/common/gfortran.md @@ -0,0 +1,24 @@ +# gfortran + +> Preprocess and compile Fortran source files, then assemble and link them together. +> More information: . + +- Compile multiple source files into an executable: + +`gfortran {{path/to/source1.f90 path/to/source2.f90 ...}} -o {{path/to/output_executable}}` + +- Show common warnings, debug symbols in output, and optimize without affecting debugging: + +`gfortran {{path/to/source.f90}} -Wall -g -Og -o {{path/to/output_executable}}` + +- Include libraries from a different path: + +`gfortran {{path/to/source.f90}} -o {{path/to/output_executable}} -I{{path/to/mod_and_include}} -L{{path/to/library}} -l{{library_name}}` + +- Compile source code into Assembler instructions: + +`gfortran -S {{path/to/source.f90}}` + +- Compile source code into an object file without linking: + +`gfortran -c {{path/to/source.f90}}`