Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] csoundVST on OSX

Date2005-10-26 23:05
FromVictor Lazzarini
SubjectRe: [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 
> Sent: Oct 26, 2005 1:51 PM
> To: csound-devel@lists.sourceforge.net
> Subject: [Cs-dev] csoundVST on OSX
>
> I have tried to build csoundVST on OSX; after fixing
> the gcvt issue in one of the sources, it seemed to
> build OK, except for the Java wrappers, the
> JCsound_wrap.cc throws thousands of errors, so I am not
> sure what the problem
> is there.
>
> Now when I try to run it I get problems. This is the
> stdin message output. Perhaps Michael can tell what
> the problem is.
>
> NB: I know, for a start, that there might be a major issue
> regarding dynamic linking. Python requires their modules
> to be bundles, _CsoundVST.dylib is a dynamic lib; but
> CsoundVST in turn might (?) expect it to be a dynamic lib,
> so the same lib might not serve for both ends.
>
>
> Starting CsoundVST...
> Localisation of messages is disabled, using default
> language.
> time resolution is 1000.000 ns
> BEGAN Shell::runScript()...
> =====================================================
==
> =====================================================
==
> =====================================================
==
> =====================================================
==
> PyRun_SimpleString returned 0.
> ENDED Shell::runScript().
> BEGAN Shell::runScript()...
> =====================================================
==
> =====================================================
==
> Traceback (most recent call last):
>   File "", line 1, in ?
> ImportError: No module named CsoundVST
> =====================================================
==
> =====================================================
==
> PyRun_SimpleString returned -1.
> ENDED Shell::runScript().
> BEGAN Shell::runScript()...
> =====================================================
==
> =====================================================
==
> AttributeError: 'module' object has no attribute 'csound'
> =====================================================
==
> =====================================================
==
> PyRun_SimpleString returned -1.
> ENDED Shell::runScript().
> Csound tidy up: Segmentation fault
>
>
> -------------------------------------------------------
> 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
>
>
>
>
>
> -------------------------------------------------------
> 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


-------------------------------------------------------
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

Date2005-10-27 09:34
FromVictor Lazzarini
SubjectRe: [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 
> > Sent: Oct 26, 2005 1:51 PM
> > To: csound-devel@lists.sourceforge.net
> > Subject: [Cs-dev] csoundVST on OSX
> >
> > I have tried to build csoundVST on OSX; after fixing
> > the gcvt issue in one of the sources, it seemed to
> > build OK, except for the Java wrappers, the
> > JCsound_wrap.cc throws thousands of errors, so I am not
> > sure what the problem
> > is there.
> >
> > Now when I try to run it I get problems. This is the
> > stdin message output. Perhaps Michael can tell what
> > the problem is.
> >
> > NB: I know, for a start, that there might be a major issue
> > regarding dynamic linking. Python requires their modules
> > to be bundles, _CsoundVST.dylib is a dynamic lib; but
> > CsoundVST in turn might (?) expect it to be a dynamic lib,
> > so the same lib might not serve for both ends.
> >
> >
> > Starting CsoundVST...
> > Localisation of messages is disabled, using default
> > language.
> > time resolution is 1000.000 ns
> > BEGAN Shell::runScript()...
> > =====================================================
>==
> > =====================================================
>==
> > =====================================================
>==
> > =====================================================
>==
> > PyRun_SimpleString returned 0.
> > ENDED Shell::runScript().
> > BEGAN Shell::runScript()...
> > =====================================================
>==
> > =====================================================
>==
> > Traceback (most recent call last):
> >   File "", line 1, in ?
> > ImportError: No module named CsoundVST
> > =====================================================
>==
> > =====================================================
>==
> > PyRun_SimpleString returned -1.
> > ENDED Shell::runScript().
> > BEGAN Shell::runScript()...
> > =====================================================
>==
> > =====================================================
>==
> > AttributeError: 'module' object has no attribute 'csound'
> > =====================================================
>==
> > =====================================================
>==
> > PyRun_SimpleString returned -1.
> > ENDED Shell::runScript().
> > Csound tidy up: Segmentation fault
> >
> >
> > -------------------------------------------------------
> > 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
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > 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
>
>
>-------------------------------------------------------
>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

Date2005-10-27 12:45
FromIstvan Varga
SubjectRe: [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

Date2005-10-27 14:12
FromVictor Lazzarini
SubjectRe: [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

Date2005-10-27 14:50
FromVictor Lazzarini
SubjectRe: [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

Date2005-10-27 15:16
FromVictor Lazzarini
SubjectRe: [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

Date2005-10-27 16:05
FromAnthony Kozar
SubjectRe: [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

Date2005-10-27 16:24
FromVictor Lazzarini
SubjectRe: [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