Oakleaf in Fortran

The Oakleaf interface for Fortran programmers.

Since Oakleaf is developed in Fortran, the choice is natural as the interface design follows common conventions.

A basic usage

Oakleaf is used in the same fashion as other libraries:

Use
Include use oakleaf in the preambule of the program. It provide declarations of routines.
Call
Call a desired subroutine.
Link
Link the program with the Oakleaf library. The library depends on common system libraries and Minpack.

An illustration can be the program saved into hello.f08:

program hello

   use oakleaf
   real :: mean

   call rmean([1.0,2.0,3.0],mean)
   write(*,*) "Hello world, the mean is:",mean

end program hello

The program can be compiled, linked and run as:

$ gfortran -I/usr/include hello.f08 -L/usr/lib -loakleaf -lminpack
$ ./a.out
 Hello world, the mean is:   2.00038409

The setup for paths, both the includes and libraries, as -I/path/to/fortran/modules or -L/path/to/libraries, depends on the current instalation. The sub-tree is /usr/local if installed by hand, whilst the packages for GNU/Debian or Ubuntu place it into /usr, like the example.