Fix automatic .so loading and add Makefile
authorUtz-Uwe Haus <haus@uuhaus.de>
Fri, 28 May 2010 11:14:03 +0000 (28 13:14 +0200)
committerUtz-Uwe Haus <haus@uuhaus.de>
Fri, 28 May 2010 11:14:03 +0000 (28 13:14 +0200)
Signed-off-by: Utz-Uwe Haus <haus@uuhaus.de>
Makefile [new file with mode: 0644]
cudd-cffi.i
cudd.asd
cuddsat.lisp

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
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 $<
index c20d27f..728e9f4 100644 (file)
@@ -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
+%}
index da12ad1..84c16cd 100644 (file)
--- a/cudd.asd
+++ b/cudd.asd
                         :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")
index d979b91..72d9eea 100644 (file)
        (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)
     (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