From: Nicolas N. <Nic...@iw...> - 2005-12-07 15:14:34
|
Raymond Toy <ray...@er...> writes: >>>>>> "Nicolas" == Nicolas Neuss <Nic...@iw...> writes: > > Nicolas> Raymond Toy <ray...@er...> writes: > >> Not quite sure what you mean by automating the process of making the > >> routines available. Someone has to figure out the function signature > >> to tell Lisp how to call it. And some of the functions take > >> characters or strings, and that is very dependent on the Fortran > >> compiler. Same with returning complex values. > > Nicolas> Does this mean that interfacing to Fortran libraries is ill-defined? Maybe > Nicolas> one should use the C-interface of BLAS/LAPACK then? > > Perhaps. Replacing them all would be quite a bit of work, though. Is > the C interface just that and you still have to use Fortran for > BLAS/LAPACK, so you get another layer? If one uses clapack, it uses f2c (http://www.netlib.org/clapack/readme). But I don't know how performance does compare. > I think the standard used by Matlisp is the standard for the old > portable f77 compiler, which is used by g77 and Sun f77, so it's not > so bad. I suspect that I'm the only one who uses something other than > g77, and I don't do that very often either. > > For the record, Fortran strings are represented as basically C > strings, and the length of the string is appended to the list of > parameters. Functions returning complex values actually insert a new > parameter into the arg list and this parameter is a pointer to where > the complex value should be stored. This is probably how the C > interface works. > > Ray Ouch, this looks much nastier than I thought. I googled, and did not find even a complete C interface to the Fortran BLAS/LAPACK libraries. In this case, trying to do an automatic CL interface is probably not very reasonable. Thanks for the information, Nicolas. |