Open AndrewAnnex opened 10 years ago
Sorry, at least I don't have resources to check on Python3. As long as my favorite distribution does not release in Python3 I have to stay with Python2 because I don't have the time to compile all modules I need on my own.
The Expected in: flat namespace
line sparks vague memories related to 32/64-bit fat binaries on OS X. This may not be much of a lead, but maybe see what you can dig up with respect to the Python3 you are using and whether you are compiling the module for more architectures than Python is built for.
Yes I remember seeing some things relating to this but the fixes don't look easy/ are not well documented. I may have to reconfigure my mac a lot. If anyone is willing to try installing my fork on a correctly configured computer please do so. I won't really be able to do anything until late December (I am an undergraduate, final exams and such..).
I found this page where people discussed this issue: http://stackoverflow.com/questions/1929180/python-config-ldflags-on-mac
So I think I resolved whatever issues existed on my Mac in regards to linking during compilation (although I broke ipython, grumble). I started getting clearer error messages during compilation and finally discovered today that there were some significant differences in the C API's for Python 2.X and 3.X. For example in P3K, PyInt and PyString don't exist apparently (you use PyLong and PyUnicode or PyBytes in p3k). I went through and made a first naive attempt of fixing these issues by replacing code where needed and modifying the init_spice function generated by mkwrapper.py. I have successfully been able to compile and install my fork, and some simple functions work! Some of the tests from drbitboy's fork are successful, some seg-fault and some crash entirely. So clearly I will need to do more testing to work the wrapper into shape.
That's great progress; nice job!
On Wednesday, December 4, 2013, Apollo117 wrote:
So I think I resolved whatever issues existed on my Mac in regards to linking during compilation (although I broke ipython, grumble). I started getting clearer error messages during compilation and finally discovered today that there were some significant differences in the C API's for Python 2.X and 3.X. For example in P3K, PyInt and PyString don't exist apparently (you use PyLong and PyUnicode or PyBytes in p3k). I went through and made a first naive attempt of fixing these issues by replacing code where needed and modifying the init_spice function generated by mkwrapper.py. I have successfully been able to compile and install my fork, and some simple functions work! Some of the tests from drbitboy's fork are successful, some seg-fault and some crash entirely. So clearly I will need to do more testing to work the wrapper into shape.
— Reply to this email directly or view it on GitHubhttps://github.com/rca/PySPICE/issues/13#issuecomment-29869095 .
So I am trying to use PySpice in Python 3, I made a new Fork from drbitboy's most recent work and I have made all of the necessary changes to all of the python files (except for any changes to mkwrapper.py, see below). As of now I have it successfully compiling and installing the library on OSX 10.9 (with python 3.3.1) , but if I try to import spice you can see the attached image: I also tried installing it on a 32bit ubuntu 12.04 LTS VM, with Python 3.2 and got a similar error (except with pystring_fromstringandsize) and a couple of warnings during compiling.
I have never used the Python API, so I am not sure what exactly has changed between python 2 and 3. Any chance that this could be looked into? I will of course continue to try things, but I would appreciate some assistance or suggestions of what to look at.