[Numpy-discussion] gfortran, numpy build

Matthew Brett matthew.brett at gmail.com
Tue Jan 31 09:01:02 CST 2006


Hi,

I have the latest version of Mandrake, which has no g77, only gfortran
- and needed the following patch to compile (with some added g77,
gfortran outputs):

Index: numpy/distutils/fcompiler/gnu.py
===================================================================
--- numpy/distutils/fcompiler/gnu.py    (revision 2033)
+++ numpy/distutils/fcompiler/gnu.py    (working copy)
@@ -20,8 +20,13 @@
     #         GNU Fortran (GCC) 3.3.3 (Debian 20040401)
     #         GNU Fortran 0.5.25 20010319 (prerelease)
     # Redhat: GNU Fortran (GCC 3.2.2 20030222 (Red Hat Linux
3.2.2-5)) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
+    # Mandrake: GNU Fortran (GCC) 3.3.6 (Mandrakelinux release 3.3.6-2mdk)
+    #
+    # 'gfortran --version' results
+    # Redhat:   GNU Fortran 95 (GCC 4.0.2 20051125 (Red Hat 4.0.2-8))
+    # Mandrake: GNU Fortran 95 (GCC 4.0.1 (4.0.1-5mdk for Mandriva
Linux release 2006.0))

-    for fc_exe in map(find_executable,['g77','f77']):
+    for fc_exe in map(find_executable,['g77','f77','gfortran']):
         if os.path.isfile(fc_exe):
             break
     executables = {
@@ -41,7 +46,10 @@
     if os.name != 'nt' and sys.platform!='cygwin':
         pic_flags = ['-fPIC']

-    g2c = 'g2c'
+    if os.path.basename(fc_exe) == 'gfortran':
+        g2c = 'gfortran'
+    else:
+        g2c = 'g2c'

     #def get_linker_so(self):
     #    # win32 linking should be handled by standard linker

Can I suggest this a patch to svn numpy?

Thanks,

Matthew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gfortran.patch
Type: text/x-diff
Size: 1259 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060131/0d881ced/attachment.bin 


More information about the Numpy-discussion mailing list