List of gfortran-ready libraries and packages

Tobias Burnus burnus@net-b.de
Fri Oct 1 11:54:00 GMT 2010


  On 10/01/2010 01:34 PM, Paul Richard Thomas wrote:
> On Fri, Oct 1, 2010 at 11:43 AM, FX<fxcoudert@gmail.com>  wrote:
>>    3. Wiki pages on how to integrate Fortran with other languages and tools (C, C++, Matlab, Mathematica, ...)

In the same direction: Some commercial vendors offer some modules (plus 
some support hidden in their run-time library) to offer more access to 
the operating system such as POSIX bindings or - in case of Windows - 
access to the Windows system libraries. I think offering more in this 
direction would be useful as well.

> Evil thought...... a gfortran binding for Qt????

I think that is going to be a challenge. Qt is written in C++ and as far 
as I remember from programming it, it makes heavy use of it. I could 
image that it is quite difficult to get it working with any other 
language than C++. However, as there are python bindings, it is possible.

Possibly simpler is to interface Gtk as it is based on C.

  * * *

My problem with interfacing some larger libraries - but already smaller 
ones - is the problem to translate a .h file to a Fortran module. Let's 
take as simple example one of the POSIX functions. Most of them have a 
well defined interface, which one can easily generate an interface for. 
However, they either accept or return a value which has been defined in 
the header file as:
    #define MY_OPTION 77
POSIX tells you that MY_OPTION exists - but it does not tell you the 
value (implementation defined). Thus, in order to interface such a 
routine, you need either a preprocessing step which extracts this 
information or a wrapper library. Frankly, I do not see any simple 
solution. A general purpose C header file to Fortran module converter 
cannot be easily implemented. (Think also of more complex macros 
involving C code or inline functions.) -- The easiest it is if the 
library provider offers an interface in a usable Fortran, e.g. in .f90 
as MPI vendors do.

Tobias



More information about the Fortran mailing list