William Stein wrote:
> 2009/6/28 Dr. David Kirkby <david.kir...@onetel.net>:
>> Arnaud Bergeron wrote:
>>
>>> Then change the function to this:
>>>
>>> def sonameprefix(env):
>>>      if env['PLATFORM']=="darwin":
>>>          return "-Wl,-dylib_install_name -Wl,"
>>>      elif env['PLATFORM']==<what you found>:
>>>          if 'GNU' in os.system('ld --version'):
>>>             return <GNU flags>
>>>          else:
>>>              return <non-GNU flags>
>>>      else:
>>>          return '-Wl,-soname,'
>>>
>>> And it should work.
>>>
>>> Arnaud
>> Thank you very much. I'll try that now. I just did a quick hack and
>> forced the flags to for Solaris with the Sun linker, but it would have
>> broken on linux. I'll now do this properly.
>>
>> I'll have to get a book on python - I guess a visit to amazon.co.uk is
>> in order!
>>
> 
> The best books are "Dive Into Python" (tutorial), "Python in a
> Nutshell" (reference), "Python Cookbook" (nontrivial examples).
> 
> William

Thank you. A couple of hours ago I ordered 'Core PYTHON Programming' by 
Wesley Chun

http://www.amazon.co.uk/exec/obidos/ASIN/0132269937/ref=ox_ya_os_product

which appeared to get very good reviews, but is a few years old.

I found 'Dive Into Python by Mark Pilgrim (2004) on Amazon'

http://www.amazon.co.uk/Dive-into-Python-3-Pilgrim/dp/1430224150/ref=sr_1_2?ie=UTF8&s=books&qid=1246227275&sr=1-2

But I note there is a Dive into Python 3, by the same author, which is 
not yet released, but is out in 3 months

http://www.amazon.co.uk/Dive-into-Python-3-Pilgrim/dp/1430224150/ref=sr_1_2?ie=UTF8&s=books&qid=1246227275&sr=1-2

perhaps I'll wait for the update.


I thin' I might leave the reference book, as I guess the online 
reference is going to be more upto date.


FWIW, I could not get Arnaud's code to work for me exactly , as written 
as os.system returns the exit code of the program, so searching for GNU 
in the output always failed.

The following seemed to work for me, which is heavily based on Arnaud's 
program. It replies on the fact the GNU compiler will exit with 0 if 
called with --version, as it is a valid option. In contrast, the Sun 
linker will not. as its an error.

I'll add that to Trac #6437 in half hour or so, so hopefully that will 
be one more which will build on Solaris with the Sun linker. I've built 
a gcc with the Sun linker on t2 now - I'll annouce details when things 
are set up properly, as now it is just compiled.


def sonameprefix(env):
     print ("Checking for the operating system and linker, to find 
appropiate flags for the linker.")
     if env['PLATFORM']=="darwin":
         return "-Wl,-dylib_install_name -Wl,"
     elif env['PLATFORM']=="sunos":
         # if GNU in os.system('ld --version 2>&1 /dev/null '):
         if os.system('ld --version > /dev/null 2>&1 ') == 0  :
            print ("You are using the GNU linker on Solaris. Linker flag 
set to -soname")
            print ("Genererally, the Sun linker is recked to be better 
on Solaris")
            print ("but Sage has been built using the GNU linker")
            return '-Wl,-soname'  # GNU linker on Solaris
         else:
            print ("You are using the Sun linker on Solaris. Linker flag 
set to -h")
            return '-Wl,-h'       # Sun linker on Solaris
     else:
         return '-Wl,-soname,'    # Everything else, including linux






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

Reply via email to