On Apr 2, 2009, at 8:22 PM, Chris Swierczewski wrote:

> Robert,
>
>> So I understand you better, what you're trying to do is let the user
>> provide their functions at runtime rather than at compile time?
>
> Yes.
>
>> I think the easiest way to go about this would be to provide  
>> custom non-
>> empty functions that call your code (e.g. via a function pointer the
>> way callbacks work) rather than compiling empty stub functions and
>> trying to overload the symbols at (load/run)time.
>
> However (and perhaps my lack of effectively communicating is at fault)
> the Fortran functions in the compiled library already call each other.
> One thing I can do, however, is wrap these original Fortran functions
> with C by adding some wrappers of each said function. The function
> wrappers optionally accept function pointers. If it's a null pointer
> than call the built-in Fortran function (most of which are already
> stubs). However, any non-null function pointer is called in place of
> the Fortran.
>
> That's me thinking aloud. Does it sound like a good plan?

Yes, that sounds like it would work.

> I can't really change the organization of the Fortran subroutines in
> question since Clawpack users directly use and modify the code. Don't
> want to mess with the core functionality.

I'm not sure I'm following you here--in wrapping the library you are  
the middleman. From Clawpack's perspective, you are just a user (and  
can directly use and modify the code just as anyone else would). I've  
never personally used Clawpack though, so I can only speak in terms  
of generalities.

I'd be happy to meet with you sometime to look at this if you want as  
well.

  - Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to