From: Adam Alpern
Subject: Foreign function problem in CMU CL
Date: 
Message-ID: <3mmah8$8ca@gort.oit.umass.edu>
I'm having problems getting foreign functions to work with CMU CL.
I'm using CMU Common Lisp 17f under SunOS 4.1.3 on a SPARC 20. I've
got a piece of C code that simply takes to arrays of floats as
arguments. Here's the prototype:

void net77mangled(float in[], float out[])

I've used def-alien-routine to define a lisp interface like so:

(def-alien-routine net77mangled void
  (in  (array single-float 192)) 
  (out (array single-float 2)))

And I'm calling it like this:

(defun call-network (inputs)
  (let ((i 0))
    (with-alien ((in (array single-float 192))
		 (out (array single-float 2)))
		(dolist (v inputs)             ; fill the input array
		  (setf (deref in i) (coerce v 'single-float))
		  (incf i))
		(net77mangled in out)
		;(alien-funcall
		; (extern-alien "net77mangled"
		;	       (function void
		;			 (array single-float 192)
		;			 (array single-float 2)))
		; in out)
		)))
		
However, when I actually call the function call-network, I get this error:

Error in function c::do-call:
   Condition slot is not bound: conditions::operation

Restarts:
  0: [continue] Ignore problem and continue.
  1: [kill-app] Close current application.
  2: [abort   ] Return to Top-Level.

Debug  (type H for help)

(sparc:sigfpe-handler #<unavailable-arg>
                      #<unavailable-arg>
                      #.(system:int-sap #xEFFFE5A8))
0] 

Any ideas? Continuing eventually causes a bus error (error in
unix::sigbus-handler) when I try to do a backtrace.

Thanks,
-- 
·······@hampshire.edu			WWW: http://hampshire.edu/~adaF92/
Adam Alpern, Hampshire College