compile is fine, got errors when run example ROFTV.py

Issue #54 resolved
Tian Cao created an issue

it used to work two weeks ago, after I update today, I got some error :

Traceback (most recent call last): File "ROFTV.py", line 1, in <module> from PyCA.Core import * File "/home/tiancao/python/cobalt/site-packages/PyCA/Core.py", line 26, in <module> _Core = swig_import_helper() File "/home/tiancao/python/cobalt/site-packages/PyCA/Core.py", line 22, in swig_import_helper _mod = imp.load_module('_Core', fp, pathname, description) ImportError: dynamic module does not define init function (init_Core)

Comments (15)

  1. Jacob Hinkle

    Hi Tian. I think I've seen this before when there are linker errors. Could you see if there are missing symbols in _Core.so, using nm -u? When I saw this, it happened because the python imp module, which swig uses, couldn't load the library due to missing symbols from ITK.

  2. Tian Cao reporter

    Hi Jacob. Thanks for your comment. I ran nm -u for _Core.so and got: w _Jv_RegisterClasses w cxa_finalize@@GLIBC_2.2.5 w __gmon_start Any idea about how solve this problem?

  3. Jacob Hinkle

    Interesting. Glad we could get it working for you, but this sounds like a legitimate bug that I'd like to figure out. When you get some time would you mind providing the versions for your install of:

    • swig
    • python
    • cmake
    • gcc

    Thanks

  4. Jacob Hinkle

    Hmm. Very interesting. I have a nixos install so I will try out those versions when I get a chance in a little while.

  5. Tian Cao reporter

    Hi Jacob, I got some new errors for GridPlot after I checkout the commit 7f32ae613132520bee6381af8dc2b9af97c0619a. My code worked before I checkout this version.

    Traceback (most recent call last): File "shootwithScaledMomentumVector.py", line 140, in <module> main(I0, mvector, outputPrefix, scaleFactor, mType) File "shootwithScaledMomentumVector.py", line 113, in main display.GridPlot(G, every=quiverEvery, color='k', isVF=True) File "/home/tiancao/python/cobalt/site-packages/PyCA/Display/PyCADisplay.py", line 64, in GridPlot plt.plot(d1+np.squeeze(sliceArr[:,:,1]), IndexError: invalid index

    Any suggestions? Thanks.

  6. Sam Preston

    Hi Tian,

    What's the size() of G? I may have inadvertently introduced a bug for 3D vector fields.

    -Sam

  7. Sam Preston

    Yes, the commit that jacob refers to has a required fix for GridPlot -- you can add in the np.squeeze() yourself, or you can try updating to that commit and see if everything still builds for you.

    Regarding your original linking problem, did you try deleting the contents of your cmake bin directory and rebuilding from scratch? There are a few major modifications since the version you have now, and some of them confuse cmake if you have a previous configuration. I have a pretty similar setup to you (swig 2.0.9, python 2.7.3, cmake 2.8.10.2, gcc 4.7.2) and can build HEAD without any problems.

  8. Log in to comment