Subject: clisp, ffi and blas/lapack

From: Sam Steingold <[email-masked]>
Date: 12 Aug 1998 19:09:01 -0400

Is it possible to call blas/lapack procedures from CLISP?
(I seem to vaguely remember that ffi is limited to C).
If yes, has anyone done it?

# rpm -qilp blas-2.0-10.i386.rpm lapack-2.0-10.i386.rpm 
Name        : blas                        Distribution: (none)
Version     : 2.0                               Vendor: (none)
Release     : 10                            Build Date: Mon Aug 10 11:37:13 1998
Install date: (not installed)               Build Host: s9412a.steinan.ntnu.no
Group       : Development/Libraries         Source RPM: lapack-2.0-10.src.rpm
Size        : 1029839
Packager    : Trond Eivind Glomsr�ød ([email-masked])
URL         : http://www.netlib.org/lapack/
Summary     : The Basic Linear Algebra libraries for Linux
Description :
BLAS (Basic Linear Algebra Subprograms) is a standard lib
for numerical algebra. It provides a number of basic algorithms
for linear algebra, and is fast and well-tested. It is
written in FORTRAN 77, and built with egcs.
/usr/lib/libblas.a
/usr/lib/libblas.so
/usr/lib/libblas.so.2
/usr/lib/libblas.so.2.0
/usr/lib/libblas.so.2.0.1
Name        : lapack                      Distribution: (none)
Version     : 2.0                               Vendor: (none)
Release     : 10                            Build Date: Mon Aug 10 11:37:13 1998
Install date: (not installed)               Build Host: s9412a.steinan.ntnu.no
Group       : Development/Libraries         Source RPM: lapack-2.0-10.src.rpm
Size        : 7430256
Packager    : Trond Eivind Glomsr�ød ([email-masked])
URL         : http://www.netlib.org/lapack/
Summary     : The LAPACK libraries for Linux.
Description :
LAPACK (Linear Algebra Package) is a standard lib for
numerical linear algebra. It is built on the BLAS, and
provides many advanced and well-tested routines. It
is coded in FORTRAN 77, and built with egcs.
/usr/doc/lapack-2.0
/usr/doc/lapack-2.0/README
/usr/lib/liblapack.a
/usr/lib/liblapack.so
/usr/lib/liblapack.so.2
/usr/lib/liblapack.so.2.0
/usr/lib/liblapack.so.2.0.1

-- 
Sam Steingold (http://www.goems.com/~sds) running RedHat5.1 GNU/Linux
Micros**t is not the answer. Micros**t is a question, and the answer is Linux,
(http://www.linux.org) the choice of the GNU (http://www.gnu.org) generation.
Why use Windows, when there are Doors?

---

From: Raymond Toy <[email-masked]>
Date: Tue, 18 Aug 1998 08:12:47 -0400

>>>>> "Sam" == Sam Steingold <[email-masked]> writes:

    Sam> Is it possible to call blas/lapack procedures from CLISP?
    Sam> (I seem to vaguely remember that ffi is limited to C).
    Sam> If yes, has anyone done it?

This doesn't really help you, but if the ffi handles C, you can
definitely handle Fortran (on Linux), since C can easily call
Fortran. 

You need to remember these things:

1.  All parameters in Fortran are pointers.
2.  Fortran names have an underscore appended to them.  Thus, if the
    Fortran function is "daxpy", the C name is "daxpy_".  (Or was that 
    prepended?)

This should be enough to get blas/lapack hooked up to CLISP.

I haven't done this for CLISP, but I've done it for CMUCL.  I've done
most of BLAS1, some parts of BLAS2, BLAS3, and a very small part of
LAPACK.  Basically just the parts I needed.

Ray