Nag nagfor compiler
We have tested the Fortran modules with the Nag f95 and nagfor compilers. They work by default to the Fortran95 standard, and generate a great many warning messages about Fortran2003 extensions. Some but not all of these can be avoided by specifying the –f2003 compiler flag.
There have been difficulties under Windows NT (32-bit) because of differences between naming conventions used by the compilers and the OpenGL libraries. In the case of the Nag compilers, these difficulties can be overcome by replacing BIND(C,NAME="...") in the f03gl interfaces by BIND(C,NAME="__stdcall ..."). Such difficulties are not expected to arise with 64-bit versions of Windows.
gfortran
Recent versions of the gfortran compiler (version 4.5.0 and later) work. Note that string arguments must be converted explicitly to null-terminated C character arrays, using the CString function. See the example programs for usage.
Portland pgfortran
Version 10.9 of the pgfortran compiler handles C-interoperability, but some of the test files throw up errors. We have not yet been able to establish whether these are due to bugs in the compiler or mistakes in our code.
Intel
Versions 11.1.059 and later of the Intel ifort compiler compile and run the test programs successfully, though it was necessary to rename one of the menu_handler routines in plotfunc.f90, even though they are in different modules and declared private.
Windows Visual Studio
As with the Nag compilers, there have been difficulties under Windows NT (32-bit) because of differences between naming conventions used by the compilers and the OpenGL libraries. The following procedure has been suggested by Gregory Lantoine, whose help is gratefully acknowledged.
In IVF, it is not possible to use BIND(C,NAME="...") for STDCALL routines. Instead, you must remove the BIND(C,NAME="...") attribute and then add a directive of the form: !DEC$ ATTRIBUTES STDCALL, REFERENCE, DECORATE, ALIAS:"glClear" :: glClear in the interface body, for each gl, glu and glut routine.
For the glut routines with callbacks as arguments, I changed the syntax of the interface a little bit. I use bind(C) for the calling convention of the callbacks:
interface subroutine glutDisplayFunc(fun) !DEC$ ATTRIBUTES STDCALL, REFERENCE, DECORATE, ALIAS:"glutDisplayFunc" :: glutDisplayFunc interface subroutine fun() bind(c) end subroutine fun end interface end subroutine glutDisplayFunc end interface
In the callback declarations in the main program, we must also specify bind(C).