Re: [Csnd] CSound crashing python!
Date | 2012-07-11 08:51 |
From | Victor Lazzarini |
Subject | Re: [Csnd] CSound crashing python! |
Well, maybe because it is a bundle, the undefined references are supplied in the python interpreter. This is how Pd plugins work, they do not link to Pd, but get the references resolved on loading. What I am surprised about is to see that you could build the module without linking to Python. Did you use -undefined supress? If that works, then only one module is needed, which would work with any installation. Victor Victor Lazzarini Steven Yi <stevenyi@gmail.com> wrote: I've updated the zip: http://www.kunstmusik.com/csound_python_module.zip I think it is now linked up and working. The interesting thing is that I tried removing the linking to Python altogether for the module and it seemed to load just fine. I tried: sudo python2.5 setup.py install and then ran a test in the python shell with 2.5 and that ran. I'm getting confused how it's working. :P Anyways, I guess running things there would give good info on how to proceed. On Wed, Jul 11, 2012 at 12:08 AM, Steven Yi <stevenyi@gmail.com> wrote: > Oh, one note, I'm on Mac 10.7. Another note, I just realized my > PYTHONPATH was pointing to my work build directory so it was > overriding the regular path. I see one issue on load that looks like > a linking issue. Looking to fix that now, will reply when that's > fixed! > > On Wed, Jul 11, 2012 at 12:06 AM, Steven Yi <stevenyi@gmail.com> wrote: >> Hi Anthony, >> >> I think I got a module working. Could you try this out: >> >> http://www.kunstmusik.com/csound_python_module.zip >> >> It has a setup.py, plus a pre-generated python_interface_wrap.cc file >> (same as what I used for the 5.17.12 release). You should be able to >> run: >> >> sudo python setup.py install >> >> and it should build the module. The one thing I don't know about is >> if it will pick up the python headers from the system (apple) or from >> your python.org version. I want to assume the latter, meaning it >> would use the one associated with the version of python being run, but >> I don't know. Getting your help on this would be great. :) >> >> If this works for you, I will put together an egg for easy_install and >> perhaps we could publish it somewhere. >> >> Note: This is for the csnd module only, and does not do CsoundAC. If >> this works, we can figure out the script to use for that. >> >> Thanks! >> steven >> >> On Tue, Jul 10, 2012 at 4:58 PM, Steven Yi <stevenyi@gmail.com> wrote: >>> Well, I started to look into it, but it's yet another thing to spend >>> time learning. :P Just got back from my trip and have some catching >>> up to do; I'll try out some things today but I don't know how long >>> this will take. I'll reply here if I have something testable. Also, >>> if anyone else wants to take a stab, please do by all means. :D >>> >>> Thanks! >>> steven >>> >>> On Tue, Jul 10, 2012 at 4:36 PM, Anthony Palomba <apalomba@austin.rr.com> wrote: >>>> Hey Stephen, >>>> >>>> That sounds great! Having the freedom to install python csound in >>>> my preferred python instillation of choice really greatly expands its >>>> usability. >>>> On windows you don't have this problem because there is only one >>>> instillation of python at any time. >>>> >>>> Do you have an idea as to when a setup.py and egg could be created >>>> so that we could try it? >>>> >>>> >>>> >>>> >>>> Thanks, >>>> Anthony >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Sat, Jul 7, 2012 at 6:47 PM, Steven Yi <stevenyi@gmail.com> wrote: >>>>> >>>>> Hi All, >>>>> >>>>> Still in Rome, will be back Tuesday and will start catching up on things. >>>>> >>>>> The 10.7 installer is using the same code as the one for 10.5/10.6. >>>>> It's all in the postinstall script in >>>>> csound/installer/macosx/PkgResources/CsoundLib64. >>>>> >>>>> As far as I understand, the issue is not one of installation but for >>>>> compile time. When I compile (or anyone really), I am building it >>>>> linking to Apple's python. Obviously, I can't build it and link to >>>>> multiple versions of python, so it's lowest common denominator for >>>>> release at the moment. Some solutions I see are to compile it >>>>> multiple times or compile at install time. >>>>> >>>>> Perhaps though we should just install it/distribute it separately. We >>>>> could just keep the current installer as-is as it will work by default >>>>> for all OSX users who do not install python from python.org. A new >>>>> setup.py and egg could be created that would build the _csnd.so from >>>>> source, and link the Csound installed into >>>>> /Library/Frameworks/CsoundLib64.framework. (So installing the Csound >>>>> installer would be a requirement). The setup.py could come with the >>>>> swig-generated source code for csnd.py and C code. With an egg, users >>>>> should be able to then run easy_install to install it from a URL or >>>>> download and install. Sound good? >>>>> >>>>> steven >>>>> >>>>> >>>>> On Sat, Jul 7, 2012 at 11:20 PM, Anthony Palomba <apalomba@austin.rr.com> >>>>> wrote: >>>>> > I agree! If all I wanted to do is manipulate score events and write .csd >>>>> > files from python then I guess I would be good with Apple python. But to >>>>> > be >>>>> > honest >>>>> > with you, that "excellent integration" is pretty simple stuff, no >>>>> > offense. >>>>> > >>>>> > I certainly want to leverage all the amazing work that colleges in the >>>>> > python community have created. Things like music21 or scipy. I am not >>>>> > interested in reinventing those massive wheels. So why would I want to >>>>> > work in such a limited environment such as Apple's python? >>>>> > >>>>> > Windows users may have complained about the extra installer. I certainly >>>>> > would not complain if there were such an installer for the mac. It would >>>>> > make OSX python csound something actually useful. >>>>> > >>>>> > >>>>> > >>>>> > Anthony >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > On Sat, Jul 7, 2012 at 3:48 PM, DavidW <vip@avatar.com.au> wrote: >>>>> >> >>>>> >> I do understand your wish not to burden users etc. >>>>> >> The people I talk to, to whom I'm referring, have an enormous amount of >>>>> >> time invested in python. 3rd party inclusions etc, and the idea that >>>>> >> they >>>>> >> would change their whole orientation in order to accommodate a sound >>>>> >> synthesiser, simply doesn't work for them. >>>>> >> >>>>> >> Victor, I know how excellent is the integration w. some (whatever) >>>>> >> version >>>>> >> of python is your target - I've used it extensively in the past. >>>>> >> However, by targeting a particular python, version of OSX etc. the >>>>> >> csound >>>>> >> user base is restricted. >>>>> >> >>>>> >> I'm not having a go at you - Don't shoot me - I'm just the messenger! >>>>> >> :-) >>>>> >> >>>>> >> David >>>>> >> >>>>> >> On 08/07/2012, at 6:26 AM, Victor Lazzarini wrote: >>>>> >> >>>>> >> I am not sure why you are saying this. Up until 5.15, I was supplying >>>>> >> pre-built modules for MacPython because Apple's python version was very >>>>> >> out >>>>> >> of date. But since we overhauled our installer creation script, we >>>>> >> opted to >>>>> >> move to Apple Python so users would not need to be burdened with extra >>>>> >> installers (did you not hear the complaints regarding these >>>>> >> requirements on >>>>> >> Windows). >>>>> >> >>>>> >> So I am not sure why you are saying this. Csound has actually an >>>>> >> excellent >>>>> >> integration with Python, so you should be actually encouraging >>>>> >> solutions as >>>>> >> to how better package it, rather >>>>> >> than 'not recommending it'. >>>>> >> >>>>> >> Victor >>>>> >> >>>>> >> >>>>> >> On 7 Jul 2012, at 21:06, DavidW wrote: >>>>> >> >>>>> >> >>>>> >> On 08/07/2012, at 2:27 AM, Victor Lazzarini wrote: >>>>> >> ... >>>>> >> >>>>> >> So it is not an easy one to do. Maybe we can provide a separate package >>>>> >> for users to install containing a Python module for the MacPython >>>>> >> installation. >>>>> >> I'll think about it. >>>>> >> >>>>> >> Victor >>>>> >> >>>>> >> >>>>> >> Talk about deja vu! >>>>> >> >>>>> >> Given that anyone seriously using python on the mac uses the >>>>> >> python.org. >>>>> >> version for the reasons Anthony oullined later (up-to-dateness etc etc) >>>>> >> I >>>>> >> think it is a pain in the proverbial for csound to be locked into >>>>> >> Apple's >>>>> >> idea of what python is. >>>>> >> >>>>> >> Enough to make one use another sound synthesiser when needing to deal >>>>> >> with >>>>> >> the rest of the world, really. >>>>> >> >>>>> >> Seriously, it is the one reason I do not recommend csound except with >>>>> >> heavy qualifications. >>>>> >> >>>>> >> David >>>>> >> >>>>> >> _____________________________________________ >>>>> >> Dr David Worrall >>>>> >> Experimental Composer, Polymedia >>>>> >> Adjunct Research Fellow, Australian National University >>>>> >> David.Worrall@anu.edu.au >>>>> >> Board Member, International Community for Auditory Display >>>>> >> Regional Editor, Organised Sound (CUP) >>>>> >> IT Projects, Music Council of Australia >>>>> >> worrall.avatar.com.au sonification.com.au >>>>> >> >>>>> >> T : +61 (0)2 61.61.95.22 M: +61 (0)4.02.28.36.90 >>>>> >> >>>>> >> >>>>> >> >>>>> >> >>>>> >> Dr Victor Lazzarini >>>>> >> Senior Lecturer >>>>> >> Dept. of Music >>>>> >> NUI Maynooth Ireland >>>>> >> tel.: +353 1 708 3545 >>>>> >> Victor dot Lazzarini AT nuim dot ie >>>>> >> >>>>> >> >>>>> > >>>>> >>>>> >>>>> Send bugs reports to the Sourceforge bug tracker >>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599 >>>>> Discussions of bugs and features can be posted here >>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe >>>>> csound" >>>>> >>>> Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2012-07-11 13:18 |
From | Steven Yi |
Subject | Re: [Csnd] CSound crashing python! |
Hi Victor, Yes, I was surprised too. :) I didn't specifically set anything, just used the Extension module from distutils and it built using "-undefined dynamic_lookup". I pasted the build output from running "python setup.py build" below: llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/Library/Frameworks/CsoundLib64.framework/Headers -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c python_interface_wrap.cc -o build/temp.macosx-10.7-intel-2.7/python_interface_wrap.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ llvm-g++-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch x86_64 build/temp.macosx-10.7-intel-2.7/python_interface_wrap.o -L/Library/Frameworks/CsoundLib64.framework -L/Library/Frameworks/CsoundLib64.framework/Versions/5.2 -L/usr/local/lib -l_csnd -lsndfile.1 -o build/lib.macosx-10.7-intel-2.7/_csnd.so Perhaps we should modify python module building (and other interfaces) if this is all working fine. If feedback is that this works, we could also modify the postinstall script to look for python.org installs and create symlinks there too. steven On Wed, Jul 11, 2012 at 3:51 AM, Victor Lazzarini |