Re: [Cs-dev] csoundVST on OSX
Date | 2005-10-26 23:05 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] csoundVST on OSX |
Setting the environment variable lets the interpreter find the CsoundVST module. However, as I predicted, it can't load it because it's a dylib not a bundle. I'm not sure now that building it as a bundle will then affect CsoundVST itself, because it might be expecting a dylib. I'll try it tomorrow. Compiling it and building it was surprisingly simple, as I only had the gcvt error. Something is wrong with the java wrappers csoundVST interface though. The SWIG generated file throws a multitude of errors. Another funny thing is that although I have boost in the right place (/usr/local/include), scons is not finding it (I had to bypass it for compilation). Victor > > Did you define an environment variable PYTHONPATH pointing > to the directory where CsoundVST shared library is? Not > doing this seems the likeliest explanation. > > You can try running the Python command interpreter, then > trying to "import CsoundVST". You can "import sys" and > "sys.path.append('whatever directory I think CsoundVST is > in')" and then "import CsoundVST". This may be more > informative than just trying to run the program. > > CsoundVST creates CSOUND * _in Python_ and retrieves > CSOUND * _from Python_ so that it can run the same > instance of Csound both from its own C++ code and from the > user's Python code, install message callbacks so Csound > messages go to the Python message output and from that to > the edit box in the GUI, etc., hence the need to "import > CsoundVST" before running. > > Thanks for trying this out on OS X, I know there are at > least a few potential users for this on OS X. > > Regards, > Mike > > > -----Original Message----- > From: Victor Lazzarini |
Date | 2005-10-27 09:34 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] csoundVST on OSX |
I did some more tests and this is what I got: 1. I had to build two separate libs: _CsoundVST.dylib (dynamic library for CsoundVST linking) and _CsoundVST.so (bundle for python import) 2. Java Wrappers compilation for CsoundVST is a mess, but I reckon that it might be caused by a header that was not found. 3. When running (with PYTHONPATH set), CsoundVST seems to call csoundInitialize() [I see the csound init message on stdout], and then imports _CsoundVST module, which is OK, but then this seems to call csoundInitialize() again, and then it crashes. 4. When running python and then importing _CsoundVST all seems to be normal (although I did not try any csound API calls, but I suppose it should work as the _csnd module). What do you reckon? Do you think the problems of item 3 have to do with using two separate dynamic modules? Well, if that's the case, forget CsoundVST on OSX, it will not work, because it will always require two libs, since you cannot link to a bundle, and a python module has to be a bundle. Victor At 23:05 26/10/2005, you wrote: >Setting the environment variable lets the interpreter find >the CsoundVST module. However, as I predicted, it can't >load it because it's a dylib not a bundle. I'm not sure now >that building it as a bundle will then affect CsoundVST >itself, because it might be expecting a dylib. I'll try it >tomorrow. > >Compiling it and building it was surprisingly simple, as >I only had the gcvt error. Something is wrong with the >java wrappers csoundVST interface though. The SWIG >generated file throws a multitude of errors. > >Another funny thing is that although I have boost in the >right place (/usr/local/include), scons is not finding it >(I had to bypass it for compilation). > >Victor > > > > > Did you define an environment variable PYTHONPATH pointing > > to the directory where CsoundVST shared library is? Not > > doing this seems the likeliest explanation. > > > > You can try running the Python command interpreter, then > > trying to "import CsoundVST". You can "import sys" and > > "sys.path.append('whatever directory I think CsoundVST is > > in')" and then "import CsoundVST". This may be more > > informative than just trying to run the program. > > > > CsoundVST creates CSOUND * _in Python_ and retrieves > > CSOUND * _from Python_ so that it can run the same > > instance of Csound both from its own C++ code and from the > > user's Python code, install message callbacks so Csound > > messages go to the Python message output and from that to > > the edit box in the GUI, etc., hence the need to "import > > CsoundVST" before running. > > > > Thanks for trying this out on OS X, I know there are at > > least a few potential users for this on OS X. > > > > Regards, > > Mike > > > > > > -----Original Message----- > > From: Victor Lazzarini |
Date | 2005-10-27 12:45 |
From | Istvan Varga |
Subject | Re: [Cs-dev] csoundVST on OSX |
Victor Lazzarini wrote: > 3. When running (with PYTHONPATH set), CsoundVST seems to > call csoundInitialize() [I see the csound init message on stdout], > and then imports _CsoundVST module, which is OK, but then > this seems to call csoundInitialize() again, and then it crashes. Do you mean you see the messages of csoundInitialize(), that is, the one about localization and the other about time resolution, printed twice ? That should not happen, because csoundInitialize() is implemented in a way that only the first call has any effect (note that csoundCreate() implies calling this function with the default parameters if it was not already done); you can verify that by loading the csnd module from the Python interpreter: call csoundInitialize() repeatedly, and you should see that the messages are printed only once. Having the start-up messages twice suggests that two separate copies of Csound are loaded into memory, probably one from the bundle and another from the dylib. By the way, is it possible to link the bundle against a csound.dylib (or whatever the equivalent of libcsound.so is on the Mac), by building with dynamicCsoundLibrary=1 ? Perhaps this may allow for avoiding the redundant copies of Csound in memory. ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-10-27 14:12 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] csoundVST on OSX |
This might be possible. I have to try it. Yes there seems to be two instances in memory. I'll have a look. Victor At 12:45 27/10/2005, you wrote: >By the way, is it possible to link the bundle against a csound.dylib >(or whatever the equivalent of libcsound.so is on the Mac), by >building with dynamicCsoundLibrary=1 ? Perhaps this may allow for >avoiding the redundant copies of Csound in memory. Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-10-27 14:50 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] csoundVST on OSX |
It links, but because init_CsoundVST is in _CsoundVST.dylib, not _CsoundVST.so, python can't find the entry, somehow. I thought all symbols in _CsoundVST.dylib would be accessible from _CsoundVST.so. Perhaps the solution would be to provide the entry point in a separate source file compile it into _CsoundVST.so, which would then call the real entry point in the dylib it is linked against. Seems very complicated, perhaps there is a better solution. Victor At 14:12 27/10/2005, you wrote: >This might be possible. I have to try it. Yes there seems to be two >instances in memory. I'll have a look. > >Victor >At 12:45 27/10/2005, you wrote: >>By the way, is it possible to link the bundle against a csound.dylib >>(or whatever the equivalent of libcsound.so is on the Mac), by >>building with dynamicCsoundLibrary=1 ? Perhaps this may allow for >>avoiding the redundant copies of Csound in memory. > >Victor Lazzarini >Music Technology Laboratory >Music Department >National University of Ireland, Maynooth > > >------------------------------------------------------- >This SF.Net email is sponsored by the JBoss Inc. >Get Certified Today * Register for a JBoss Training Course >Free Certification Exam for All Training Attendees Through End of 2005 >Visit http://www.jboss.com/services/certification for more information >_______________________________________________ >Csound-devel mailing list >Csound-devel@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/csound-devel Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-10-27 15:16 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] csoundVST on OSX |
I figured that it might be possible to link the SWIG file to the bundle instead of the dylib, since there are no init_CsoundVST calls in the main c++ app. I did this and it links OK, seems to load the python module and then it crashes. When running form python and importing _CsoundVST, the python interpreter seems to enter an infinite loop. I reckon this demonstrates that linking the bundle with the dylib is probably not working. I also reckon that the current structure of CsoundVST does not allow it to be built on OSX. Victor At 14:50 27/10/2005, you wrote: >It links, but because init_CsoundVST is in _CsoundVST.dylib, >not _CsoundVST.so, python can't find the entry, somehow. >I thought all symbols in _CsoundVST.dylib would be accessible >from _CsoundVST.so. Perhaps the solution would be to provide >the entry point in a separate source file compile it into _CsoundVST.so, >which would then call the real entry point in the dylib it is linked >against. Seems very complicated, perhaps there is a better solution. > >Victor > >At 14:12 27/10/2005, you wrote: >>This might be possible. I have to try it. Yes there seems to be two >>instances in memory. I'll have a look. >> >>Victor >>At 12:45 27/10/2005, you wrote: >>>By the way, is it possible to link the bundle against a csound.dylib >>>(or whatever the equivalent of libcsound.so is on the Mac), by >>>building with dynamicCsoundLibrary=1 ? Perhaps this may allow for >>>avoiding the redundant copies of Csound in memory. >> >>Victor Lazzarini >>Music Technology Laboratory >>Music Department >>National University of Ireland, Maynooth >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by the JBoss Inc. >>Get Certified Today * Register for a JBoss Training Course >>Free Certification Exam for All Training Attendees Through End of 2005 >>Visit http://www.jboss.com/services/certification for more information >>_______________________________________________ >>Csound-devel mailing list >>Csound-devel@lists.sourceforge.net >>https://lists.sourceforge.net/lists/listinfo/csound-devel > >Victor Lazzarini >Music Technology Laboratory >Music Department >National University of Ireland, Maynooth > > >------------------------------------------------------- >This SF.Net email is sponsored by the JBoss Inc. >Get Certified Today * Register for a JBoss Training Course >Free Certification Exam for All Training Attendees Through End of 2005 >Visit http://www.jboss.com/services/certification for more information >_______________________________________________ >Csound-devel mailing list >Csound-devel@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/csound-devel Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-10-27 16:05 |
From | Anthony Kozar |
Subject | Re: [Cs-dev] csoundVST on OSX |
I seem to recall reading a long time ago on the Scons mailing list that there is a special Scons tool for linking bundles and that using the standard link tool may not work. Are you using this? Anthony Victor Lazzarini wrote on 10/27/05 4:34 AM: > What do you reckon? Do you think the problems of item 3 > have to do with using two separate dynamic modules? Well, > if that's the case, forget CsoundVST on OSX, it will not work, > because it will always require two libs, since you cannot > link to a bundle, and a python module has to be a bundle. ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-10-27 16:24 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] csoundVST on OSX |
No, the problem with scons and bundles is that if you ask foir the SharedLibrary builder, it produces a dylib, sticking -dynamiclib automatically, and we need -bundle instead. So I used the Program builder with the extra link flag -bundle. This produces a bundle alright (that's in fact how _csnd.so is built). Victor At 16:05 27/10/2005, you wrote: >I seem to recall reading a long time ago on the Scons mailing list that >there is a special Scons tool for linking bundles and that using the >standard link tool may not work. > >Are you using this? > >Anthony > > >Victor Lazzarini wrote on 10/27/05 4:34 AM: > > > What do you reckon? Do you think the problems of item 3 > > have to do with using two separate dynamic modules? Well, > > if that's the case, forget CsoundVST on OSX, it will not work, > > because it will always require two libs, since you cannot > > link to a bundle, and a python module has to be a bundle. > > > >------------------------------------------------------- >This SF.Net email is sponsored by the JBoss Inc. >Get Certified Today * Register for a JBoss Training Course >Free Certification Exam for All Training Attendees Through End of 2005 >Visit http://www.jboss.com/services/certification for more information >_______________________________________________ >Csound-devel mailing list >Csound-devel@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/csound-devel Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |