Trouble with unit tests for _cpd C extensions

33 views
Skip to first unread message

Gordon

unread,
Jan 6, 2010, 7:32:47 PM1/6/10
to pebl-p...@googlegroups.com
Passing most tests and running small test cases but still seeing a lot of unit test failures at the end of nosetests -v pebl.test such as:

======================================================================
ERROR: pebl.test.test_cpd.TestCPD_C.test_replace2_loglikelihood
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/local/lib/python2.5/site-packages/nose/case.py", line 363, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/opt/local/lib/python2.5/site-packages/nose/util.py", line 453, in try_run
    return func()
  File "/Users/gordon/build/pebl/pebl-project-read-only/src/pebl/test/test_cpd.py", line 63, in setUp
    self.cpd = self.cpdtype(self.data)
  File "/Users/gordon/build/pebl/pebl-project-read-only/src/pebl/cpd.py", line 149, in __init__
    raise Exception("_cpd C extension module not loaded.")
Exception: _cpd C extension module not loaded.

Anyone have experience with this error?

I'm running on mac OS X 10.5.8 and python 2.5.4 and here are some relevant mac ports:

py-twisted @8.0.1_0 (active)
  py-zopeinterface @3.3.0_0 (active)
  py25-hashlib @2.5.4_0 (active)
  py25-nose @0.10.4_0 (active)
  py25-numpy @1.3.0_0 (active)
  py25-pydb @1.25_1 (active)
  py25-setuptools @0.6c9_0 (active)
  py25-simplejson @2.0.9_0 (active)
  py25-socket-ssl @2.5.4_0 (active)
  py25-zlib @2.5.4_0 (active)
  python24 @2.4.6_3+darwin_9+macosx (active)
  python25 @2.5.4_2+darwin_9+macosx (active)
  python26 @2.6.1_0 (active)
  python_select @0.2.1_0+darwin_9 (active)

Thanks,
Gordon


--
Gordon Rios -- http://www.linkedin.com/in/gordonrios
Cork Constraint Computation Centre -- http://4c.ucc.ie

Abhik

unread,
Jan 6, 2010, 8:33:20 PM1/6/10
to pebl-p...@googlegroups.com
Hi Gordon,
You're getting this error because the _cpd.c file was not compiled
to _cpd.so.. If you used 'python setup.py install' to install pebl,
there should be an install.log file that might offer clues as to why
the C extension was not compiled.

This is in my install.log, you should've seen something similar:

building 'pebl._cpd' extension
C compiler: gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
-mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall
-Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch
i386 -arch ppc -pipe

compile options:
'-I/Library/Python/2.5/site-packages/numpy-1.0.4-py2.5-macosx-10.5-ppc.egg/numpy/core/include
-I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
-c'
gcc: src/pebl/_cpd.c
gcc -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc
build/temp.macosx-10.5-ppc-2.5/src/pebl/_cpd.o -o
build/lib.macosx-10.5-ppc-2.5/pebl/_cpd.so

Thanks,
Abhik.

Gordon

unread,
Jan 7, 2010, 9:17:39 AM1/7/10
to pebl-p...@googlegroups.com
Hi Abhik,

I'm not seeing an install.log but the output from the command is pretty verbose (that's the default) and I don't see any mention of "building" ... could be that I've installed too many different versions. I'd like to start from scratch ... any hints on getting a clean uninstall?

Abhik

unread,
Jan 7, 2010, 9:39:33 PM1/7/10
to pebl-p...@googlegroups.com
Hi Gordon,
If you're uninstalling python, you can just do it the
old-fashioned way: delete the files and directories. If you're
uninstalling just pebl, you can simply remove the .egg directory for
pebl and edit the easy-install.pth file (both are in
lib/python2.x/site-packages). Make sure you don't uninstall Mac OSX's
framework build of python!

I like using virtualenv to create separate python sandboxes for each
project. That way I can always return to a clean slate by just
creating a new environment.

Hope that helps,
Abhik.

Reply all
Reply to author
Forward
0 new messages