Re: F2CL under LWW a few warnings

Raymond Toy <[email protected]> Wed, 11 Aug 2004 20:39:30 -0400
Newsgroups gmane.lisp.clocc.general
Message-ID <[email protected]>
Marco Antoniotti wrote:
> 
> On Aug 11, 2004, at 4:27 PM, Raymond Toy wrote:
>>
>> I also see in opkdmain.f, there are two declarations for the dlss01
>> common block.  I don't know if that means to concatenate them or not,
>> but f2cl definitely doesn't handle that.
> 
> 
> How are the common blocks defstruct's generated?

Basically it looks at the elements in the common block and creates a 
structure with slots created from each name in the block.  So a common block

      real a(10)
      integer b, c
      common /foo/ a, b, c

becomes a defstruct like

      (defstruct foo-common
        (a (make-array 10 :element-type 'single-float)
           :type (simple-array single-float (10))
        (b 0 :type '(signed-byte 32))
        (c 0 :type '(signed-byte 32)))

But some old fortran code would have the block foo above in one 
function, but in another declare the block as

       integer a(10)
       real b, c
       common /foo/ a, b, c

or even

       integer a, b(9)
       integer c, d
       common /foo/ a, b, c, d

and expect everything to work.  f2cl definitely cannot handle this.  I 
have thought about how to make this work, and think I can make it work, 
but it would no longer be portable Lisp, so I've decided against it.

> I am ready to, but the alternatives are not all that fun either.
> 1 - rewrite a CL implementation of the integrator
> 2 - use f2c to generate C that I can call from the FFI
> 3 - Use Python (or C, or Perl, or Java)
> 
> Can we give it another round before 1, 2, or 3? :)

4 - Use a Fortran compiler and write the FFI for that.  Most Fortran 
compilers have a calling convention that is C compatible.  I can help 
you with that.  Of course, you'd have to provide your own callback routines.

5 - Find another ODE package that might be easier on f2cl.

Ray



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285