Fortran is one of the oldest programming languages around. It has survived and thrived through the years, despite its disadvantages due to:
% f77 fortran_program.f -o executable_nameIf you omit -o executable_name the executable binary will be called a.out by default.
% f77 fortran_program1.f fortran_program2.f -o executable_nameor compile them separately and then link the resulting object files (".o" files) together:
% f77 -c fortran_program1.f % f77 -c fortran_program2.f % f77 fortran_program1.f fortran_program2.f -o executable_nameIf some of the include files that you require (by # include <include_file.h> (you can use cpp style includes in Fortran) or include 'include_file' statements in your Fortran source code) are not in the standard include file search paths the C preprocessor cpp (called by the Fortran compiler in case it meets any include statements) searches in, you can specify them by the -Iinclude_search_path flag:
% f77 -I/usr/local/mpich/include -c mpi.fSimilarly, if some of the library functions that your program uses are not to be found among the standard libraries the linker looks in for a Fortran program, you have to specify them yourself, sometimes including the path to the library if it not in the standard directory the linker looks in:
% f77 mathfortran_program1.o mathfortran_program2.o -o executable_name -lblas % f77 mpi.o -o mpi-test -L/usr/local/mpich/lib/IRIX/ch_shmem -lmpiIf you are using a library whose filename is libblas.a, you specify it as -lblas.