Linking Focal Programs
To use the Focal module in your own code, include the module with the
program myprogram use Focal implicit none ... end program myprogram
To compile a program using the Focal module, you must point the compiler to the
mod/Focal.mod definition in the Focal repository.
For example, in gfortran this is done with the
$> gfortran -c myprogram.f90 -I/path/to/focal/mod/ -o myprogram.o
To link, you need to specify the path to the Focal repository and directives for
$> gfortran myprogram.o -L/path/to/focal/lib/ -lFocal -lOpenCL -o bin/myprogram
See examples in the repository for how this can be done with a
When the Focal library is built, two versions are produced:
libFocaldbg where the latter
contains additional runtime calls that check the validity of your program.
To link against the debug build replace
-lFocaldbg in the linking command.
See here for more information on runtime debug checks.