S4
S4 copied to clipboard
Python Extension ImportError on latest commit
Everything compiles fine on the latest commit. However, when attempting to import the installed python module from a python 2.7 interpreter yields:
ImportError: /usr/local/lib/python2.7/dist-packages/S4.so: undefined symbol: Simulation_MakeExcitationExterior
This seems to be defined in S4_internal.h, and looks like a new C API feature in the latest commit. So perhaps this has not yet been added to the python extension?
Hitting the exact same error on the most recent commit as well.
I think it has to do with the transition to the new C API. The maintainer of this repository maintains the Lua and R extensions, and I guess some people at MIT maintain the Python extension. I'm going to poke around in S4/main_python.c and see if I can find the problem. Let me know if you have any luck, because it would be great if I didn't have to switch to the Lua interface.
It looks like the functions it's missing live in the S4_internal.h file, which should be included in S4.h, which main_python.c includes. Not clear where the hang up is, but I'm not adept with c (that's why I'm so keen on getting the python bindings working).
This fork has worked for me in the past. You might have better luck using that one.
That seems to work! I did have to add the block below to gensetup.py.sh, but now I've got a working S4 python module.
extra_compile_args = [ '-std=gnu99' ]
Yeah I had to add that argument as well. Out of curiosity, what platform are you intending to run things on? Windows? Linux? OSX? The python extension has been giving me segmentation faults lately when it tries to compute the (possibly nondiagonal) matrix for epsilon within a layer. My platform is Ubuntu Linux, and it started happening after I updated some packages. I think that may be the cause of the problem for me, so if you have luck getting things to run let me know. I would really love to have the python extension back and not have to port a bunch of my code to Lua.
The problem with this commit is that the function isn't defined, just to grep -r Simulation_MakeExcitationExterior * in the main folder. Even if it would be, there are more problems. The next one after MakeExcitationExterior is this /usr/local/lib/python2.7/dist-packages/S4.so: undefined symbol: Material_Init Apparently there was a renaming process which hasn't been finished.
Is there any timeline on a fix for this?
While I was able to fix the issue back in the days with soamaven's fork, I can't do so anymore, because the forks merged and I can't locate the working branch anymore. Does anyone has a clue?
I'm back to the old "undefined symbol: Simulation_MakeExcitationExterior" when making S4_pyext...
While I was able to fix the issue back in the days with soamaven's fork, I can't do so anymore, because the forks merged and I can't locate the working branch anymore. Does anyone has a clue?
I'm back to the old "undefined symbol: Simulation_MakeExcitationExterior" when making S4_pyext...
The CommonMakefile branch works OK.