[cffi-devel] null-pointer, *INLINE-EXPANSION-LIMIT* exceeded
Tamas K Papp
tpapp at Princeton.EDU
Sun May 18 18:42:45 UTC 2008
Hi,
When compiling a function, I get this strange error message:
; in: DEFUN UMFPACK-SOLVE
; (CFFI-SYS:NULL-POINTER)
;
; note: *INLINE-EXPANSION-LIMIT* (200) was exceeded, probably trying to
; inline a recursive function.
The code looks like this, it is in my cl-sparsematrix package
(asdf-installable), cffi version is 20080217, using SBCL 1.0.16.0.
The code looks like below, I tried to come up with a smaller example
but couldn't (does not happen in one-liners using null-pointer).
null-pointer does not look recursive to me... umfpack-catch-error is
a macro. If there is something obvious I am doing wrong, please let
me know, if not, helpful hints on how to determine what is going on
are welcome.
(defun umfpack-solve (a-csc b &optional
(symbolic (umfpack-symbolic a-csc)))
"Use umfpack-solve to solve the sparse system A x = b, where a-csc
is A packed in csc format. If you are solving many systems of the
same shape, you should precalculate the symbolic object and supply
it for a minor increase in speed."
(with-slots (nrow ncol ap ai ax) a-csc
(assert (= nrow ncol)) ; need square matrix
(let ((x (make-ffa nrow :double))) ; Ax=b
(with-slots ((symbolic-pointer pointer)) symbolic
(with-pointers-to-arrays ((ap ap-pointer :uint32 (length ap) :copy-in)
(ai ai-pointer :uint32 (length ai) :copy-in)
(ax ax-pointer :double (length ax) :copy-in)
(x x-pointer :double (length x) :copy-out)
(b b-pointer :double (length b) :copy-in))
(with-foreign-pointer
(numeric-goes-here (foreign-type-size :pointer))
;; calculate Numeric object
(format t "umfpack: calculating numeric object~%")
(umfpack-catch-error
(umfpack_di_numeric
ap-pointer ai-pointer ax-pointer
symbolic-pointer numeric-goes-here
(null-pointer) (null-pointer)))
;; solve system
(format t "umfpack: solving system~%")
(umfpack-catch-error
(umfpack_di_solve
0 ap-pointer ai-pointer ax-pointer x-pointer
b-pointer (mem-ref numeric-goes-here :pointer)
(null-pointer) (null-pointer))))
;; return x
x))))))
Thanks,
Tamas
More information about the cffi-devel
mailing list