diff --git a/Makefile b/Makefile index e0d8b69..5840bf6 100644 --- a/Makefile +++ b/Makefile @@ -54,5 +54,5 @@ compile-macos-arm: .PHONY: test test: - python -m pytest --ignore=venv + export PYTHONPATH=.;python -m pytest --ignore=venv --ignore-glob="venv_*" diff --git a/pysdd/lib/sdd-2.0/include/sddapi.h b/pysdd/lib/sdd-2.0/include/sddapi.h index 0b1a7f9..ee92c2e 100644 --- a/pysdd/lib/sdd-2.0/include/sddapi.h +++ b/pysdd/lib/sdd-2.0/include/sddapi.h @@ -23,8 +23,8 @@ //sdd types typedef size_t SddSize; //number of nodes, sizes of hash tables, etc -typedef unsigned int SddNodeSize; //size of decomposition for sdd nodes -typedef unsigned int SddRefCount; //refcount +typedef size_t SddNodeSize; //size of decomposition for sdd nodes, changed to size_t for cross-platform compatibility +typedef size_t SddRefCount; //refcount, changed to size_t for cross-platform compatibility typedef unsigned long long SddModelCount; //model counts typedef double SddWmc; // weighted model count typedef long SddLiteral; //literals of clauses diff --git a/pysdd/lib/sdd-2.0/src/fnf/compiler.c b/pysdd/lib/sdd-2.0/src/fnf/compiler.c index a5a20b6..d8b1d9c 100644 --- a/pysdd/lib/sdd-2.0/src/fnf/compiler.c +++ b/pysdd/lib/sdd-2.0/src/fnf/compiler.c @@ -25,7 +25,7 @@ SddNode* degenerate_fnf_test(Fnf* fnf, SddManager* manager) { if(count==0) return ONE(manager,op); - for(int i=0; ilitsets[i].literal_count == 0) return ZERO(manager,op); } @@ -43,7 +43,7 @@ SddNode* fnf_to_sdd_auto(Fnf* fnf, SddManager* manager) { if(verbose) { printf("\nclauses: %ld ",count); fflush(stdout); } SddNode* node = ONE(manager,op); - for(int i=0; i 0 && i > 0 && i%period==0) { // after every period clauses sdd_ref(node,manager); diff --git a/pysdd/lib/sdd-2.0/src/fnf/utils.c b/pysdd/lib/sdd-2.0/src/fnf/utils.c index 0812588..93d637e 100644 --- a/pysdd/lib/sdd-2.0/src/fnf/utils.c +++ b/pysdd/lib/sdd-2.0/src/fnf/utils.c @@ -57,7 +57,8 @@ int litset_cmp_lca(const void* litset1_loc, const void* litset2_loc) { //last: by id to obtain unique order void sort_litsets_by_lca(LitSet** litsets, SddSize size, SddManager* manager) { //compute lcas of litsets - for(SddLiteral i=0; ivtree = sdd_manager_lca_of_literals(litset->literal_count,litset->literals,manager); } diff --git a/pysdd/sdd.pyx b/pysdd/sdd.pyx index 6f2df10..a52219a 100644 --- a/pysdd/sdd.pyx +++ b/pysdd/sdd.pyx @@ -27,13 +27,13 @@ import cython import collections -IF HAVE_CYSIGNALS: - from cysignals.signals cimport sig_on, sig_off -ELSE: - # for non-POSIX systems - noop = lambda: None - sig_on = noop - sig_off = noop +# IF HAVE_CYSIGNALS: # IF is deprecated in cython, drop cysignals support for now +# from cysignals.signals cimport sig_on, sig_off +# ELSE: +# for non-POSIX systems +noop = lambda: None +sig_on = noop +sig_off = noop cdef class SddNode: @@ -324,7 +324,7 @@ cdef class SddNode: def print_ptr(self): #cdef long t = self._sddnode #print(t) - print("{0:x}".format(&self._sddnode)) + print("{0:x}".format(&self._sddnode)) def save(self, char* filename): return self._manager.save(filename, self) diff --git a/pysdd/sddapi_c.pxd b/pysdd/sddapi_c.pxd index 84c7aa8..bc8a0e4 100644 --- a/pysdd/sddapi_c.pxd +++ b/pysdd/sddapi_c.pxd @@ -9,8 +9,8 @@ pysdd.sddapi_c """ cdef extern from "sddapi.h": ctypedef size_t SddSize; # TODO: only for 64bit - ctypedef unsigned int SddNodeSize - ctypedef unsigned int SddRefCount + ctypedef size_t SddNodeSize + ctypedef size_t SddRefCount ctypedef unsigned long long SddModelCount ctypedef double SddWmc ctypedef long SddLiteral diff --git a/setup.py b/setup.py index de8eddf..657da44 100644 --- a/setup.py +++ b/setup.py @@ -93,7 +93,7 @@ def __init__(self, attrs=None): # compile_time_env['HAVE_CYSIGNALS'] = True c_args = { - 'unix': ['-O3'], + 'unix': ['-O3', '-Wall'], 'msvc': ['/Ox', '/fp:fast', '/favor:INTEL64', '/Og'], 'mingw32': ['-O3', '-march=native'] }