Changes between Initial Version and Version 2 of Ticket #7465


Ignore:
Timestamp:
11/04/10 11:55:08 (11 years ago)
Author:
mvngu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7465

    • Property Report Upstream changed from to N/A
  • Ticket #7465 – Description

    initial v2  
    2323}}}
    2424
    25 Boom!!  This despite us shipping a Fortran compiler.
     25Any use of f2py, e.g. following the examples at http://www.sagemath.org/doc/numerical_sage/f2py.html lead to a crash:
    2626
    27 The problem is really that the doctests for {{{fortran.eval}}} were marked (by me, doh) as optional, and we don't test optional doctests frequently. 
     27{{{
     28error: Command "sage_fortran -Wall -shared /var/folders/LQ/LQFRAKFTGCCurtDiHcxv1k++-5I/-Tmp-
     29/tmpisjCMl/var/folders/LQ/LQFRAKFTGCCurtDiHcxv1k++-5I/-Tmp-
     30/tmpisjCMl/src.macosx-10.6-i386-2.6/fortran_module_0module.o
     31/var/folders/LQ/LQFRAKFTGCCurtDiHcxv1k++-5I/-Tmp-
     32/tmpisjCMl/var/folders/LQ/LQFRAKFTGCCurtDiHcxv1k++-5I/-Tmp-
     33/tmpisjCMl/src.macosx-10.6-i386-2.6/fortranobject.o
     34/var/folders/LQ/LQFRAKFTGCCurtDiHcxv1k++-5I/-Tmp-
     35/tmpisjCMl/Users/felix/.sage/temp/<my domain name>/52076/tmp_0.o -L"Using built-in specs.
     36/Applications/sage-4.3.1.rc1/local/bin/../lib/gcc/i686-apple-darwin8/4.2.3/x86_64"
     37-lgfortran -o ./fortran_module_0.so" failed with exit status 1
     38
     39i686-apple-darwin8-gfortran-4.2: no input files
     40i686-apple-darwin8-gfortran-4.2: no input files
     41i686-apple-darwin8-gfortran-4.2: unrecognized option '-shared'
     42i686-apple-darwin8-gfortran-4.2: no input files
     43i686-apple-darwin8-gfortran-4.2: unrecognized option '-shared'
     44i686-apple-darwin8-gfortran-4.2: no input files
     45i686-apple-darwin8-gfortran-4.2: no input files
     46i686-apple-darwin8-gfortran-4.2: no input files
     47i686-apple-darwin8-gfortran-4.2: unrecognized option '-shared'
     48i686-apple-darwin8-gfortran-4.2: no input files
     49i686-apple-darwin8-gfortran-4.2: unrecognized option '-shared'
     50i686-apple-darwin8-gfortran-4.2: no input files
     51Using built-in specs.
     52Target: i686-apple-darwin8
     53Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local
     54--mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
     55--build=i686-apple-darwin8 --host=i686-apple-darwin8 --target=i686-apple-
     56darwin8 --enable-languages=fortran
     57Thread model: posix
     58gcc version 4.2.3
     59
     60<SNIP>
     61}}}
     62
     63This is using 4.3.1rc1 on 10.6, 64-bit.
     64
     65The problem is that local/lib/python2.6/site-packages/numpy/distutils/fcompiler/gnu.py adds a "-shared" flag when linking, even though OS X doesn't support it.
     66
     67Mac OS X (Darwin) compilers do not support the "-shared" option. The class Sage_FCompiler_1 currently calls compilers on all platforms using the "-shared" option. So whenever this class is used on Mac, it fails. On my computer, this led to f2py failing. This is a five line patch (plus documentation) that changes the compiler options on Mac to be in line with those already used in Sage_FCompiler, while leaving the compiler options on other platforms such as Solaris unchanged. If you'd like to check it on Solaris, then go ahead, but the patch was intentionally written to avoid changing behaviour on platforms other than OS X.
     68
     69This breaks "on some mac systems" - f2py is broken on my 64-bit sage, but seems to be working on 32-bit mac systems without this patch. My guess is that 32-bit macs use Sage_FCompiler rather than Sage_FCompiler_1. Anyone who is familiar with the numpy spkg, please confirm or correct me!