Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Python API questions time

Date2008-05-11 15:32
Fromvictor
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Python API questions time
Well, there you go, that's your problem...
----- Original Message ----- 
From: "Chuckk Hubbard" 
To: 
Sent: Sunday, May 11, 2008 12:01 PM
Subject: [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Python API questions time


> It isn't.
>
> On Sun, May 11, 2008 at 1:52 PM, victor  wrote:
>> See if _csnd.so is linked to libcsnd.so.5.1, use ldd
>>
>>  ldd _csnd.so
>>
>>
>>  Victor
>>  ----- Original Message ----- From: "Chuckk Hubbard"
>> 
>>  To: 
>>  Sent: Sunday, May 11, 2008 11:04 AM
>>  Subject: [Csnd] Re: Re: Re: Re: Re: Re: Python API questions time
>>
>>
>>
>>
>>
>> > On Sat, May 10, 2008 at 10:07 PM, victor  
>> > wrote:
>> >
>> > > and there is no other libcsound.so in your system?
>> > >
>> >
>> > Nope, I just searched, all new.  I tried creating symbolic links of
>> > libcsound.so to libcsound.so.5.1 in all places it is found, too.  Also
>> > tried deleting all these links.
>> >
>> > I sudo copied libcsound.so.5.1 from the build directory to
>> > /usr/local/lib and /usr/local/csh/lib, to make sure it's the new one,
>> > and then _csnd.so to /usr/lib/python2.4/site-packages/.
>> >
>> > _ZN17CsoundUtilityList5CountEv
>> >
>> > shows up in nm libcsnd.so.5.1, in the line:
>> >
>> > 0000000000044100 T _ZN17CsoundUtilityList5CountEv
>> >
>> > I tried both import csnd and from csnd import *.
>> >
>> > By the way, my new microtonal sequencer is coming along nicely,
>> > finally, and I'm finding Python/Tkinter to be perfect for the task.
>> > Thanks for recommending Python, it's delightful.
>> >
>> > -Chuckk
>> >
>> >
>> > >
>> > >  CsoundUtilityList is in interfaces/cs_glue.cpp which ends
>> > >  up in libcsnd.so
>> > >
>> > >  You can check with
>> > >
>> > >  nm libcsnd.dll.5.1 > symbols.txt
>> > >
>> > >  and then check for __ZN17CsoundUtilityList5CountEv
>> > >
>> > >  If it's not there, somehow cs_glue.cpp did not get compiled /
>> > >  or linked to libcsnd.
>> > >
>> > >
>> > >  Victor
>> > >
>> > >  ----- Original Message ----- From: "Chuckk Hubbard"
>> > > 
>> > >  To: 
>> > >  Sent: Saturday, May 10, 2008 6:55 PM
>> > >  Subject: [Csnd] Re: Re: Re: Re: Python API questions time
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > > ok thanks.
>> > > > Making my way through the previous questions, uninstalled,
>> > > > re-untarred, and rebuilt Csound, no luck.
>> > > > old libcsnd.so.5.1 gone, replaced by recompiled version.
>> > > >
>> > > > On Sat, May 10, 2008 at 7:37 PM, victor  
>> > > >  >
>> wrote:
>> > > >
>> > > > > incompatible libcsnd.so.5.1
>> > > > > ----- Original Message ----- From: "Chuckk Hubbard"
>> > > > > 
>> > > > > To: 
>> > > > > Sent: Saturday, May 10, 2008 5:20 PM
>> > > > > Subject: [Csnd] Re: Re: Python API questions time
>> > > > >
>> > > > >
>> > > > >
>> > > > > > import csnd
>> > > > > > .....
>> > > > > > ImportError: ./_csnd.so: undefined symbol:
>> > > _ZN17CsoundUtilityList5CountEnv
>> > > > > >
>> > > > > > Any ideas?
>> > > > > > -Chuckk
>> > > > > >
>> > > > > > On Sat, May 10, 2008 at 5:12 PM, Chuckk Hubbard
>> > > > > >  wrote:
>> > > > > >
>> > > > > > >
>> > > > > > > Ah, I see, looking through SConstruct; is that the > > > >
>> 'buildInterfaces'
>> > > > > > > option?
>> > > > > > >
>> > > > > > > -Chuckk
>> > > > > > >
>> > > > > > > On Sat, May 10, 2008 at 3:53 PM, victor > > > >
>> 
>> > > wrote:
>> > > > > > >
>> > > > > > > >
>> > > > > > > > Looks like you have not built it. You'll need the python > 
>> > > > > > > >  > >
>> > > headers
>> > > and
>> > > > > > > > swig to build it.
>> > > > > > > >
>> > > > > > > > Victor
>> > > > > > > > ----- Original Message ----- From: "Chuckk Hubbard"
>> > > > > > > > 
>> > > > > > > > To: "Csound List" 
>> > > > > > > > Sent: Saturday, May 10, 2008 1:06 PM
>> > > > > > > > Subject: [Csnd] Python API questions time
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > > Hello.
>> > > > > > > > > I've located csnd.py and relocated it appropriately, but 
>> > > > > > > > > now
>> > > > > > > I
>> > > get an
>> > > > > > > > > Import Error: No module named _csnd.  I've searched all 
>> > > > > > > > > over
>> > > > > > > my
>> > > hard
>> > > > > > > > > drive, and I have no file with the string "_csnd" in the
>> > > filename.
>> > > > > > > > > I compiled Csound, and I have 5.08 Beta Mar 1 2008.  I'm 
>> > > > > > > > >  > >
>> > > > > running
>> > > 64-bit
>> > > > > > > > > Linux.
>> > > > > > > > > Can anyone point me in the direction of this _csnd 
>> > > > > > > > > module?
>> > > > > > > > >
>> > > > > > > > > -Chuckk
>> > > > > > > > >
>> > > > > > > > > --
>> > > > > > > > > http://www.badmuthahubbard.com
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > Send bugs reports to this list.
>> > > > > > > > > To unsubscribe, send email sympa@lists.bath.ac.uk with 
>> > > > > > > > > body
>> > > > > > > > > "unsubscribe
>> > > > > > > > > csound"
>> > > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > Send bugs reports to this list.
>> > > > > > > > To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> > > "unsubscribe
>> > > > > > > > csound"
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > > --
>> > > > > > > http://www.badmuthahubbard.com
>> > > > > > >
>> > > > > > >
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > > > --
>> > > > > > http://www.badmuthahubbard.com
>> > > > > >
>> > > > > >
>> > > > > > Send bugs reports to this list.
>> > > > > > To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> > > "unsubscribe
>> > > > > > csound"
>> > > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > Send bugs reports to this list.
>> > > > > To unsubscribe, send email sympa@lists.bath.ac.uk with body > >
>> "unsubscribe
>> > > > > csound"
>> > > > >
>> > > > >
>> > > >
>> > > >
>> > > >
>> > > > --
>> > > > http://www.badmuthahubbard.com
>> > > >
>> > > >
>> > > > Send bugs reports to this list.
>> > > > To unsubscribe, send email sympa@lists.bath.ac.uk with body >
>> "unsubscribe
>> > > csound"
>> > > >
>> > >
>> > >
>> > >
>> > >  Send bugs reports to this list.
>> > >  To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> "unsubscribe
>> > > csound"
>> > >
>> > >
>> >
>> >
>> >
>> > --
>> > http://www.badmuthahubbard.com
>> >
>> >
>> > Send bugs reports to this list.
>> > To unsubscribe, send email sympa@lists.bath.ac.uk with body 
>> > "unsubscribe
>> csound"
>> >
>>
>>
>>
>>  Send bugs reports to this list.
>>  To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>
>
> -- 
> http://www.badmuthahubbard.com
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound" 


Date2008-05-11 16:07
FromDave Phillips
Subject[Csnd] Re: Python API questions time
victor wrote:
> Well, there you go, that's your problem...
>
>> It isn't.
>>
>> On Sun, May 11, 2008 at 1:52 PM, victor  
>> wrote:
>>> See if _csnd.so is linked to libcsnd.so.5.1, use ldd
>>>
>>>  ldd _csnd.so
Confusion rules here. My build of Csound 5.08 generated a file named 
_csnd.so, it is not linked to anything. The file libcsnd.so.5.1 is found in
OPCODEDIR64, and it too is not linked to any other object (other than 
itself).

dlphilp@64studio:~/src/csound5.08$ ls -l *csnd.s*
-rwxr-xr-x 1 dlphilp dlphilp 2368739 2008-03-24 17:11 _csnd.so
lrwxrwxrwx 1 dlphilp dlphilp      14 2008-03-24 17:11 libcsnd.so -> 
libcsnd.so.5.1
-rwxr-xr-x 1 dlphilp dlphilp 1108221 2008-03-24 13:00 libcsnd.so.5.1

dlphilp@64studio:/usr/local/lib/csound/plugins64$ ls -l libcsnd*
-rwxr-xr-x 1 root staff 292624 2008-03-24 17:14 libcsnd.so
lrwxrwxrwx 1 root staff     10 2008-05-08 15:57 libcsnd.so.5.1 -> libcsnd.so

dlphilp@64studio:/usr/lib/python2.5/site-packages$ ls -l *snd*
-rw-r--r-- 1 root root 129045 2008-03-24 17:10 csnd.py

dlphilp@64studio:/usr/local/lib$ ls -l *csnd*
lrwxrwxrwx 1 root staff     14 2008-05-08 15:53 libcsnd.so -> libcsnd.so.5.1
-rwxr-xr-x 1 root staff 292624 2008-05-08 15:53 libcsnd.so.5.1

Items dated 2008-05-08 were added/linked after reading the advice from 
this list.


I'm still waiting for answers to these questions:

Exactly what Csound files ought to be in the Python site-packages 
directory ?

Does ImproSculpt support a double-precision build of Csound ? (Sorry, 
Oeyvind, I still need to verify that trapped.py and the other examples 
will work too).

No fear, I'm not whinging, I know that everyone is busy. But I think 
that some problems would be resolved if we knew just what's supposed to 
go where. Btw, perhaps in future the compile process could add a build 
directory and store its compiled files there ? The current situation 
creates a pretty messy top directory. Csound is currently the only 
program I build that still does that. I suppose it's not a big deal, but 
it would certainly reduce the clutter.

Best,

dp


Date2008-05-11 17:59
FromFelipe Sateler
Subject[Csnd] Re: Re: Python API questions time
AttachmentsNone  

Date2008-05-11 21:37
FromDavidW
Subject[Csnd] Re: Re: Python API questions time
On 12/05/2008, at 1:07 AM, Dave Phillips wrote:
...

> No fear, I'm not whinging, I know that everyone is busy. But I think  
> that some problems would be resolved if we knew just what's supposed  
> to go where. Btw, perhaps in future the compile process could add a  
> build directory and store its compiled files there ? The current  
> situation creates a pretty messy top directory. Csound is currently  
> the only program I build that still does that. I suppose it's not a  
> big deal, but it would certainly reduce the clutter.

I think the idea of a build directory is an EXCELLENT idea. ...
  Build first, move to appropriate location later = good factorization.
I work with a lot of SW that instals like that and I always feel I've  
got a better handle on what's going on.

David.

Date2008-05-12 05:12
FromJK
Subject[Csnd] Re: Re: Python API questions time
Dave Phillips wrote:

>>>> See if _csnd.so is linked to libcsnd.so.5.1, use ldd
>>>>
>>>>  ldd _csnd.so
> Confusion rules here. My build of Csound 5.08 generated a file named 
> _csnd.so, it is not linked to anything. The file libcsnd.so.5.1 is found in
> OPCODEDIR64, and it too is not linked to any other object (other than 
> itself).

I think there is a disconnect in terminology.

You seem to be talking about symbolic links (in the filesystem). victor
is talking about linkage in the ABI sense: when a binary (executable)
file contains references to symbols defined in another such file,
those files must be "linked" (by a dynamic linker) in order to
resolve those references before execution can occur.  These two
concepts are unrelated.  The important thing in this case is that
_csnd.so contains references to libcsnd.so.5.1, and therefore
the dynamic linker must be able to load lbcsnd.so.5.1 and resolve
the needed symbols whenever _csnd.so is loaded by the Python
interpreter.  For some reason the attempt to resolve these symbols
is failing; either because the dynamic linker cannot load
libcsnd.so.5.1, or because that library does not contain the symbols
of interest (or possibly other reasons I am forgetting).

-- JK

-- 
I do not particularly want to go where the money is -
  it usually does not smell nice there. -- A. Stepanov

Date2008-05-12 10:19
From"Chuckk Hubbard"
Subject[Csnd] Re: Re: Re: Python API questions time
AttachmentsNone  

Date2008-05-12 11:07
FromDave Phillips
Subject[Csnd] Re: Re: Re: Python API questions time
JK wrote:
> I think there is a disconnect in terminology.
>
> You seem to be talking about symbolic links (in the filesystem). victor
> is talking about linkage in the ABI sense: when a binary (executable)
> file contains references to symbols defined in another such file,
> those files must be "linked" (by a dynamic linker) in order to
> resolve those references before execution can occur.  These two
> concepts are unrelated.  The important thing in this case is that
> _csnd.so contains references to libcsnd.so.5.1, and therefore
> the dynamic linker must be able to load lbcsnd.so.5.1 and resolve
> the needed symbols whenever _csnd.so is loaded by the Python
> interpreter.  For some reason the attempt to resolve these symbols
> is failing; either because the dynamic linker cannot load
> libcsnd.so.5.1, or because that library does not contain the symbols
> of interest (or possibly other reasons I am forgetting).
Thanks JK, I understand the distinction clearly, and no, I did not know 
that Victor was referring to the symbol linkage. That clarifies things a 
bit more, but the problem remains. I'll do more testing today with the 
example *.py files.

Best,

dp


Date2008-05-12 13:59
FromVictor Lazzarini
Subject[Csnd] Re: Re: Re: Re: Python API questions time
Sorry I meant linking as in ld ... not ln
Anyway, it seems that Chuck's problem was a duff binary somewhere.
Could you remind us of yours?

Victor

At 11:07 12/05/2008, you wrote:
>Thanks JK, I understand the distinction clearly, and no, I did not know 
>that Victor was referring to the symbol linkage. That clarifies things a 
>bit more, but the problem remains. I'll do more testing today with the 
>example *.py files.
>
>Best,
>
>dp

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth


Date2008-05-17 12:49
FromDave Phillips
Subject[Csnd] testing the example Python scripts
Greetings,

I finally got around to testing the Python examples in 5.08. They didn't 
work.

To recap, here's the scenario: I've built and installed 5.08 with 
double-precision, the interface wrappers, and the Python extensions. The 
file _csnd.so is built but not installed with install.py. The file 
libcsnd.so is built and found in OPCODEDIR64. The csnd.py file has been 
placed in the site packages directory at /usr/local/lib/python2.5. 
According to directions from this list I also placed _csnd.so in the 
site packages directory.

I tested TrappedCsd.py and received this error:

dlphilp@64studio:~/src/csound5.08/examples$ python TrappedCsd.py
Traceback (most recent call last):
  File "TrappedCsd.py", line 6, in 
    import csnd
  File "/usr/local/lib/python2.5/site-packages/csnd.py", line 7, in 
    import _csnd
ImportError: libcsnd.so.5.1: cannot open shared object file: No such 
file or directory


OPCODEDIR64 is set in my .bashrc file. I softlinked libcsnd.so 
libcsnd.so.5.1 but that didn't make a difference. Is _csnd.so hard-coded 
to look for libcsnd.so.5.1 elsewheres ? Perhaps I'm missing an 
environment variable ?

At this point I think I've done everything I've been directed to do, but 
still get no joy with any Python/Csound scripts. Further suggestions are 
most welcome. :)

Double-precision Csound is a no-go with AlgoScore. Is it perhaps a 
problem with Python too ?

Best,

dp