[Coin-lpsolver] CLP from Compaq Visual Fortran 6.6

Michael Hennebry hennebry at web.cs.ndsu.NoDak.edu
Wed Nov 28 12:54:33 EST 2007


On Tue, 27 Nov 2007, Matthew Saltzman wrote:

> On Tue, 2007-11-27 at 10:48 -0600, Jose Luis Ceciliano Meza wrote:

> > Recently I have tried to create a Fortran interface to use CLP from
> > Visual Fortran. I am trying to use some advise from Matthew Saltzman,
> > and some experience that I have on using Lindo and CPLEX with the same
> > purpose. However, I am having some trouble. I would like to show you
> > what I have done and where my problem is in order to get some help
> > from you.

When I did my thesis research, I needed to call FORTRAN
from C++ without any special interfacing syntax.
The important thing is that FORTRAN always gives and expects pointers.
In the case of a scalar, it's a pointer to that scalar.
In the case of an array, it's a pointer to the initial element.
Unless you want to deal with name mangling,
C++ functions called from FORTRAN and FORTRAN functions
called from C++ should be declared extern "C".
I did have to use a compiler flag to add
or remove underbars from function names.
If you need to deal with underbars and don't have a compiler flag,
you might be able to edit with the linker.

I avoided the return value issue by
not returning a value between languages.

-- 
Mike   hennebry at web.cs.ndsu.NoDak.edu
"Horse guts never lie."  -- Cherek Bear-Shoulders




More information about the Clp mailing list