> > I was just wondering what plans there were to reflect the different
> > linker options (i.e. -bundle instead of -shared) that are required  
> on
> > OSX in the fcompiler files within distutils. While its a minor thing
> > it always catches the users of my software when they either install
> > fresh or update numpy ... and sometimes on a bad day it even catches
> > me ;-)
>
> I'm sorry; I don't follow. What problems are you having? --
> -- Robert Kern
>
-----------------------------------------------

OK for example the distribution g95.py in distutils/fcompiler has the  
following code

        executables = {
            'version_cmd'  : ["g95", "--version"],
            'compiler_f77' : ["g95", "-ffixed-form"],
            'compiler_fix' : ["g95", "-ffixed-form"],
            'compiler_f90' : ["g95"],
            'linker_so'    : ["g95","-shared"],
            'archiver'     : ["ar", "-cr"],
            'ranlib'       : ["ranlib"]
            }

For osx you need to modify it to

      executables = {
            'version_cmd'  : ["g95", "--version"],
            'compiler_f77' : ["g95", "-ffixed-form"],
            'compiler_fix' : ["g95", "-ffixed-form"],
            'compiler_f90' : ["g95"],
            'linker_so'    : ["g95","-shared"],
            'archiver'     : ["ar", "-cr"],
            'ranlib'       : ["ranlib"]
            }
    import sys
    if sys.platform.lower() == 'darwin':
        executables[linker_so'] = ["g95","-Wall -bundle"]

The 'shared' option is not implemented in the osx linker. Not sure  
what the underlying difference between 'shared' and 'bundle' is but  
this substitution is necessary and this has been working for me for  
the last year or so. You also need the -Wall but for reasons that  
completely escape me.

The same goes for gfortran and intel (both of which I use) and I  
assume the other compilers that are available for OSX.


====================================================================
Prof Garry Willgoose,
Australian Professorial Fellow in Environmental Engineering,
Director, Centre for Climate Impact Management (C2IM),
School of Engineering, The University of Newcastle,
Callaghan, 2308
Australia.

Centre webpage: www.c2im.org.au

Phone: (International) +61 2 4921 6050 (Tues-Fri AM); +61 2 6545 9574  
(Fri PM-Mon)
FAX: (International) +61 2 4921 6991 (Uni); +61 2 6545 9574 (personal  
and Telluric)
Env. Engg. Secretary: (International) +61 2 4921 6042

email:  garry.willgo...@newcastle.edu.au; g.willgo...@telluricresearch.com
email-for-life: garry.willgo...@alum.mit.edu
personal webpage: www.telluricresearch.com/garry
====================================================================
"Do not go where the path may lead, go instead where there is no path  
and leave a trail"
                           Ralph Waldo Emerson
====================================================================





_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to