<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7650.28">
<TITLE>RE: [CMake] Fortran-C mixed code (possible solution)</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>>> 2) A typical Fortran-C interface library (and we provide such<BR>
>> libraries for 3 different solvers) contains around 30<BR>
>> different functions which would then require 180 wrappers<BR>
>> (for all combinations lower/upper case and none/one/two<BR>
>> underscores)! A nightmare of (unnecessary) code duplication.<BR>
><BR>
>Not necessarily:<BR>
>You can put the actual wrapper functions in a separate file and >include it several times, like this:<BR>
><BR>
>#define suba SUBA<BR>
>#include "wrappers.h"<BR>
>#define suba SUBA_<BR>
>#include "wrappers.h"<BR>
>#define suba SUBA__<BR>
>#include "wrappers.h"<BR>
>...<BR>
> Maybe not the most elegant way to solve it, but somewhere<BR>
> you need the six combinations of case/appended underscores.<BR>
<BR>
Correct me if I'm wrong, but I believe there are some<BR>
FORTRAN compilers which change the number of underscores<BR>
appended depending on whether the name already contains<BR>
an underscore (the g77 documentation on -funderscoring, -fno-underscoring, and -fno-second-underscore mentions<BR>
this). So perhaps more effort is required. :-(<BR>
<BR>
David</FONT>
</P>
</BODY>
</HTML>