Hi there,

I have a small snippet of pex code (actually it is only one function, no
cdef classes or stuff, but uses decorated arrays) which runs fine on my
laptop (opensuse 10.3, 32bit linux) but won't run at my computer at
university (64bit, ubuntu).
Running pex on my .px file gets me a

Traceback (most recent call last):
  File "/home/btmwtaut/bin/pex", line 221, in <module>
    module=pimport(name,force_build=force_build)
  File "/home/btmwtaut/src/pex-0.8/pex/pimport.py", line 368, in pimport
    py_module_obj = do_python_import(pex_module_name,abspath,pkg_context)
  File "/home/btmwtaut/src/pex-0.8/pex/pimport.py", line 236, in
do_python_import
    module_obj=my_import(pex_module_name,global_dict)
  File "/home/btmwtaut/src/pex-0.8/pex/pimport.py", line 224, in my_import
    mod = __import__(name,global_dict)
  File "c_heur_solve.pyx", line 46, in c_heur_solve
    assert sizeof(long)==4      # use these for our checksum
AssertionError


I already use
%whencompiling: scope.pragma_gen_fastio=False
%whencompiling: scope.pragma_gen_hashmeth=False

I have numpy and python sources installed, I used a standalone cython on
this account without problems. (Pex, however, uses its own cython for
this (I think - at least it complained when it couldn't find cython.py
in ~/src/pex-0.8/.../))

Any thoughts what the problem might be?

Best wishes,
Nikolas Tautenhahn

uname -a:
Linux btmwxi 2.6.22-15-generic #1 SMP Tue Jun 10 08:52:15 UTC 2008
x86_64 GNU/Linux

Python version: 2.5.1

c_heur_solve.px:

%whencompiling: scope.pragma_gen_fastio=False
%whencompiling: scope.pragma_gen_hashmeth=False

def rowcheck(g, evil_list):
    cdef lenn = len(g.n), lenM = len(g.M), lenl = len(g.losers), lene =
len(evil_list), res
    rowset = set(g.rows)
    loserset = set(g.loserlist)
    for evil in evil_list:
        if evil[0].issubset(rowset) and evil[1].issubset(loserset):
            return False
    cdef ndarray<short, (lenM, lenn)> W
    cdef ndarray<short, (lenl, lenn)> L
    cdef ndarray<short, (lenl*lenM, lenn)> R
    cdef bint done_something = 0
    for i from 0 <= i < lenM:
        for j from 0 <= j < lenn:
            W{i,j} = g.M[i][j]
    for i from 0 <= i < lenl:
        for j from 0 <= j < lenn:
            L{i,j} = g.losers[i][j]
    for i from 0 <= i < lenM:
        for j from 0 <= j < lenl:
            for k from 0 <= k < lenn:
                R{i*lenl + j, k} = W{i,k} - L{j,k}
    for i from 0 <= i < lenM*lenl:
        for j from i <= j < lenM*lenl:
            found_m1 = -2
            for k from 0 <= k < lenn:
                res =  R{i,k} + R{j,k}
                if res != 0:
                    if res == -1 and found_m1 < 0:
                        found_m1 = k
                    elif res == 1 and found_m1 == k-1:
                        continue
                    else:
                        break
            else:
                wset = set()
                lset = set()
                wset.add(g.rows[i / lenl])
                wset.add(g.rows[j / lenl])
                lset.add(g.loserlist[i % lenl])
                lset.add(g.loserlist[j % lenl])
                evil_list.add((frozenset(wset), frozenset(lset)))
                return False
    return True



_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to