From 64e45748dec58ae8baf59a936fe12d256aba6bed Mon Sep 17 00:00:00 2001 From: Utz-Uwe Haus Date: Fri, 28 May 2010 13:14:03 +0200 Subject: [PATCH] Fix automatic .so loading and add Makefile Signed-off-by: Utz-Uwe Haus --- Makefile | 9 +++++++++ cudd-cffi.i | 3 ++- cudd.asd | 4 ++++ cuddsat.lisp | 8 ++++---- 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..294c4ec --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +SWIG=swig + +all: dist cuddapi.lisp + +dist: + make -Cdistr + +cuddapi.lisp: cudd-cffi.i + $(SWIG) -cffi -Idistr $< diff --git a/cudd-cffi.i b/cudd-cffi.i index c20d27f..728e9f4 100644 --- a/cudd-cffi.i +++ b/cudd-cffi.i @@ -268,6 +268,7 @@ TYPEMAP_WRAPPED_POINTER(DdNode *, cudd-node) (maphash #'(lambda (key val) (declare (ignore val)) (cuddapi:cudd-recursive-deref + manager (unwrap-bdd key))) vartab)))) res)) @@ -493,4 +494,4 @@ variable names specified in the bdd file." :finally (return nodenames)))))))) -%} \ No newline at end of file +%} diff --git a/cudd.asd b/cudd.asd index da12ad1..84c16cd 100644 --- a/cudd.asd +++ b/cudd.asd @@ -48,9 +48,13 @@ :components (;; try installed copy (:shared-unix-library "installed_libcudd" + :pathname "/usr/local/lib/libcudd") + (:shared-unix-library "installed_libcudd_so" :pathname "/usr/local/lib/libcudd.so") ;; try local copy (:shared-unix-library "temp_libcudd" + :pathname "./cudd/libcudd") + (:shared-unix-library "temp_libcudd_so" :pathname "./cudd/libcudd.so"))) ;; (:file "package") diff --git a/cuddsat.lisp b/cuddsat.lisp index d979b91..72d9eea 100644 --- a/cuddsat.lisp +++ b/cuddsat.lisp @@ -54,6 +54,10 @@ (cuddapi:cudd-recursive-deref ,manager ,x) ,x))) +(deftype cudd-int () + `(integer ,#.(1- (- (expt 2 (* 8 (- (cffi:foreign-type-size :int) 1))))) + ,#.(expt 2 (* 8 (- (cffi:foreign-type-size :int) 1))))) + (defun make-clause-tree (env c) (loop :with f := (reference (sat-env-false env)) :with manager := (sat-env-manager env) @@ -82,10 +86,6 @@ (setf (sat-env-cnf env) newcnf)) (values)) -(deftype cudd-int () - `(integer ,#.(1- (- (expt 2 (* 8 (- (cffi:foreign-type-size :int) 1))))) - ,#.(expt 2 (* 8 (- (cffi:foreign-type-size :int) 1))))) - (defun destroy-sat-env (env) (with-slots (name manager cnf vars) env -- 2.11.4.GIT