On Wed, Feb 8, 2012 at 6:05 PM, Raymond Toy <toy.raymond@gmail.com> wrote:
On Wed, Feb 8, 2012 at 6:01 AM, Juan Jose Garcia-Ripoll <juanjose.garciaripoll@googlemail.com> wrote:
On Wed, Feb 8, 2012 at 6:59 AM, Raymond Toy <toy.raymond@gmail.com> wrote:
Does ecl have the equivalent of cmucl's (and sbcl's)

Not yet. This can be implemented using SI::TRAP-FPE

(defmacro with-float-traps-masked (&body body)
   `(let ((%trap-bits (si::trap-fpe 'cl:last t)))
       (progn (si::trap-fpe %trap-bits nil) ,@body)
      (si::trap-fpe %trap-bits t))))

This will probably work.  I take it that this will disable all traps?  This would be the typical expected Fortran mode, so that's perfect.

'LAST tells ECL to return the last set of active traps and then the second statement deactivates them all.
and vector-sap?

Hmm, is this for the CFFI? Because it is going to depend very much on what VECTOR-SAP has to return. For UFFI you have SI::MAKE-FOREIGN-DATA-FROM-ARRAY which takes an array and returns an UFFI pointer. Alternatively, C-INLINE may be easily used to retrieve the pointer in a C format.

Thanks for the tips.  I'm not very familiar with cffi or uffi.  Basically, vector-sap needs to return something that can be made into a pointer for a foreign function to use as the address of an array/vector.

I do not know how MATLISP invokes BLAS or equivalent functions. If you need a pointer, then you need to know in which format MATLISP needs it.

I had a look at MATLISP. It is probably not unconceivable to translate it all to ECL's FFI constructs. Seems that all the fortran interface is in one file (ffi-*.lisp) and generates code automatically. Producing the associated C code would be easy and more efficient.


Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)