Alexander Dreyer wrote:
> Dear Dave,
>> From
>> http://developers.sun.com/solaris/articles/cmp_stlport_libCstd.html
>> I read, that one might have to build with  -library=stlport4 .
>>
>> I'll try it out.
> Ok, that was the right direction. I did some experiments with standalone
> PolyBoRi, I had to change the code at some places (template-related
> stuff). But, when compiled and linked, I got the following error:
> 
> problem in polybori - ImportError: ld.so.1: python2.4: fatal: relocation
> error: file
> /home/dreyer/pbtest/current/polybori/pyroot/polybori/dynamic/PyPolyBoRi.so:
> symbol __1cDstdEcerr_: referenced symbol not found
> 
> Any ideas?
> 
> Best regards,
>   Alexander

Hi Alexander,

the following might be worth a try to get PolyBoRi to work with the Sun 
compiler. Since you have patched the PolyBoRi source, and I do not have that, 
I've not actually built it, but this looks hopeful.

I started with the latest python sources, and did not apply any of the numerous 
patches in Sage. Neither did I worry about any optional bits python might like. 
I'm not sure if they are need for PolyBoRi to work. If so, they would have to 
be 
built.

There's an interesting looking option to python's configure script.

  --with-cxx-main=<compiler>
                           compile main() and link python executable with C++
                           compiler

I added that option to the configure command line.

The resulting Makefile still builds 99% of python with the C compiler though.

Anyway, this is what I did:

kir...@t2:[/scratch/kirkby/Python-2.6.4] $ export CC=/opt/SUNWspro/bin/cc
kir...@t2:[/scratch/kirkby/Python-2.6.4] $ export CXX=/opt/SUNWspro/bin/CC
kir...@t2:[/scratch/kirkby/Python-2.6.4] $ ./configure 
---with-cxx-main='/opt/SUNWspro/bin/CC -library=stlport4'

(For some reason, adding the -library=stlport4 to CXXFLAGS would not work, so I 
had to do it like that above)

On my OpenSolaris x86 machine, typing 'make' will produce a working python.

However, on the Sun T5240 (t2), the Makefile has some really odd option it 
passes to the C compiler (-OPT:Olimit=0). I've no idea what it is doing there! 
So I stripped that option out with sed:

kir...@t2:[/scratch/kirkby/Python-2.6.4] $ sed 's/-OPT:Olimit=0//g' Makefile > a
kir...@t2:[/scratch/kirkby/Python-2.6.4] $ mv a Makefile

Then typed 'make'

kir...@t2:[/scratch/kirkby/Python-2.6.4] $ make

That builds a python which is linked against the C++ library you need to link 
PolyBoRi with.

kir...@t2:[/scratch/kirkby/Python-2.6.4] $ ldd ./python
         libsocket.so.1 =>        /lib/libsocket.so.1
         libnsl.so.1 =>   /lib/libnsl.so.1
         librt.so.1 =>    /lib/librt.so.1
         libdl.so.1 =>    /lib/libdl.so.1
         libm.so.2 =>     /lib/libm.so.2
         libstlport.so.1 =>       /opt/SUNWspro/lib/stlport4/libstlport.so.1
         libCrun.so.1 =>  /usr/lib/libCrun.so.1
         libc.so.1 =>     /lib/libc.so.1
         libmp.so.2 =>    /lib/libmp.so.2
         libmd.so.1 =>    /lib/libmd.so.1
         libscf.so.1 =>   /lib/libscf.so.1
         libaio.so.1 =>   /lib/libaio.so.1
         libm.so.1 =>     /lib/libm.so.1
         libdoor.so.1 =>  /lib/libdoor.so.1
         libuutil.so.1 =>         /lib/libuutil.so.1
         libgen.so.1 =>   /lib/libgen.so.1
         /platform/SUNW,T5240/lib/libc_psr.so.1
         /platform/SUNW,T5240/lib/libmd_psr.so.1


I'd be interested if PolyBori works with python configured like that.

http://developers.sun.com/solaris/articles/cmp_stlport_libCstd.html

says you can't mix the libCstd and libstlport libraries. However, they will be 
mixed if python is not built with the compiler option '-library=stlport4', but 
PolyBoRi is built with that option. Since we do not care about backward 
compatibility with older releases of Sun's C++ compiler, I'm not aware of any 
reason the compiler option -library=stlport4 should not be added to all the 
parts of Sage that use the Sun C++ compiler.

PS, there's a note in Sage's spkg-install to say do NOT add the option 
'--enable-shared' as it breaks python in at least version 2.5. I've not tried 
this on any machines other than my OpenSolaris machine (Xeon processor) and 
't2' 
(UltraSPARC T2+ processor), but that option works fine on both those machines 
using the latest python sources.

Dave

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to