|
Here is some info about my system that could be relevant:
> ls -l /usr/lib/libcs*
/usr/lib/libcsnd.so -> libcsnd.so.5.2
/usr/lib/libcsnd.so.5.2
/usr/lib/libcsound.so -> libcsound.so.5.2
/usr/lib/libcsound.so.5.2
> ldd /usr/lib/python2.6/site-packages/_csnd.so | grep libcs
libcsnd.so.5.2 => /usr/lib/libcsnd.so.5.2 (0xb78d4000)
That seems ok. From the command line given in my previous post, we can see
that _csnd is linked against both libcsnd and libcsound. I'm not an expert,
but I guess that just libcsnd (which is itself linked against libcsound) is
needed by _csnd. In fact, removing libcsound from the command:
g++ -o _csnd.so -Wl,-Bdynamic -Wl,-rpath-link,. -shared
interfaces/python_interface_wrap.os -L/usr/local/lib -L/usr/lib
-L/usr/lib/python2.6/config -L. -L. -L/usr/local/lib -L. -L.
-L/usr/lib/fltk-1.1 -lpython2.6 -llua -lstdc++ -lutil -lsndfile -lsndfile
-lpthread -lpthread -lm -lportaudio -lfltk -lasound -llo -lsndfile -ldl -lm
-lpthread libcsnd.so.5.2
builds a working _csnd.so module which is able to run, at least,
interfaces/test.py.
Then, reintroducing soname, but this time for libcsnd:
g++ -o _csnd.so -Wl,-Bdynamic -Wl,-rpath-link,. -shared
-Wl,-soname=libcsnd.so.5.2 interfaces/python_interface_wrap.os
-L/usr/local/lib -L/usr/lib -L/usr/lib/python2.6/config -L. -L.
-L/usr/local/lib -L. -L. -L/usr/lib/fltk-1.1 -lpython2.6 -llua -lstdc++
-lutil -lsndfile -lsndfile -lpthread -lpthread -lm -lportaudio -lfltk
-lasound -llo -lsndfile -ldl -lm -lpthread libcsnd.so.5.2
breaks the module again:
python -c "import csnd"
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.6/site-packages/csnd.py", line 7, in
import _csnd
ImportError: /usr/lib/python2.6/site-packages/_csnd.so: undefined symbol:
_ZN17CsoundUtilityList5CountEv
I'm really lost at this point :(. As you can see usr/lib/libcsnd.so.5.2 is
where it's supposed to be, but despite of this the linker fails to resolved
symbols defined by it when an specific version is required by means of a
soname, while the resolution succeed if the soname is omitted.
> grep ZN17CsoundUtilityList5CountEv /usr/lib/libcsnd.so
Binary file /usr/lib/libcsnd.so matches
Any help will be greatly appreciated.
Best regards
-Carlos
CarlosJP wrote:
>
> Hi all,
>
> when building with dynamicCsoundLibrary=1, python binding is unable to
> resolve some symbols:
>
> [carlos@carlos tmp]$ python -c "import csnd"
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/lib/python2.6/site-packages/csnd.py", line 7, in
> import _csnd
> ImportError: /usr/lib/libcsnd.so.5.2: undefined symbol:
> csoundInitTimerStruct
>
> I've tracked down the issue to find out that it's related to the use of
> soname=libcsound.so.5.2 while linking _csnd.so:
>
>> g++ -o _csnd.so -Wl,-Bdynamic -Wl,-rpath-link,. -shared
>> -Wl,-soname=libcsound.so.5.2 interfaces/python_interface_wrap.os
>> -L/usr/local/lib -L/usr/lib -L/usr/lib/python2.6/config -L. -L.
>> -L/usr/local/lib -L. -L. -L/usr/lib/fltk-1.1 -lpython2.6 -llua -lstdc++
>> -lutil -lsndfile libcsound.so.5.2 -lsndfile -lpthread -lpthread -lm
>> -lportaudio -lfltk -lasound -llo -lsndfile -ldl -lm -lpthread
>> libcsnd.so.5.2
>
> Removing that part, the problem is fixed:
>
>> g++ -o _csnd.so -Wl,-Bdynamic -Wl,-rpath-link,. -shared
>> interfaces/python_interface_wrap.os -L/usr/local/lib -L/usr/lib
>> -L/usr/lib/python2.6/config -L. -L. -L/usr/local/lib -L. -L.
>> -L/usr/lib/fltk-1.1 -lpython2.6 -llua -lstdc++ -lutil -lsndfile -lsndfile
>> -lpthread -lpthread -lm -lportaudio -lfltk -lasound -llo -lsndfile -ldl
>> -lm -lpthread libcsnd.so.5.2
>
>> cp _csnd.so /usr/lib/python2.6/site-packages/
>
>> python -c "import csnd"
>
> OK
>
> Do you think this fix could result in other problems? For now I've just
> modified SConstruct this way, at line 1115:
>
> < tmp += ['-Wl,-soname=%s' % libName2]
>> # tmp += ['-Wl,-soname=%s' % libName2]
>
> Please, tell me what do you think. I'm maintaining the archlinux csound5
> package and I don't want to introduce subtle bugs that I'm not aware of.
>
> Best regards
> -Carlos
>
>
>
>
>
--
View this message in context: http://www.nabble.com/Dynamic-libcsound-breaks-python-binding-tp21266916p21267233.html
Sent from the Csound - Dev mailing list archive at Nabble.com.
------------------------------------------------------------------------------
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |