How to Start¶
Build the library according to Build Library.
First program¶
Create a program in fortran 90 standard using the FPL module.
1 2 3 4 5 | program myfirstprogram
use fpl !FPL module
implicit none
write(*,*) "This is my first program using " fpl_libversion()
end program myfirstprogram
|
Save as file (myfirstprogram.f90) and compiling using gfortran.
#RedHat based systems
gfortran -o myfirstprogram.out myfirstprogram.f90 -I/usr/lib64/gfortran/modules/ -lFPL
#Debian based systems
gfortran -o myfirstprogram.out myfirstprogram.f90 -I/usr/include/ -lFPL
Important
-I<dir>
This option specifies where to put .mod files for compiled modules. It is also added to the list of directories to Influencing the linking step. See the GNU Fortran Compiler Documentation .
<dir>
is defined in Makefile as $(FPL_moddir)
. See Build Library.
After compilation run the program ./myfirstprogram.out