[Numpy-discussion] gfortran, numpy build

Pearu Peterson pearu at scipy.org
Tue Jan 31 12:21:02 EST 2006


Hi,

numpy.distutils has already support for both g95 and gfortran compilers.
Run
   python setup.py config_fc --help-fcompiler
to see a list of supported Fortran compilers.

Pearu

On Tue, 31 Jan 2006, Bruce Southey wrote:

> Hi,
> Perhaps it would also make sense to add g95 (http://g95.sourceforge.net/ or
> g95.org) which is different than gfortran (
> http://gcc.gnu.org/wiki/TheOtherGCCBasedFortranCompiler).
>
> Regards
> Bruce
>
> On 1/31/06, Matthew Brett <matthew.brett at gmail.com> wrote:
>>
>> 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
>>
>>
>>
>




More information about the NumPy-Discussion mailing list