compile is fine, got errors when run example ROFTV.py
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)
-
-
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?
-
OK, that's probably not the problem then. If you checkout and compile PyCA commit 7f32ae613132520bee6381af8dc2b9af97c0619a can you confirm that that works? I want to rule out any possible other changes in your system. Also that commit is before the recent set of commits by sam and I. Thanks!
-
reporter it works. Thanks.
-
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
-
reporter swig: 2.0.4 python:2.7.3 cmake:2.8.10.1 gcc:4.6.3
Thanks.
-
Hmm. Very interesting. I have a nixos install so I will try out those versions when I get a chance in a little while.
-
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.
-
OK, that's a different problem from the linking thing. Maybe @jspreston can help here. I think the problem is related to the changes in
PyCADisplay.py
from commit e02a5dc6195546c10dc6b942a5339058a4fae433 -
Hi Tian,
What's the size() of G? I may have inadvertently introduced a bug for 3D vector fields.
-Sam
-
yeah prob that
np.squeeze
is causing trouble -
reporter the size of G is Vec3D(128,128,1).
-
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.
-
reporter thanks, Sam. I rebuilt HEAD and everything works now.
-
- changed status to resolved
problem solved by clearing build dir
- Log in to comment
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
, usingnm -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.