Toon Knapen wrote:
1) all manual For the bindings we #ifdef on the platform to determine how to convert identifiers (to match their fortran counterpart) and then define an identifier for every function (with the additonal underscore ...)
e.g. #ifdef __sgi #define DAXPY daxpy_ #endif
2) Wave (as suggested by Hartmut Kaiser) Use wave to create a header from an input-file. This puts a strong dependency on Wave and although the tool is impressive, this will make it difficult for people to add a new binding IMHO.
Actually, what Hartmut is working on now is a general mechanism for the preprocessor to call external programs. The tolower, toupper types of things fit into this mold perfectly.
3) Suggestion above of Paul Mensonidis This option will give us minimal work, we could just write IIUC FORTRAN_ID( d a x p y ). (Paul: could we leave out the seperation of the characters if we always provide seperated characters directly as in the line above ?) However, this solution might limit portability.
Yes, you could do it either way and it won't effect portibility. I just thought that you want syntactic "cleanliness", without having to do this: # if /* style == leading-underscore */ # define FUNCTION _function # elif /* style == all-caps */ # define FUNCTION FUNCTION # else # define FUNCTION function # endif ...for every identifier used. For maximum syntactic cleanliness, you need a minimum of one macro per identifier: #define DAXPY FORTRAN_ID(d a x p y _) But this is just a shorthand for directly using FORTRAN_ID(...).
Although I'm used to option 1, I would like to go for option 3 (although maybe looking at the portability of the pp lib would not hurt)
I'm not sure what you mean here. I would use the pp-lib of course. In fact, I'd add a few things to it that should probably be added anyway. Regards, Paul Mensonides